Skip to content

Instantly share code, notes, and snippets.

@sadasant
Created July 15, 2012 03:08
Show Gist options
  • Save sadasant/3114670 to your computer and use it in GitHub Desktop.
Save sadasant/3114670 to your computer and use it in GitHub Desktop.
Map Twitter Favorites
// Go to https://api.twitter.com/1/favorites.json?count=200&screen_name=sadasant
TWEETS = JSON.parse(document.body.firstChild.innerHTML)
mapped_tweets = []
function mapper(e){
if(e.user.screen_name==='sadasant')
mapped_tweets.push({
id: e.id_str
, date: e.created_at
, text: e.text
})
}
TWEETS.map(mapper)
console.log(JSON.stringify(mapped_tweets))
// Copy that, then go to http://jsbeautifier.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment