Last active
January 30, 2025 01:11
-
-
Save umputun/151063e94a55fcf0ff67ae4c75ee871f to your computer and use it in GitHub Desktop.
Raycast script for Safari's page summary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# @raycast.schemaVersion 1 | |
# @raycast.title Summarize Safari page | |
# @raycast.mode fullOutput | |
# | |
# Optional parameters: | |
# @raycast.icon ✨ | |
# | |
# @raycast.packageName Things | |
set -e | |
content=$(osascript -e ' | |
tell application "Safari" | |
set theText to text of front document | |
end tell | |
') | |
echo "$content" | OPENAI_OMIT_HISTORY=true OPENAI_API_KEY=sk-хххххх chatgpt "Please summarize the main points in a few sentences. Then, list up to five detailed bullet points. Provide the response in plain text. Finally, include a sentiment analysis of the text. Do not add any additional information." | |
# requires chatgpt-cli installed, see https://github.com/kardolus/chatgpt-cli. | |
# requires OPENAI_API_KEY | |
# to change the model use `chatgpt --set-model=<model>` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment