Created
June 17, 2010 14:43
-
-
Save chadj/442211 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Script output when run : | |
Success: http://feeds.feedburner.com/IrrationalBehavior | |
Success: http://feeds.feedburner.com/dancarlin/history?format=xml | |
Success: http://feeds.feedburner.com/diggnation | |
Success: http://feeds.feedburner.com/javaposse | |
Success: http://feeds.feedburner.com/TheHistoryOfRome | |
Success: http://feeds.feedburner.com/YouLookNiceToday | |
Success: http://feeds.feedburner.com/idle-thumbs | |
Success: http://feeds.feedburner.com/ShotOfJaq | |
Success: http://feeds.gdgt.com/gdgt/podcast-mp3/ | |
Success: http://feeds.feedburner.com/TheHistoryNetwork/AncientWarfareMagazine | |
Error: http://leo.am/podcasts/twit 301 | |
Error: http://leo.am/podcasts/twig/ 302 | |
Error: http://leo.am/podcasts/mbw 301 | |
Success: http://feeds.penny-arcade.com/padlc | |
Success: http://hackermedley.org/feed/podcast/ | |
Success: http://mexicutedbyhepitacos.libsyn.com/rss | |
events:11 | |
throw arguments[1]; | |
^ | |
Error: Parse Error | |
at Client.ondata (http:861:22) | |
at IOWatcher.callback (net:502:31) | |
at node.js:221:9 | |
*/ | |
var sys = require('sys'), | |
url = require('url'), | |
http = require('http'); | |
var urls = ["http://feeds.feedburner.com/IrrationalBehavior", | |
"http://feeds.feedburner.com/ShotOfJaq", | |
"http://feeds.feedburner.com/TheHistoryNetwork/AncientWarfareMagazine", | |
"http://feeds.feedburner.com/TheHistoryOfRome", | |
"http://feeds.feedburner.com/YouLookNiceToday", | |
"http://feeds.feedburner.com/dancarlin/history?format=xml", | |
"http://feeds.feedburner.com/diggnation", | |
"http://feeds.feedburner.com/idle-thumbs", | |
"http://feeds.feedburner.com/javaposse", | |
"http://feeds.gdgt.com/gdgt/podcast-mp3/", | |
"http://feeds.penny-arcade.com/padlc", | |
"http://hackermedley.org/feed/podcast/", | |
"http://leo.am/podcasts/mbw", | |
"http://leo.am/podcasts/twig/", | |
"http://leo.am/podcasts/twit", | |
"http://mbmbam.libsyn.com/rss", | |
"http://mexicutedbyhepitacos.libsyn.com/rss", | |
"http://noagenda.podshow.com/feed", | |
"http://podcast.timesonline.co.uk/rss/thebuglemp3.rss", | |
"http://www.engadget.com/tag/@podcasthub/rss.xml", | |
"http://www.gamerswithjobs.com/taxonomy/term/408/0/feed", | |
"http://www.giantbomb.com/podcast-xml/", | |
"http://www.howstuffworks.com/podcasts/stuff-you-missed-in-history-class.rss", | |
"http://www.joystiq.com/category/podcasts/rss.xml", | |
"http://www.normancenturies.com/rss.xml", | |
"http://www.shacknews.com/extras/podcast/weekendconfirmed.xml"]; | |
urls.forEach(function(url_s) { | |
var rss_url = url.parse(url_s); | |
var port = rss_url.port ? rss_url.port : 80; | |
var pathname = rss_url.pathname ? rss_url.pathname : "/"; | |
if(!rss_url.hostname || rss_url.hostname == "") { | |
return; | |
} | |
var c = http.createClient(port, rss_url.hostname); | |
var request = c.request('GET', pathname, {'host': rss_url.hostname}); | |
request.addListener('response', function (response) { | |
if(response.statusCode == 200) { | |
sys.puts("Success: "+url_s); | |
response.setEncoding('utf8'); | |
response.addListener('data', function (chunk) { | |
}); | |
} else { | |
sys.puts("Error: "+url_s+" "+response.statusCode); | |
} | |
}); | |
request.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment