Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created January 13, 2025 23:47
Show Gist options
  • Save oxagast/67832de7eb5b1076e5f98bb0c21fd54e to your computer and use it in GitHub Desktop.
Save oxagast/67832de7eb5b1076e5f98bb0c21fd54e to your computer and use it in GitHub Desktop.
Generates an RSS feed of newly added exploits
#!/usr/bin/ruby
require "rss"
urlbase = "https://oxasploits.com"
rss = RSS::Maker.make("atom") do |maker|
maker.channel.author = "oxagast"
maker.channel.updated = Time.now.to_s
maker.channel.about = urlbase + "/exploits/"
maker.channel.title = "The Oxasploits Exploit Feed"
Dir.glob('sploits/*.md') do |md_filename|
maker.items.new_item do |item|
File.open(md_filename, "r") do |file|
file.each_line do |line|
if line.match(/permalink: /)
linkm = line.match(/permalink: (.*)/)
item.link = urlbase + linkm[1]
end
if line.match(/description: /)
titlem = line.match(/description: "(.*)"/)
item.title = titlem[1]
end
item.updated = file.mtime
#puts file.mtime
end
end
end
end
end
puts rss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment