Skip to content

Commit

Permalink
Updated to use complete instead of success for restler, success seeme…
Browse files Browse the repository at this point in the history
…d unreliable
  • Loading branch information
ewanleith committed Jun 9, 2011
1 parent 0cf706d commit 7eeda98
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,20 @@ function printTweet(tweetdata) {


function launchCollect() {
rest.get('http://search.twitter.com/search.json?q='+username, { headers: { 'User-Agent': 'Personal Twitter Archive', 'Referer': 'https://github.com/ewanleith/Personal-Twitter-Archive' }}).on('success', function(data) {
async.forEach(data['results'], printTweet, function(err) {
});
rest.get('http://search.twitter.com/search.json?q='+username, { headers: { 'User-Agent': 'Personal Twitter Archive', 'Referer': 'https://github.com/ewanleith/Personal-Twitter-Archive' }}).on('complete', function(data,response) {
if (response.statusCode == 200)
{
async.forEach(data['results'], printTweet, function(err) { })
}
});
rest.get('http://search.twitter.com/search.json?q=+from%3A'+username, { headers: { 'User-Agent': 'Personal Twitter Archive', 'Referer': 'https://github.com/ewanleith/Personal-Twitter-Archive' }}).on('success', function(data) {
async.forEach(data['results'], printTweet, function(err) {
});



rest.get('http://search.twitter.com/search.json?q=+from%3A'+username, { headers: { 'User-Agent': 'Personal Twitter Archive', 'Referer': 'https://github.com/ewanleith/Personal-Twitter-Archive' }}).on('complete', function(data,response) {
if (response.statusCode == 200)
{
async.forEach(data['results'], printTweet, function(err) { })
}
});
//console.log('Looping'); //Output logged data to console

Expand Down

0 comments on commit 7eeda98

Please sign in to comment.