Article Tweet Generator
Generate a tweet about an article and publish it on X.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
TextInput-st0k1[<div><img src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Query]
style TextInput-st0k1 stroke:#a170ff
Prompt-2zkyi[<div><img 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 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 src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data2]
style ParseData-11ts5 stroke:#a170ff
OpenAIModel-7fyyb[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-7fyyb stroke:#a170ff
OpenAIModel-1p9j6[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-1p9j6 stroke:#a170ff
ParseData-mo9ts[<div><img 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
Article Tweet Generator
đź§© Overview
The workflow transforms a user’s query about recent AI news into a concise, tweet‑ready statement. It automatically searches the web, selects a relevant article, extracts its content, generates a tweet that summarizes the key points, and posts it on X. The process is fully automated, reducing manual curation and publishing time.
⚙️ Main Features
- Accepts natural‑language queries about AI news.
- Retrieves recent articles through a web search.
- Randomly selects one article URL using a language model.
- Scrapes the full article content.
- Generates an informative, character‑limited tweet.
- Publishes the tweet on X with a single automated step.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Query | Receives the user’s request for AI news. | User‑provided text. | Search query string. |
| Web Search | Conducts a web search using the query. | Search query string. | Data containing search result URLs. |
| Parse Data (Extract URLs) | Converts search results into a list of article URLs. | Search result data. | List of URLs. |
| Prompt (Select Random Article) | Asks the model to choose a single article URL. | List of article URLs. | Prompt string for the language model. |
| OpenAI Model (Generate URL) | Executes the model to output the selected URL. | Prompt string. | Selected article URL. |
| Web Scraper | Scrapes the article at the given URL. | Article URL. | Raw article content in Markdown. |
| Parse Data (Process Article) | Transforms scraped Markdown into plain text. | Raw article content. | Article content text. |
| Prompt (Generate Tweet) | Constructs a prompt for creating a tweet from the article. | Article content text, Article URL. | Prompt string for the language model. |
| OpenAI Model (Generate Tweet Text) | Generates the final tweet text. | Prompt string. | Tweet text (≤ 100 characters). |
| X Poster | Publishes the tweet to X. | Tweet text. | Confirmation of posted tweet. |
đź§ Notes
- API Credentials: The workflow requires valid API keys for both OpenAI and the X API.
- Model Selection: Two language‑model calls are made—one for URL selection and one for tweet generation.
- Randomness: The URL selection is performed by the LLM, which may produce different results on each run; consider adding a deterministic seed if reproducibility is needed.
- Scraping Constraints: The web scraper’s timeout can be adjusted; large pages may exceed the default limit.
- Tweet Length: The prompt explicitly restricts the output to 100 characters to comply with X’s character limit.
- Safety: The system does not validate the content of the selected article before posting; additional filtering or moderation may be added if necessary.