Quick overview
This workflow runs daily at 17:30 (JST) to pull travel-related headlines from Google News RSS, filters and scores recent articles, generates consumer-friendly X (Twitter) post text with OpenAI, posts the top items to X, and logs posted articles in Google Sheets.
How it works
- Runs every day at 17:30 (Asia/Tokyo) on a schedule.
- Reads the existing “already posted” list (guid/title/postedAt) from Google Sheets.
- Fetches travel-related items from a Google News RSS search feed.
- Keeps only articles from the last 12 hours, excludes overly business/IR-style headlines, and scores items based on travel-friendly keywords like deals, disruptions, and crowding.
- Removes duplicates by comparing each item’s GUID/link and normalized title against the Google Sheets history, then selects the top two scored articles.
- Uses OpenAI (gpt-4o-mini) to write a 1–2 sentence Japanese X-ready comment (within 150 characters) based on the title and snippet.
- Builds the final post text with the article link, a blog link, and auto-generated hashtags, posts it to X (Twitter), and appends the posted GUID/title/timestamp back to Google Sheets.
Setup
- Connect Google Sheets OAuth2 credentials and update the spreadsheet/document ID and sheet tab (gid) used to store posted items (columns: guid, title, postedAt).
- Add an OpenAI API credential and ensure the workflow can access the gpt-4o-mini model.
- Connect your X (Twitter) OAuth2 credentials for posting.
- Replace the BLOG_URL constant in the post-building code with your own website/blog URL and adjust keywords/hashtag location lists if needed.