Permalink
Browse files

Use QueryString object to generate query.

  • Loading branch information...
1 parent 2d542e0 commit 416e6acbc33881fb85184571f97cf56323eb9004 @scottgonzalez committed Feb 21, 2010
Showing with 7 additions and 3 deletions.
  1. +7 −3 twitter-notify.js
View
@@ -1,12 +1,16 @@
-var sys = require( "sys" ),
- http = require( "http" ),
+var http = require( "http" ),
+ QueryString = require( "QueryString" ),
Growl = require( "./lib/Growl" ).Growl;
var search = "ncjs",
since = 0;
function getTweets() {
- http.cat("http://search.twitter.com/search.json?q=" + search + "&since_id="+since, function(status, content) {
+ var query = QueryString.stringify({
+ q: search,
+ since_id: since
+ });
+ http.cat( "http://search.twitter.com/search.json?" + query, function( status, content ) {
JSON.parse( content ).results.forEach(function( tweet ) {
if ( tweet.id > since) {
since = tweet.id;

0 comments on commit 416e6ac

Please sign in to comment.