#!/usr/bin/perl ####################################################################### # As filter: subscribe http://slashdot.org/pollBooth.pl and let it # filter through this script. # Execurl: Run script as "slashdotpoll -external". This will use # curl to download the web page. # # Public domain. No copyright is claimed. # Original author Oliver Feiler $baseurl = "http://slashdot.org"; $pollurl = "/pollBooth.pl?qid="; $mode = 1; if ($ARGV[0] eq "-external") { $mode = 2; } if ($mode == 1) { @content = <>; } else { @content = `curl -s -m 20 http://slashdot.org/pollBooth.pl`; } print ''. ''. 'Slashdot Polls'. 'http://slashdot.org/pollBooth.pl'. 'Slashdot Poll RSS feed'; foreach(@content) { if (/pollBooth.pl\?qid=\d+"/) { /pollBooth.pl\?qid=(.*?)">(.*?)/>/g; $headline =~ s/\"/"/g; $headline =~ s/\'/'/g; print "$baseurl$pollurl$headline$2"; } } print "\n";