Liferea/Snownews extension for pro-linux
Liferea/Snownews-extension to get a full-content feed for the german linux-news-website pro-linux:
#!/usr/bin/ruby
require 'net/http'
require 'rexml/document'
require 'iconv'
def get_item url
item = Net::HTTP.get_response(URI.parse(url)).body
'<font size="+1"><b>' + item.scan(/<font size="\+1"><b>(.*)$/)[1][0]
end
feed = REXML::Document.new($stdin.readlines.join)
feed.elements.each('rss/channel/item') do |element|
element.elements['description'].text = Iconv.new('UTF-8', 'ISO-8859-1').iconv(get_item(element.elements['link'].text))
end
feed.write($stdout, 0)