public
Created

  • Download Gist
cm-filtered-with-func.json
JSON
1 2 3 4 5 6 7 8
{
"result": {
"images": [
"http://imgr.com/image1.png",
"http://imgr.com/some-other-image.png"
]
}
}
cm-standard-with-func.json
JSON
1 2 3 4 5 6 7 8 9 10 11 12 13
{
"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"
]
}
}
cm-standard.json
JSON
1 2 3 4 5 6 7
{
"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": {}
}
twitter.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// 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 });
}
});
}
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.