Skip to content

RSS Social Poster

Intermediate
ai rss social-media twitter linkedin automation scheduling

Monitor any RSS/Atom feed, generate platform-optimised posts for Twitter/X and LinkedIn with AI, and publish them automatically every time a new article drops.

RSS Social Poster is an automation that polls any RSS or Atom feed on a 3-minute schedule, uses OpenAI to craft platform-specific posts for each new article, and publishes them to Twitter/X and LinkedIn without any manual intervention.

What it does

  • RSS monitoring : Polls any RSS/Atom feed URL every 3 minutes for new items via fetch-rss; normalises each article into a standard format
  • AI content generation : Passes each article to OpenAI to produce a concise tweet and a longer professional LinkedIn post via generate-social-posts
  • Multi-platform publishing : Posts the tweet to Twitter/X and the LinkedIn post to your organisation page sequentially via post-to-social

Environment variables (.env / keyring on apps)

VariablePurpose
HABITS_OPENAI_API_KEYOpenAI API key for social post generation
HABITS_TWITTER_CLIENT_IDTwitter/X OAuth 2.0 Client ID
HABITS_LINKEDIN_CLIENT_IDLinkedIn OAuth 2.0 Client ID
HABITS_LINKEDIN_CLIENT_SECRETLinkedIn OAuth 2.0 Client Secret
HABITS_LINKEDIN_ORG_IDLinkedIn Organization ID for page posts
HABITS_RSS_FEED_URLRSS/Atom feed URL to monitor

How to set up

  1. Copy .env.example to .env and fill in your credentials.
  2. Create a Twitter Developer App with Read and Write permissions and add http://localhost:13000/oauth/bit-twitter/callback as the callback URL; copy the Client ID.
  3. Create a LinkedIn Developer App linked to your Company Page; copy the Client ID, Client Secret, and Organization ID.
  4. Set any RSS/Atom feed URL in HABITS_RSS_FEED_URL.
  5. Start the server : fetch-rss will automatically poll the feed every 3 minutes and publish new articles to both platforms.

Tech stack

  • habits framework for workflow orchestration and cron scheduling
  • OpenAI (@ha-bits/bit-openai) for platform-tailored social content generation
  • RSS (@ha-bits/bit-rss) for feed polling and new-item detection
  • Twitter/X (@ha-bits/bit-twitter) for tweet publishing via OAuth 2.0
  • LinkedIn (@ha-bits/bit-linkedin) for LinkedIn post publishing via OAuth 2.0

Run Your .habit File

Run on Mobile

  • [ ] Download the Cortex App from store or the downloads page
  • [ ] Open the Cortex App on your device
  • [ ] Tap "Open Habit" or "+" button
  • [ ] Select your .habit file from your device storage
  • [ ] The habit will be loaded and ready to run

Run on Desktop

  • [ ] Download the Cortex App for your platform from the downloads page
  • [ ] Install and open the Cortex App
  • [ ] Click "Open Habit" or drag & drop your .habit file
  • [ ] The habit will be loaded and ready to run
  • [ ] Optional: Place a .env file in the same directory as your .habit file to override environment variables

Run on Server

Run your .habit file as a server using the Cortex CLI:

bash
# Install and run in one command
npx @ha-bits/cortex --config ./your-app.habit
  • [ ] Make sure Node.js 20+ is installed
  • [ ] Run the command above with your .habit file path
  • [ ] Server will start on the specified port (default: 3000)
  • [ ] Access the app at http://localhost:3000
  • [ ] Optional: Place a .env file next to your .habit file - it will automatically override any embedded environment variables

Run Serverless

For serverless or containerized deployments, we recommend using Docker:

bash
# Using Docker (recommended for serverless)
docker run -p 3000:3000 -v $(pwd)/your-app.habit:/app/habit.habit \
  node:20-alpine npx @ha-bits/cortex --config /app/habit.habit --host 0.0.0.0

Or create a Dockerfile:

dockerfile
FROM node:20-alpine
WORKDIR /app
COPY your-app.habit ./
COPY .env ./ # Optional: include environment variables
RUN npm install -g @ha-bits/cortex
EXPOSE 3000
CMD ["cortex", "--config", "./your-app.habit", "--host", "0.0.0.0"]
  • [ ] Create a Dockerfile or use the Docker run command above
  • [ ] Deploy to your preferred cloud provider (AWS, GCP, Azure, etc.)
  • [ ] Configure environment variables via your cloud provider's secrets management
  • [ ] Set up health checks at /habits/base/api endpoint

Workflow Visualization

Requirements

  • OPENAI_API_KEY (OpenAI API key)
  • TWITTER_CLIENT_ID (Twitter/X OAuth 2.0 Client ID)
  • LINKEDIN_CLIENT_ID (LinkedIn OAuth 2.0 Client ID)
  • LINKEDIN_CLIENT_SECRET (LinkedIn OAuth 2.0 Client Secret)
  • LINKEDIN_ORG_ID (LinkedIn Organization ID for page posts)
  • RSS_FEED_URL (RSS/Atom feed URL to monitor)

Quick Start

Run using the Habits CLI wrapper, recommended if you develop local Habits

# First, download the example files
npx habits@latest cortex --config ./rss-social-poster/stack.yaml

Get in touch

Want this habit running in your environment?

This habit is a starting point. Tell us about your stack and we'll help you get it working exactly the way your team needs.

Released under the AGPL-3.0 License.