Permalink
Browse files

Small tweaks

* Recompile binary
* Cleans up console.logs
* Fixes spacing in package.json
  • Loading branch information...
1 parent b354d4a commit 330daf6746ee9e6cee9855518a5c3aaa1e3db783 @bryanwoods committed Sep 18, 2011
Showing with 24 additions and 19 deletions.
  1. +8 −4 bin/degrees
  2. +2 −1 lib/degrees.coffee
  3. +14 −14 package.json
View
@@ -1,13 +1,17 @@
#!/usr/local/bin/node
+
(function() {
- var WUNDERGROUND_URL, jsdom;
+ var BASE_URL, args, jsdom, zip;
jsdom = require('jsdom');
- WUNDERGROUND_URL = 'http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=11231';
- jsdom.env(WUNDERGROUND_URL, ['http://code.jquery.com/jquery-1.5.min.js'], function(errors, window) {
+ 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();
- return console.log("Today's high: " + high + "\nToday's low: " + low);
+ console.log("Today's high: " + high);
+ return console.log("Today's low: " + low);
});
}).call(this);
View
@@ -11,4 +11,5 @@ jsdom.env BASE_URL + zip,
high = $('.fctHiLow .b').html()
low = $('.fctHiLow').first().html().split('|')[1].split('°')[0].trim()
- console.log "Today's high: #{high}\nToday's low: #{low}"
+ console.log "Today's high: #{high}"
+ console.log "Today's low: #{low}"
View
@@ -1,16 +1,16 @@
{
- "author": "Bryan Woods <bryan@howaboutwe.com> (http://bryanwoods4e.com)",
- "name": "degrees",
- "description": "What are the degrees today?",
- "version": "0.0.1",
- "homepage": "http://github.com/bryanwoods/degrees",
- "repository": {
- "url": "git://github.com/bryanwoods/degrees.git"
- },
- "engines": {
- "node": ">= 0.4.7"
- },
- "bin": {
- "degrees": "./bin/degrees"
- }
+ "author": "Bryan Woods <bryan@howaboutwe.com> (http://bryanwoods4e.com)",
+ "name": "degrees",
+ "description": "What are the degrees today?",
+ "version": "0.0.1",
+ "homepage": "http://github.com/bryanwoods/degrees",
+ "repository": {
+ "url": "git://github.com/bryanwoods/degrees.git"
+ },
+ "engines": {
+ "node": ">= 0.4.7"
+ },
+ "bin": {
+ "degrees": "./bin/degrees"
+ }
}

0 comments on commit 330daf6

Please sign in to comment.