Build an Autonomous News Digest & Web Scraper Bot with AI
Staying updated with industry developments, market trends, or technical releases means monitoring dozens of blogs, news outlets, and feeds every day. Manual browsing eats hours and often ends in information overload.
In this tutorial, we will build an Autonomous AI News Digest Bot using Python, BeautifulSoup, httpx, and Velona's AI Gateway. The bot collects headlines from a news source, summarises them into a clean Markdown executive digest, and can run every morning on a schedule. On a low-cost model, a daily digest costs less than ₹1 a month.
Architecture of an Autonomous Summarization Pipeline
The pipeline runs on a schedule (for example daily at 8:00 AM IST):
- Scraping and Extraction: Python fetches HTML from a news site or RSS feed with
httpxand parses headlines withBeautifulSoup. - Filtering and Deduplication: Normalise text and drop duplicate stories before processing.
- AI Synthesis: Send the extracted text to Velona's native endpoint (
/gateway/v1/inference/run) using a fast, low-cost model. - Digest Formatting: Produce Markdown with key takeaways, impact notes, and source links.
Step 1: Set Up Your Velona Account and API Key
- Register on the Velona Sign-Up Page.
- Go to your Prepaid Wallet Dashboard and top up starting at ₹10 using UPI (GPay, PhonePe) or RuPay. Usage is billed in rupees at the rates on the pricing page.
- Open API Key Management and create an API key named
news-scraper-bot. - Set a budget on the key so a runaway loop can never drain your wallet.
Step 2: Install Python Dependencies
pip install httpx beautifulsoup4
Step 3: Build the Scraper and Summarizer
Create a script named news_digest_bot.py:
import os
import httpx
from bs4 import BeautifulSoup
VELONA_API_KEY = os.environ["VELONA_API_KEY"]
VELONA_URL = "https://velona.in/gateway/v1/inference/run"
MODEL = "deepseek/deepseek-v4-flash"
HEADERS = {
"Authorization": f"Bearer {VELONA_API_KEY}",
"Content-Type": "application/json",
}
# 1. Collect headlines
def fetch_latest_tech_headlines(limit: int = 15) -> str:
response = httpx.get(
"https://news.ycombinator.com",
headers={"User-Agent": "news-digest-bot/1.0"},
timeout=20,
)
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
seen, articles = set(), []
for title_tag in soup.find_all("span", class_="titleline"):
link = title_tag.find("a")
if not link or link.text.lower() in seen:
continue
seen.add(link.text.lower())
articles.append(f"{len(articles) + 1}. {link.text} ({link['href']})")
if len(articles) == limit:
break
return "\n".join(articles)
# 2. Summarise with Velona
def generate_ai_digest(raw_headlines: str) -> str:
system_prompt = """You are an executive intelligence analyst for a tech company.
Review the headlines and write a Daily Executive Digest in Markdown with:
1. **Top 3 Trends**: a short synthesis of the major movements.
2. **Key Takeaways**: one-sentence bullets for the most important stories, with links.
3. **Impact**: a brief note on what matters for an Indian tech team.
Keep it concise and skimmable."""
payload = {
"model": MODEL,
"turns": [
{"role": "system", "content": system_prompt},
{"role": "user", "content": f"Headlines:\n{raw_headlines}"},
],
}
res = httpx.post(VELONA_URL, json=payload, headers=HEADERS, timeout=60)
res.raise_for_status()
# The native endpoint returns the reply text in data.output
return res.json()["data"]["output"]
if __name__ == "__main__":
headlines = fetch_latest_tech_headlines()
print(f"Collected {len(headlines.splitlines())} stories.\n")
digest = generate_ai_digest(headlines)
print("================ DAILY EXECUTIVE DIGEST ================\n")
print(digest)
Hacker News also offers an official JSON API, which is more robust than HTML parsing for production use. For other sites, check their terms and robots.txt, and prefer RSS feeds where available.
Step 4: Schedule It
On a Linux server, run it every day at 8:00 AM IST (02:30 UTC) with cron, and send the output to a file, email, or Slack webhook:
30 2 * * * VELONA_API_KEY=your_key /usr/bin/python3 /home/you/news_digest_bot.py >> /home/you/digest.md
Need help reading cron syntax? Use the free cron expression explainer.
Model Selection and Cost in Rupees
Fifteen headlines plus the instructions are about 450 input tokens, and the digest is about 500 output tokens. At the time of writing:
| Model ID | Per digest | Per month (daily) | Best for |
|---|---|---|---|
deepseek/deepseek-v4-flash | ₹0.004 | about ₹0.13 | Daily headline digests |
openai/gpt-4o-mini | ₹0.04 | about ₹1.15 | Polished, consistent formatting |
google/gemini-2.5-flash | ₹0.14 | about ₹4.30 | Summarising full article text with its 1M context |
anthropic/claude-sonnet-5 | about ₹5.70 per weekly report | about ₹23 | Weekly deep-dive on 20,000 tokens of full articles |
A ₹10 top-up runs the daily DeepSeek digest for years. Every run's exact cost appears on your usage dashboard.
Developer Utilities
When cleaning scraped HTML or formatting the Markdown newsletter, use Velona's free developer tools such as the Markdown Editor, HTML Entities Converter, and Regex Evaluator. They run in your browser and never touch your wallet.
To compare digest quality across models before scheduling, run the same headlines through the Model Evaluator.
Conclusion
An autonomous news digest bot cuts through online noise and delivers high-signal updates to your team every morning. With Velona, Indian developers and startups can automate daily AI workflows for a few rupees a month, paid with UPI.
Ready to automate your news digest? Create a free Velona account, add ₹10, and schedule your first run today.