Generador de Tweets de artículos
Genera un tweet sobre un artículo y lo publica en 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
This workflow automates the creation and publication of a tweet based on a recent online article. It begins by performing a web search on a user-defined topic, selects a random article from the results, scrapes its full content, and then uses an AI model to generate a concise, informative tweet summarizing the article. Finally, the generated tweet is automatically posted to the X (formerly Twitter) platform.
⚙️ Main Features
- Automatically searches the web for recent articles based on a custom query.
- Randomly selects a single article URL from the search results for processing.
- Scrapes the full textual content from the chosen article's webpage.
- Generates a tweet that summarizes the article's key points, includes a reflection, and cites the source.
- Publishes the final tweet directly to a connected X (Twitter) account.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Query | Defines the topic for the article search. | User-defined search query (e.g., "Recent AI news") | Search query text |
| Web Search (SearXng) | Performs a web search to find recent articles related to the query. | Search query | Raw search results data containing article links |
| Parse Data | Formats the raw search results into a structured list of article URLs. | Raw search results data | Formatted list of article URLs |
| Prompt | Creates an instruction for the AI to select one random URL from the provided list. | Formatted list of article URLs | Instruction prompt for random URL selection |
| OpenAI Model | Executes the instruction to choose a single, random article URL. | Instruction prompt for random URL selection | Selected article URL |
| Web Scraper | Fetches and extracts the full textual content from the selected article's webpage. | Selected article URL | Raw scraped article content |
| Parse Data | Converts the raw scraped data into clean, readable text. | Raw scraped article content | Clean article text content |
| Prompt | Constructs a detailed instruction for generating a tweet based on the article's content and URL. | Clean article text content, Article URL | Instruction prompt for tweet generation |
| OpenAI Model | Generates a concise, informative tweet that summarizes the article and includes the source link. | Instruction prompt for tweet generation | Final tweet text |
| X Poster | Publishes the generated tweet to the connected X (Twitter) account. | Final tweet text | Confirmation of tweet publication |
🧠 Notes
- The workflow requires valid API credentials for both the OpenAI model and the X (Twitter) platform to function.
- The quality and structure of the scraped article content can vary depending on the source website.
- The generated tweet is designed to be informative and adhere to standard character limits for the platform.
- The initial web search returns a configurable number of results (default is 30), from which one is randomly selected.