Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created June 14, 2012 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanepiper/e8e8e9f123e8ef22e7cf to your computer and use it in GitHub Desktop.
Save tanepiper/e8e8e9f123e8ef22e7cf to your computer and use it in GitHub Desktop.
var express = require('express');
var dnode = require('dnode');
var request = require('request');
var server = express.createServer();
server.configure(function() {
server.use(express.static(__dirname + '/static'));
});
dnode({
twitterSearch: function(term, cb) {
request({
uri: 'http://search.twitter.com/search.json',
qs: {
q: term
},
json: true
}, cb);
}
}, function(client, connection) {
this.googleSearch = function(term, cb) {
request({
uri: 'http://ajax.googleapis.com/ajax/services/search/web',
qs: {
v: '1.0',
q: term
},
json: true
}, cb);
};
}).listen(server);
server.listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment