SMF Works — AI Solutions for Small Business
← Back to all skills
Freedaily-news-digest

Daily News Digest

Start your day informed with a personalized news digest. Choose your favorite categories (business, technology, science, health, sports, entertainment) and get top headlines delivered automatically. Requires your own free NewsAPI key from newsapi.org.

Key Features

  • Choose from 7 news categories
  • Set your country for local headlines
  • Configure articles per category
  • Clean, formatted output for messaging
  • Schedule daily delivery via cron

Common Use Cases

  • Morning briefing with business and tech news
  • Stay informed without doom-scrolling
  • Weekly industry news summary
  • Quick catch-up on current events

Custom Workflow Integration

This skill can be customized for your specific workflow as part of an SMF Works services engagement. Whether you need custom automation rules, integrations with your existing tools, or specialized configurations for your team, we can tailor this skill to fit your exact requirements.

Explore Services

Installation

# Install the skill (via TUI or CLI)

smfw install daily-news-digest

# Get help

smfw run daily-news-digest --help

💡 Tip: Install via the OpenClaw TUI skill manager for an interactive experience, or use the CLI command above.

Setup Guide

Daily News Digest — Setup Guide

Estimated setup time: 10 minutes
Difficulty: Easy
Tier: Free — skill is free; requires a free NewsAPI.org API key


What You'll Need

RequirementDetailsCost
Python 3.8+Built into macOS 12+, available on LinuxFree
smfworks-skills repositoryCloned via gitFree
NewsAPI.org accountFree, no credit card requiredFree
NewsAPI keyGenerated after account creationFree (100 requests/day)
Internet connectionRequired to fetch news

Step 1 — Verify Python

python3 --version

Expected: Python 3.9.x or newer.


Step 2 — Get the Repository

git clone https://github.com/smfworks/smfworks-skills ~/smfworks-skills

Step 3 — Get a Free NewsAPI Key

The skill requires a free API key from NewsAPI.org. Here's how to get one:

3a — Go to the registration page:
Open your browser and visit: https://newsapi.org/register

3b — Fill out the form:

  • First name / Last name
  • Email address
  • Password

3c — Confirm your email:
Check your inbox for a confirmation email from NewsAPI. Click the verification link.

3d — Find your API key:
After confirming, log in and go to your dashboard at newsapi.org/account. Your API key is displayed there. It looks like this:

YOUR_NEWSAPI_KEY_HERE

