Skip to content

Instantly share code, notes, and snippets.

@aseemk
Created April 3, 2012 03:45
Show Gist options
  • Save aseemk/2289135 to your computer and use it in GitHub Desktop.
Save aseemk/2289135 to your computer and use it in GitHub Desktop.
A bookmarklet I whipped up to do something-or-another on Twitter. ;) I forget exactly what now; just didn't want to lose this code. =)
$('.tweet').each ->
$tweet = $(this)
# ignore tweets from ABC and DEF user IDs
return if $tweet.data('user-id') in [123, 456]
# also ignore tweets we've seen
return if $tweet.data('image-opened')
$openLink = $tweet.find '.open-tweet'
$openLink.click()
$photo = $tweet.find 'a.inline-media-image img'
$permalink = $tweet.find 'a.permalink-link.js-permalink'
return if not $photo.length
window.open $permalink[0].href
window.open $photo[0].src + ':large'
$openLink.click()
$tweet.data('image-opened', true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment