Summarize an article from a website using Google Gemini Pro
Share a url from Safari/Chrome/etc and have Google Gemini Pro summarize it in natural language. Because Gemini has a 30k token input cap, this works for very long articles.
Uses the "Gemini via API" shortcut.
Novidades
Versão 1.0
First release
O que ele faz
70 ações-
CommentSummarize article with Google Gemini Pro Tim Wilson, January 2024 Summarizes an article from a website using the “Gemini via API” shortcut. https://routinehub.co/shortcut/17624/
-
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
-
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
-
Set VariableInputURL
-
Get Device Details
-
If
-
Get Article using Safari Reader
-
If
-
Get Article Detail
-
Get Article Detail
-
Get Article Detail
-
Text
-
If
-
Get Contents of Web Page
-
If
-
Get Contents of URL…
-
Count
-
If
-
Text
-
Dictionary
-
Run ShortcutGemini via API
-
Show Result
-
If
-
Text
-
Show Result
Ver como código
Todas as ações deste atalho escritas em Cherri, uma linguagem de programação para o app Atalhos. Ótimo para aprender como ele funciona.
#include 'actions/web'
#include 'actions/network'
#define color teal
#define glyph newsArticle
/*
Summarize article with Google Gemini Pro
Tim Wilson, January 2024
Summarizes an article from a website using the “Gemini via API” shortcut. https://routinehub.co/shortcut/17624/
*/
// Check for shortcut updates
nothing()
/*
【Auto-Update Routine】
Checks For Latest Shortcut Version
↳ https://routinehub.co/shortcut/16590/
*/
const Info = {
"Author": "twilsonco",
"RoutineHub ID": 17676,
"Version": "1.1.0",
"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
}
const FullShortcutList = getShortcuts()
for _ in DependencyDict['Keys'] {
const Files = filterFiles(FullShortcutList, 1, "Last Modified Date", "Latest First")
if !Files {
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
@InputURL = ShortcutInput
const DeviceModel = getDeviceDetail("Device Model")
if DeviceModel != "Mac" {
const Article = getArticle(@InputURL)
if Article {
getArticleDetail(Article, "Title")
getArticleDetail(Article, "Author")
getArticleDetail(Article, "Body")
} else {
getWebpageContents(@InputURL)
}
} else {
downloadURL(@InputURL)
}
const Count = count(IfResult, "Words")
if Count > 10 {
const Dictionary = {
"disablelogging": 1,
"prompt": "{}"
}
run("Gemini via API", Dictionary)
show(['output'])
} else {
show()
}
Abrir no Cherri Playground
Descompilado com cherri 2.3.0 (GPL-2.0). Pode precisar de pequenos ajustes antes de compilar.
Avaliações e comentários
Escrever uma avaliação–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Ainda não há avaliações. Seja o primeiro a compartilhar o que você pensa!
Publicidade
Mais de twilsonco
Você também pode gostar
Publicidade