This project sends notifications with AI-generated interesting facts about specified topics using ntfy.sh.
Daily Fact Ntfy
is a shell script that:
- Generates a subtopic about your chosen topic
- Creates an interesting fact about that subtopic in the context of your topic using an AI language model
- Optionally waits a random amount of time within a specified range
- Sends this fact as a notification via ntfy.sh
- zsh shell
- curl
- uv (for ShellArgParser)
- llm (an AI language model CLI tool)
- An ntfy.sh topic
-
Clone this repository:
git clone https://github.com/yourusername/Daily_Fact_Ntfy cd Daily_Fact_Ntfy
-
Make the script executable:
chmod +x Daily_Fact_Ntfy.sh
Basic usage:
./Daily_Fact_Ntfy.sh --topic TOPIC --ntfy_topic TOPIC_NAME [options]
Required arguments:
--topic TOPIC
: Main topic to generate facts about--ntfy_topic TOPIC_NAME
: Ntfy.sh topic name for notifications
Optional arguments:
--min_t MIN
: Minimum seconds to wait (default: 0)--max_t MAX
: Maximum seconds to wait (default: 1)--topic_extra_args ARGS
: Additional arguments for topic LLM call--subtopic_extra_args ARGS
: Additional arguments for subtopic LLM call--topic_extra_rules RULES
: Additional rules for topic generation--subtopic_extra_rules RULES
: Additional rules for subtopic generation--verbose
: Enable verbose logging--strip-thinking
: Remove ... tags from output
Example:
./Daily_Fact_Ntfy.sh --topic "Psychiatry" --ntfy_topic "my-notifications" --min_t 3600 --max_t 7200
This will:
- Generate a subtopic about psychiatry (say 'simulating depression in mice')
- Create an interesting fact about that subtopic (the explanation about the subtopic)
- Wait between 1 to 2 hours (to be surprised by the notification on your phone)
- Send the fact as a notification via ntfy.sh
You can customize the behavior of the AI language model by providing additional arguments through --topic_extra_args
or --subtopic_extra_args
. These are passed directly to the llm
command. For example:
./Daily_Fact_Ntfy.sh --topic "Psychiatry" --ntfy_topic "my-notifications" --topic_extra_args "-m gpt-4 -o temperature 0.7"
More advanced example using Claude, custom rules, and thinking tags:
./Daily_Fact_Ntfy.sh --ntfy_topic "my-notifications" \
--topic "Psychiatry research" \
--min_t 0 --max_t 5 \
--subtopic_extra_args "-m claude -o temperature 2" \
--topic_extra_args "-m claude -o temperature 1.5" \
--topic_extra_rules "Answer in B1 level spanish from Argentina. Use a style similar to 'Pàgina 12'. For length 2 to 3 paragraphs. Start your answer by your internal thoughts in <thinking> tags then answer directly." \
--verbose --strip-thinking
This will:
- Use Claude instead of the default model
- Generate facts in Spanish
- Remove the model's thinking process from the output
- Send the notification almost immediately (0-5 seconds delay)
Note: Default temperatures are:
- 2.0 for subtopic generation
- 1.5 for fact generation
Contributions, issues, and feature requests are welcome. Feel free to check issues page if you want to contribute.