Summarized by "Google via API"
Define a list of iOS calendars and reminder lists which are used to fetch your scheduled events for the week, and have Gemini read back a summary of your agenda along with the weather, translated into the specified language.
Uses "Gemini via API" shortcut and "Weather summary" shortcut.
What's New
Version 1.0
First release
What it does
125 actions-
CommentWeekly agenda and weather By Tim Wilson, November 2023 Use Google Gemini to read back a natural summary of your week’s agenda along with weather information. Uses “Gemini via API” shortcut https://routinehub.co/shortcut/17624/. And “Weather Summary”…
-
CommentEnter language into which Google Gemini should translate responses
-
Text
-
Change Case
-
CommentEnter your name
-
Text
-
CommentEnter a list of calendars that should be used to check your daily agenda
-
Text
-
CommentEnter a list of reminder lists that should be used in creating your agenda.
-
Text
-
CommentFor checking for overdue reminders, how many days into the past should be checked?
-
Number
-
CommentCheck for shortcut updates
-
Nothing
-
Comment【Auto-Update Routine】 Checks For Latest Shortcut Version ↳ https://routinehub.co/shortcut/16590/
-
Dictionary
-
Get Dictionary Value
-
If
-
Get IP Address
-
If
-
Get Contents of URLhttps://routinehub.co/api/v1/shortcuts/…/versions/latest
-
If
-
Split Text
-
Repeat with Each
-
Calculate Expression
-
Set VariableLatest Version
-
Split Text
-
Repeat with Each
-
Calculate Expression
-
Set VariableCurrent Version
-
If
-
Choose from MenuNew Version: … Release: … Whats New: "…"
-
Choose from MenuUpdate → Result (Version)
-
Expand URL
-
Replace Text
-
Open URLs
-
Stop This Shortcut
-
Choose from MenuSkip (Info (Version))
-
Comment【Auto-Update Routine Ends Here】 Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/ 【⚙️】 Convert Semantic Number to Decimals ↳ https://routinehub.co/shortcut/16589/
-
Nothing
-
CommentBegin dependency check (using “Check-install dependencies (v1)” by Tim Wilson: https://routinehub.co/shortcut/17694/) Dictionary of dependencies, where each: * Key is the name fo the shortcut (used to check if install, so much match perfectly), and …
-
Dictionary
-
Get My Shortcuts
-
Repeat with Each
-
Filter Files
-
If
-
Get IP Address
-
If
-
Show Result
-
If
-
Show Result
-
Get Dictionary Value
-
Set VariableURL
-
Match Text
-
If
-
Get Contents of URLhttps://routinehub.co/api/v1/shortcuts/…/versions/latest
-
Expand URL
-
Set VariableURL
-
Replace Text
-
Open URLs
-
Stop This Shortcut
-
Nothing
-
CommentEnd dependency check
-
Text
-
Text
-
Date
-
Nothing
-
Set VariableEvents
-
Get Time Between Dates
-
If
-
Text
-
If
-
Text
-
Dictionary
-
Run ShortcutGemini via API
-
Speak Text
-
Number
-
Find Calendar Events
-
Repeat with Each
-
Match Text
-
If
-
Get Details of Calendar Events
-
Text
-
Add to Variable
-
Adjust Date
-
Adjust Date
-
Adjust Date
-
Set VariableReminders
-
Find Reminders
-
Repeat with Each
-
Match Text
-
If
-
Get Details of Reminders
-
Text
-
Add to Variable
-
Get Current Location
-
Get Current Weather
-
Run ShortcutWeather summary
-
Get Weather Forecast
-
Run ShortcutWeather summary
-
Get Weather Forecast
-
Run ShortcutWeather summary
-
If
-
Text
-
If
-
Text
-
If
-
If
-
Text
-
If
-
Text
-
Text
-
If
-
Text
-
Text
-
Dictionary
-
Run ShortcutGemini via API
-
Replace Text
-
Set VariableOutput
-
If
-
Text
-
Dictionary
-
Run ShortcutGemini via API
-
Set VariableOutput
-
Speak Text
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/web'
#include 'actions/text'
#define color blue
#define glyph calendar
/*
Weekly agenda and weather
By Tim Wilson, November 2023
Use Google Gemini to read back a natural summary of your week’s agenda along with weather information.
Uses “Gemini via API” shortcut https://routinehub.co/shortcut/17624/. And “Weather Summary” shortcut.
*/
// Enter language into which Google Gemini should translate responses
const OutLanguage = "English"
const OutLanguageLower = uppercase(OutLanguage)
// Enter your name
const UserName = ""
// Enter a list of calendars that should be used to check your daily agenda
const ListOfCalendars = "Home\nWork"
// Enter a list of reminder lists that should be used in creating your agenda.
const ReminderListList = "Work\nReminders"
// For checking for overdue reminders, how many days into the past should be checked?
const ReminderNumPastDays = 7
// Check for shortcut updates
nothing()
/*
【Auto-Update Routine】
Checks For Latest Shortcut Version
↳ https://routinehub.co/shortcut/16590/
*/
const Info = {
"Author": "twilsonco",
"RoutineHub ID": 17675,
"Version": "1.1.1",
"Version Check": true
}
const True = getValue(Info, "Version Check")
if True == "Yes" {
const CurrentIPAddress = getExternalIP("IPv4")
if CurrentIPAddress {
const Result = downloadURL("https://routinehub.co/api/v1/shortcuts/{Info['RoutineHub ID']}/versions/latest")
if Result contains "success" {
const SplitText = splitText(Result['Version'], ".")
for _ in SplitText {
@LatestVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@LatestVersion
}
const SplitText1 = splitText(Info['Version'], ".")
for _ in SplitText1 {
@CurrentVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@CurrentVersion
}
if @LatestVersion > @CurrentVersion {
menu "New Version: {Result['Version']}\nRelease: {Result['Release']}\nWhats New: \"{Result['Notes']}\"" {
item "Update → {Result['Version']}":
expandURL(Result['URL'])
const UpdatedText = replaceText("https://www.icloud.com/", "shortcuts://", false)
openURL(UpdatedText)
stop()
item "Skip ({Info['Version']})":
}
}
}
}
}
/*
【Auto-Update Routine Ends Here】
Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/
【⚙️】
Convert Semantic Number to Decimals
↳ https://routinehub.co/shortcut/16589/
*/
nothing()
/*
Begin dependency check
(using “Check-install dependencies (v1)” by Tim Wilson: https://routinehub.co/shortcut/17694/)
Dictionary of dependencies, where each:
* Key is the name fo the shortcut (used to check if install, so much match perfectly), and each value is either:
* The RoutineHub ID (number), or
* The URL (text type; iCloud link to shortcut or some other URL)
*/
const DependencyDict = {
"Gemini via API": 17624,
"Weather summary": 17674
}
const FullShortcutList = getShortcuts()
for _ in DependencyDict['Keys'] {
const Files = filterFiles(FullShortcutList, 1, "Last Modified Date", "Latest First")
if !Files {
const CurrentIPAddress1 = getExternalIP()
if !CurrentIPAddress1 {
show("This shortcut depends on the \"{@RepeatItem}\" shortcut, which was not found (by name) in your installed Shortcuts. You need to be connected to the internet in order to install it. Please connect and try again.")
} else {
show("This shortcut depends on the \"{@RepeatItem}\" shortcut, which was not found (by name) in your installed Shortcuts. Contiunue to install it now, then try this Shortcut again.")
@URL = DependencyDict[@RepeatItem]
const Matches = containsText(DependencyValue, "^[0-9]+$")
if Matches {
const Result1 = downloadURL("https://routinehub.co/api/v1/shortcuts/{DependencyValue}/versions/latest")
expandURL(Result1['URL'])
@URL
}
const UpdatedText1 = replaceText("https://www.icloud.com/", "shortcuts://", @URL, false)
openURL(UpdatedText1)
}
stop()
}
}
nothing()
// End dependency check
const TranslationPrompt = "I need to translate some text from English to {OutLanguage}. Where there are dates and times, I need to convert them into the appropriate format. For example, convert times to 24-hour time if necessary, and use the correct versions of \\"AM\\" and \\"PM\\" used in {OutLanguage}. \n\nThe text contains a summary of weather conditions as well, so please rephrase that in the new language in the style of a professional meteorologist from the language's country of origin. \n\nDo not include the original English message; only respond with the translated text. \n\nNow, please translate the following text into {OutLanguage}. \n\n"
const TranslationPromptShort = "please translate your response into the following language: {OutLanguage}. Do not include the English version of your response; only include your response translated into {OutLanguage}."
const Now = currentDate()
nothing()
@Events
rawAction("is.workflow.actions.gettimebetweendates", {
"WFInput": "{Now}",
"WFTimeUntilFromDate": "12:00PM"
})
if TimeBetweenDates <= 0 {
} else {
}
const Dictionary = {
"disablelogging": 1,
"prompt": "{}"
}
run("Gemini via API", Dictionary)
speak(['output'], false, "en-US")
const NumberOfDays = 7
rawAction("is.workflow.actions.filter.calendarevents", {
"WFContentItemFilter": "",
"WFContentItemSortOrder": "Oldest First",
"WFContentItemSortProperty": "Start Date"
})
for _ in CalendarEvents {
const Matches1 = containsText(ListOfCalendars, @RepeatItem['Calendar'], true)
if Matches1 {
getEventDetail(@RepeatItem, "Start Date")
@Events += "{\\"title\\": \\"{@RepeatItem}\\", \\"start\\": \\"{}\\", \\"end\\": \\"{@RepeatItem['End Date']}\\", \\"duration\\": \\"{@RepeatItem['Duration']}\\", \\"all day\\": \\"{@RepeatItem['Is All Day']}\\", \\"location\\": \\"{@RepeatItem['Location']}\\", \\"attendees\\": \\"{@RepeatItem['Attendees']}\\", \\"calendar\\": \\"{@RepeatItem['Calendar']}\\"}"
}
}
const OneWeekAgo = adjustDate(Now, "Subtract")
adjustDate(Now, "Add")
const TonightMidnight = adjustDate(, "Get Start of Day")
@Reminders
rawAction("is.workflow.actions.filter.reminders", {
"WFContentItemFilter": "",
"WFContentItemSortOrder": "Oldest First",
"WFContentItemSortProperty": "Due Date"
})
for _ in Reminders {
const Matches2 = containsText(ReminderListList, @RepeatItem['List'])
if Matches2 {
rawAction("is.workflow.actions.properties.reminders", {
"WFContentItemPropertyName": "Due Date",
"WFInput": "@RepeatItem"
})
@Reminders += "{\\"title\\": \\"{@RepeatItem}\\", \\"due date\\": \\"{}\\"}"
}
}
const CurrentLocation = getCurrentLocation()
const CurrentWeather = getCurrentWeather(CurrentLocation)
const CurWeatherStr = run("Weather summary", CurrentWeather)
const HourlyForecast = getWeatherForecast("Hourly")
const HourlyWeatherStr = run("Weather summary", HourlyForecast)
const DailyForecast = getWeatherForecast("Daily")
const DailyWeatherStr = run("Weather summary", DailyForecast)
if @Events {
} else {
const BlankText = "Please inform me that I have no more scheduled events for the week. \n\n"
}
if @Reminders {
if @Events {
} else {
}
} else {
}
const Prompt = "{EventReminderPrompts}Please summarize the following weather information for {CurrentLocation['City']} fetched at {Now}. First discussing current temperatures and conditions, and then how those will change for the remainder of the day, followed by the daily summary. When summarizing it, please verbally combine temperatures or conditions that persist over several hours or days. Summarize it the style of a professional meteorologist. \n\nCurrent weather:\n{CurWeatherStr}\n\nHourly forecast:\n{HourlyWeatherStr}\n\nDaily forecast:\n{DailyWeatherStr}\n\nPlease write this in paragraph form, avoiding long words. Please be as concise as possible. Include a polite closing. Do not ask if I need more help or assistance. Do not include a greeting. The event and reminder summaries should precede the weather summary."
const Dictionary1 = {
"disablelogging": 1,
"prompt": "{Prompt}"
}
run("Gemini via API", Dictionary1)
replaceText("°(F|C)", "", ['output'], false, true)
@Output
if OutLanguageLower != "english" {
const Dictionary2 = {
"disablelogging": 1,
"prompt": "{}"
}
run("Gemini via API", Dictionary2)
@Output = ['output']
}
speak(@Output, true, "en-US")
Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.
Ratings & Reviews
Write a Review–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Advertisement
More by twilsonco
You Might Also Like
Advertisement