Created
April 3, 2012 03:45
-
-
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. =)
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
$('.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