Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 18 lines (16 sloc) 642 Bytes
#!/usr/local/bin/node
(function() {
var BASE_URL, args, jsdom, zip;
jsdom = require('jsdom');
BASE_URL = "http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=";
args = process.argv;
zip = args[2] ? args[2] : "11231";
jsdom.env(BASE_URL + zip, ['http://code.jquery.com/jquery-1.5.min.js'], function(errors, window) {
var $, high, low;
$ = window.jQuery;
high = $('.fctHiLow .b').html();
low = $('.fctHiLow').first().html().split('|')[1].split('°')[0].trim();
console.log("Today's high in " + zip + ": " + high);
return console.log("Today's low in " + zip + ": " + low);
});
}).call(this);