Skip to content

Instantly share code, notes, and snippets.

@marcweil
Created January 12, 2012 16:56
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 marcweil/1601626 to your computer and use it in GitHub Desktop.
Save marcweil/1601626 to your computer and use it in GitHub Desktop.
{
"result": {
"images": [
"http://imgr.com/image1.png",
"http://imgr.com/some-other-image.png"
]
}
}
{
"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"
]
}
}
{
"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": {}
}
// 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