Write a little script that pulls
http://news.ycombinator.com/threads?id=<username>; and does some magic to pull out the info into an RSS feed
(yes, ideally pg can add this as a real feature, but I'm being pragmatic here ;-)).Just a messy Ruby-based example I threw together. Works for me.
require 'rubygems'
require 'open-uri'
require 'hpricot'
username = 'petercooper'
uri = 'http://news.ycombinator.com/threads?id=' + username
doc = Hpricot(open(uri))
puts %{<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>Hacker News responses to #{username}</title>
<link>#{uri}</link>}
(doc/'td td table').each do |post|
content = post.inner_html
next if content =~ />#{username}</ # skip if we posted it
next unless post.inner_html =~ /vote/ # skip if it's not a post
id = content[/\_(\d+)/,1]
comment_text = (post/'.comment').first.inner_text
commenter = content[/user\?id=(\w+)/,1]
puts %{ <item>\n <title>Comment from #{commenter}</title>}
puts %{ <link>http://news.ycombinator.com/item?id=#{id}</link>}
puts %{ <description>#{comment_text}</description>\n </item>}
end
puts %{</channel></rss>}
It'd be better, but the HTML on Hacker News is from 1996. I was too sloppy to bother fetching the title of the current thread ;-)
With just adding a shebang line and a content-type header line, it works no problems on Dreamhost as a CGI script. Example: http://bigbold.dreamhosters.com/hnc.cgi
Anyway, thanks for giving me the idea. I'm using that now myself.. lol.