#!/usr/bin/env ruby require "httparty" require "nokogiri" require "open-uri" feed = Nokogiri::XML( URI.open("https://davideisinger.com/index.xml") ) post = feed.search("rss channel item").first title = post.search("title").text url = post.search("link").text body = post.search("description").text body = %(

#{title}

By David Eisinger · View original post

#{body}) # escape curly braces (they're important in listmonk) body = body .gsub("{", "{") .gsub("}", "}") # half-size images body = body .gsub(/width="(\d+)"/) { %(width="#{$1.to_i/2}") } .gsub(/height="(\d+)"/) { %(height="#{$1.to_i/2}") } # replace audio tags with links body = body.gsub(/