Created
February 2, 2017 06:08
-
-
Save ascott/a611ad024a539d77d68b98c16441e27c to your computer and use it in GitHub Desktop.
scrape twitter.com/{account}/lists/{list_name}/members
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
//https://twitter.com/tweetcongress/lists/congress/members | |
//https://twitter.com/cspan/lists/members-of-congress/members | |
var $rows = $('.js-profile-popup-actionable'); | |
var csv = 'name,twitterHandle,twitterUrl\n'; | |
$rows.each(function(i) { | |
var $el = $($rows[i]); | |
var name = $el.attr('data-name'); | |
var twitterHandle = $el.attr('data-screen-name'); | |
var twitterUrl = 'http://twitter.com/' + twitterHandle; | |
csv += name + ', '; | |
csv += twitterHandle + ', '; | |
csv += twitterUrl + '\n'; | |
}); | |
copy(csv) // copies to clipboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment