Skip to content

Instantly share code, notes, and snippets.

@jorgemanrubia
jorgemanrubia / sync_hey_world_posts_with_jekyll.rb
Created January 25, 2023 08:39
Script I use to sync my HEY World posts with my Jekyll-powered personal site
require "rss"
require "ostruct"
RSS_FEED_URL = "https://world.hey.com/jorge/feed.atom"
def sync_posts
feed = RSS::Parser.parse(RSS_FEED_URL, false)
feed.items.each do |item|
post = OpenStruct.new title: item.title.content, date: item.published.content.strftime("%Y-%m-%d"), link: item.link.href