3e — Save your key somewhere temporarily (you'll paste it into the configuration wizard in Step 6).

Free plan limits:

  • 100 API requests per day
  • Top headlines only (no full article text)
  • No commercial use

This is more than sufficient for daily personal use with one or two runs per day.


Step 4 — Navigate to the Skill

cd ~/smfworks-skills/skills/daily-news-digest

Step 5 — Verify the Skill

python3 main.py --help

Expected output:

usage: main.py [-h] [--configure] [--api-key API_KEY] [--output {text,json}]

Daily News Digest - Get curated news delivered daily

optional arguments:
  -h, --help            show this help message and exit
  --configure, -c       Run configuration wizard
  --api-key API_KEY, -k API_KEY
                        NewsAPI key (overrides saved config)
  --output {text,json}, -o {text,json}
                        Output format (default: text)

Step 6 — Configure the Skill

Run the setup wizard:

python3 main.py --configure

You'll be guided through four steps:

Step 1: API Key
Enter your NewsAPI key: [paste your key here and press Enter]

Step 2: News Categories
Available: business, technology, science, health, sports, entertainment, general
Enter categories (comma-separated) [business,technology]: technology,science

Step 3: Country
Enter 2-letter country code (e.g., us, gb, ca, au)
Country [us]: us

Step 4: Articles per Category
Max articles per category [5]: 5

✅ Configuration saved to: /home/yourname/.config/smf/skills/daily-news-digest/config.json
Your Daily News Digest is ready!
Run: smf run daily-news-digest

Choose your categories wisely: Start with 2–3 categories at 5 articles each. More categories = more API requests. With the free plan's 100 requests/day limit, 3 categories × 5 articles = well within the free limit for multiple daily runs.


Verify Your Setup

Run the digest for the first time:

python3 main.py

Expected output:

📰 Daily News Digest — Friday, March 15, 2024
══════════════════════════════════════════════

💻 Technology
─────────────
1. Apple Announces New M3 Ultra Chip for Mac Pro
   Source: TechCrunch | techcrunch.com/...

2. OpenAI Releases GPT-5 with Improved Reasoning
   Source: The Verge | theverge.com/...
...

If you see headlines with sources, your setup is complete.


Configuration File Location

Your settings are saved at:

~/.config/smf/skills/daily-news-digest/config.json

You can view or edit it directly:

cat ~/.config/smf/skills/daily-news-digest/config.json

Sample content:

{
  "api_key": "YOUR_NEWSAPI_KEY_HERE",
  "categories": ["technology", "science"],
  "country": "us",
  "max_articles": 5
}

The file is saved with restricted permissions (readable only by you).


Alternative: Environment Variable

If you prefer not to save the key to a file:

export NEWSAPI_KEY="your-api-key-here"
python3 main.py

Add the export to your ~/.bashrc or ~/.zshrc to make it permanent.


Troubleshooting Setup Issues

Error: No API key configured.
You haven't run --configure yet, or the config file doesn't exist.
Fix: python3 main.py --configure

HTTP Error 401: Unauthorized
API key is wrong or not yet active.
Fix: Double-check your key at newsapi.org/account. New keys may take a minute to activate.

HTTP Error 429: Too Many Requests
You've used all 100 free requests today.
Fix: Wait until midnight UTC for the limit to reset.

No internet access
The skill requires internet to fetch news.
Fix: Check your connection: curl https://newsapi.org


Understanding the NewsAPI Free Plan

The free NewsAPI plan is designed for developers and personal projects:

FeatureFree PlanDeveloper Plan ($449/mo)
Requests/day100Unlimited
Article historyCurrent + 1 monthComplete archive
Full article text❌ No✅ Yes
Commercial use❌ No✅ Yes
SourcesAllAll

For personal daily briefings, the free plan is perfect. 100 requests/day allows 3–5 categories × 5 articles × multiple daily runs.


Available News Categories

When configuring, choose from these categories:

CategoryWhat it covers
businessBusiness news, market updates, company announcements
technologyTech industry, software, hardware, science
scienceResearch, space, biology, physics
healthMedical research, public health, healthcare
sportsGlobal and US sports, results, transfers
entertainmentMovies, music, celebrity, culture
generalBroad mix of top news across all categories

Recommendation for most users: Start with 2–3 categories. technology and general together give broad, quality coverage.


Available Country Codes

The country setting filters to news from that country. Common codes:

CountryCode
United Statesus
United Kingdomgb
Canadaca
Australiaau
Indiain
Germanyde
Francefr
Japanjp
Brazilbr
International mixUse general category without country filter

Security Note on API Key Storage

Your NewsAPI key is stored in ~/.config/smf/skills/daily-news-digest/config.json with chmod 600 (owner read/write only). This means:

  • The file is not readable by other users on the machine
  • It is NOT encrypted — anyone with root access can read it
  • It will be included in system backups (use Claw System Backup)

If your machine is shared or you have elevated security requirements, use the environment variable approach instead:

# Add to ~/.bashrc — only readable by you:
export NEWSAPI_KEY="your-key-here"

Next Steps

Setup is verified and working. See HOWTO.md for complete usage walkthroughs:

Note: If you ever need to reset your configuration (e.g., you have a new API key), simply run --configure again and it will overwrite the saved settings.

  • How to customize your categories
  • How to schedule a daily briefing with cron
  • How to get JSON output for scripting
  • Tips for getting the most from the free NewsAPI plan

How-To Guide

Daily News Digest — How-To Guide

Prerequisites: Setup complete (see SETUP.md). NewsAPI key configured.


Table of Contents

  1. How to Get Your Daily News Briefing
  2. How to Customize Your News Categories
  3. How to Get JSON Output for Scripts
  4. How to Save Your Digest to a File
  5. How to Change Your Country
  6. Automating with Cron
  7. Combining with Other Skills
  8. Troubleshooting Common Issues
  9. Tips & Best Practices

1. How to Get Your Daily News Briefing

What this does: Fetches today's top headlines for your configured categories and prints a formatted digest.

When to use it: Every morning as part of your daily routine.

Steps

Step 1 — Navigate to the skill directory.

cd ~/smfworks-skills/skills/daily-news-digest

Step 2 — Run the digest.

python3 main.py

Output:

📰 Daily News Digest — Friday, March 15, 2024
══════════════════════════════════════════════

💻 Technology
─────────────
1. Apple Announces New M3 Ultra Chip for Mac Pro
   Source: TechCrunch | techcrunch.com/2024/03/15/apple-m3-ultra

2. OpenAI Releases GPT-5 with Improved Reasoning
   Source: The Verge | theverge.com/2024/3/15/gpt5-release

3. Google DeepMind Achieves New Protein Folding Benchmark
   Source: Wired | wired.com/story/google-deepmind-alphafold

💼 Business
────────────
1. Fed Signals Rate Hold Through Mid-2024
   Source: Reuters | reuters.com/...

2. Amazon Reports Record Q4 Cloud Earnings
   Source: Bloomberg | bloomberg.com/...

Configure: smf run daily-news-digest --configure

Step 3 — Click through to read articles you're interested in.

The skill shows headlines and URLs. Open the URLs in your browser for the full story.

Result: A clean, focused news briefing in under 30 seconds.


2. How to Customize Your News Categories

What this does: Re-runs the configuration wizard to update which categories you follow.

When to use it: Your interests have changed, or you want to add/remove categories.

Steps

Step 1 — Run the configuration wizard.

python3 main.py --configure

Step 2 — At the categories prompt, enter your desired categories.

Available categories: business, technology, science, health, sports, entertainment, general

Enter categories (comma-separated) [technology,science]: technology,health,science

Step 3 — Confirm the rest of the settings (press Enter to keep defaults).

Step 4 — Run the digest to verify.

python3 main.py

You should now see sections for Technology, Health, and Science.

Result: Your digest now covers exactly the categories you care about.


3. How to Get JSON Output for Scripts

What this does: Returns the digest as a JSON object instead of formatted text — useful for piping to other scripts or tools.

When to use it: You want to process the headlines programmatically or pipe them to another tool.

Steps

Step 1 — Run with --output json.

python3 main.py --output json

Output:

{
  "success": true,
  "timestamp": "2024-03-15T09:00:12.345678",
  "content": "📰 Daily News Digest...",
  "categories": [
    "technology",
    "business"
  ]
}

Step 2 — Extract just the content field.

python3 main.py --output json | python3 -c "import json,sys; print(json.load(sys.stdin)['content'])"

Result: JSON output ready for scripting, piping, or storage.


4. How to Save Your Digest to a File

What this does: Saves the daily digest as a text file you can read later or archive.

When to use it: You want to keep a record of daily news, or read the digest on a device that doesn't have internet.

Steps

Step 1 — Save to a date-stamped file.

python3 main.py > ~/News/digest-$(date +%Y-%m-%d).txt

Step 2 — Read it later.

cat ~/News/digest-2024-03-15.txt

Step 3 — Archive a week of digests.

ls ~/News/
digest-2024-03-11.txt
digest-2024-03-12.txt
digest-2024-03-13.txt
digest-2024-03-14.txt
digest-2024-03-15.txt

Result: A complete daily archive of your news briefings.


5. How to Change Your Country

What this does: Sets which country's news you want headlines from.

When to use it: You're in a different country, or you want news from a specific market.

Steps

Step 1 — Run the configure wizard.

python3 main.py --configure

Step 2 — At the country prompt, enter your country code.

CountryCode
United Statesus
United Kingdomgb
Canadaca
Australiaau
Indiain
Germanyde
Francefr
Japanjp
Brazilbr
Country [us]: gb

Step 3 — Run the digest to verify.

Headlines will now be from UK sources.

Result: Country-appropriate headlines from your region.


6. Automating with Cron

Schedule the digest to run every morning and save to a file — your news briefing is ready when you open your terminal.

Open the cron editor

crontab -e

Example: Run the digest every morning at 7 AM and save to a file

0 7 * * * cd /home/yourname/smfworks-skills/skills/daily-news-digest && python3 main.py > /home/yourname/News/digest-$(date +\%Y-\%m-\%d).txt 2>&1

Example: Append digest to a weekly summary file

0 7 * * * cd /home/yourname/smfworks-skills/skills/daily-news-digest && python3 main.py >> /home/yourname/News/weekly-$(date +\%Y-W\%V).txt 2>&1

Create the news directory first

mkdir -p ~/News

Check the output

cat ~/News/digest-$(date +%Y-%m-%d).txt

Cron Expression Reference

ExpressionMeaning
0 7 * * *Every day at 7 AM
0 6 * * 1-5Weekdays at 6 AM
30 7 * * *Every day at 7:30 AM

7. Combining with Other Skills

Daily News Digest + Markdown Converter: Save digest as markdown and convert to HTML:

python3 ~/smfworks-skills/skills/daily-news-digest/main.py > ~/News/today.txt
# Add Markdown formatting manually or via script, then:
python3 ~/smfworks-skills/skills/markdown-converter/main.py to-html ~/News/today.md

Daily News Digest + File Organizer: Save digests and organize by date:

python3 ~/smfworks-skills/skills/daily-news-digest/main.py > ~/News/digest.txt
python3 ~/smfworks-skills/skills/file-organizer/main.py organize-date ~/News/

8. Troubleshooting Common Issues

Error: No API key configured.

No API key is saved or in environment.
Fix: Run python3 main.py --configure and enter your key. Or: export NEWSAPI_KEY=yourkey


HTTP Error 401: Unauthorized

Your API key is invalid or not yet active.
Fix: Verify your key at newsapi.org/account. New accounts take a minute to activate.


HTTP Error 429: Too Many Requests

Exceeded 100 daily requests on the free plan.
Fix: The limit resets at midnight UTC. Reduce your max_articles setting and avoid running more than twice per day on the free plan.


No articles returned

Some categories have limited coverage for certain countries.
Fix: Try us as the country. Switch to technology, business, or general which have the most global coverage.


Digest shows old news

NewsAPI updates top headlines periodically — results are cached for ~15 minutes.
Fix: This is normal. Run again in 15 minutes for fresh results.


9. Tips & Best Practices

Limit to 2–3 categories on the free plan. Each category is a separate API request. With 100 requests/day, you have room for multiple daily runs with 2–3 categories each.

Run it in the morning, not at night. Top headlines are most relevant within 6–12 hours of publication. Running in the evening gives you yesterday's news wrapped in today's date.

Save your digest to a file. Use python3 main.py > ~/News/digest-$(date +%Y-%m-%d).txt so you can refer back to it even when you're offline later.

Use --api-key for testing without touching config. If you want to test a new key: python3 main.py --api-key your-new-key --output json — it won't overwrite your saved config.

general category gives the broadest coverage. If you want a quick overview of "what's happening," general is the best single category. It pulls from the widest range of sources.

Consider different countries for different perspectives. Try running once with us and once with gb to compare how the same stories are covered differently by US and UK press.