Article Tweet Generator
Generate a tweet about an article and post it on X.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
TextInput-st0k1[<div><img alt="logo" src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Query]
style TextInput-st0k1 stroke:#a170ff
Prompt-2zkyi[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt]
style Prompt-2zkyi stroke:#a170ff
SearXng-q92z6[Web Search SearXng]
style SearXng-q92z6 stroke:#a170ff
WebScraper-wulwf[Web Scraper]
style WebScraper-wulwf stroke:#a170ff
Prompt-ctj5v[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt]
style Prompt-ctj5v stroke:#a170ff
ParseData-11ts5[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data2]
style ParseData-11ts5 stroke:#a170ff
OpenAIModel-7fyyb[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-7fyyb stroke:#a170ff
OpenAIModel-1p9j6[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-1p9j6 stroke:#a170ff
ParseData-mo9ts[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data]
style ParseData-mo9ts stroke:#a170ff
XPoster-usgch[X Poster]
style XPoster-usgch stroke:#a170ff
TextInput-st0k1 -.- SearXng-q92z6
linkStyle 0 stroke:#a170ff
SearXng-q92z6 -.- ParseData-11ts5
linkStyle 1 stroke:#a170ff
ParseData-11ts5 -.- Prompt-ctj5v
linkStyle 2 stroke:#a170ff
Prompt-ctj5v -.- OpenAIModel-7fyyb
linkStyle 3 stroke:#a170ff
OpenAIModel-7fyyb -.- WebScraper-wulwf
linkStyle 4 stroke:#a170ff
Prompt-2zkyi -.- OpenAIModel-1p9j6
linkStyle 5 stroke:#a170ff
WebScraper-wulwf -.- ParseData-mo9ts
linkStyle 6 stroke:#a170ff
OpenAIModel-7fyyb -.- Prompt-2zkyi
linkStyle 7 stroke:#a170ff
ParseData-mo9ts -.- Prompt-2zkyi
linkStyle 8 stroke:#a170ff
OpenAIModel-1p9j6 -.- XPoster-usgch
linkStyle 9 stroke:#a170ff
🧩 Overview
The Article Tweet Generator workflow takes a user‑supplied query, retrieves a relevant news article, summarizes its key points, and automatically posts a concise, tweet‑ready message to X.
It streamlines the entire pipeline—from searching the web, scraping content, to generating and publishing a tweet—into a single, repeatable process.
⚙️ Main Features
- Accepts a natural‑language query and performs a web search.
- Randomly selects one URL from the search results.
- Scrapes the selected page and converts the content to Markdown.
- Generates a short, informative tweet that references the article.
- Posts the tweet to X (optionally as a reply).
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Text Input | Receives the user query. | Query text | Text message |
| Web Search | Executes a search against the SearXNG instance. | Query text | Data – list of URLs |
| Parse Data (URLs) | Extracts a plain‑text list of URLs from the search result data. | Data – URLs list | Text – URLs string |
| Prompt: Select Article URL | Builds a prompt that asks the model to pick one URL. | Articles text | Prompt message |
| OpenAI Model (URL picker) | Generates a single URL to scrape. | Prompt message | Text – selected URL |
| Web Scraper | Scrapes the article page into Markdown. | URL | Data – scraped Markdown |
| Parse Data (Article) | Formats the scraped data into plain text. | Data – Markdown | Text – article content |
| Prompt: Create Tweet | Builds a prompt that requests a tweet based on the article. | Web content, Article URL | Prompt message |
| OpenAI Model (Tweet generator) | Generates the final tweet text. | Prompt message | Text – tweet |
| X Poster | Publishes the tweet to X. | Tweet text | Tweet data (confirmation) |
The table follows the sequence implied by the edge connections in the JSON representation.
🧠 Notes
- Credentials: The workflow requires valid OpenAI API credentials for the two language‑model calls and X‑API credentials for posting.
- SearXNG: The web‑search component depends on a running SearXNG instance; ensure its URL is correctly configured.
- Rate limits: Each call to OpenAI and the X API is subject to provider‑specific rate limits.
- Tweet length: The second prompt enforces a character limit (≈100 characters) to fit within a single X tweet.
- Error handling: If a search returns no URLs or the scraper fails, the workflow will halt unless a fallback path is added.
- Reproducibility: Setting a fixed
seedin the OpenAI components ensures consistent outputs across runs. - Extensibility: The label components describe three logical phases; they can be used for visual annotation or for branching logic in more complex flows.