Created
January 12, 2012 16:56
-
-
Save marcweil/1601626 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"result": { | |
"images": [ | |
"http://imgr.com/image1.png", | |
"http://imgr.com/some-other-image.png" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success": { | |
"tweet-1234": { "id": 1234, "content": "ruby is the coolest language ever", ... }, | |
"tweet-5667": { "id": 5667, "content": "Just finished my new blog post on using Sinatra with Ruby!", ... } | |
}, | |
"errors": {}, | |
"result": { | |
"images": [ | |
"http://imgr.com/image1.png", | |
"http://imgr.com/some-other-image.png" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success": { | |
"tweet-1234": { "id": 1234, "content": "ruby is the coolest language ever", ... }, | |
"tweet-5667": { "id": 5667, "content": "Just finished my new blog post on using Sinatra with Ruby!", ... } | |
}, | |
"errors": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// initialize the CloudMine library with your app credentials | |
cloudmine.init({ | |
app_id: "7f0...", | |
api_key: "e4a..." | |
}); | |
http.get("http://search.twitter.com/search.json?q=" + data.params.search, null, function(response) { | |
var profile_images = []; | |
for (var idx in response.results.slice(0,10)) { | |
var tweet = response.results[idx]; | |
profile_images.push(tweet.profile_image_url); | |
cloudmine.setValue("tweet-"+tweet.id_str, tweet, function() { | |
if (profile_images.length == 10) { | |
exit({ images: profile_images }); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment