Skip to content

Instantly share code, notes, and snippets.

@ascott
Created February 2, 2017 06:08
Show Gist options
  • Save ascott/a611ad024a539d77d68b98c16441e27c to your computer and use it in GitHub Desktop.
Save ascott/a611ad024a539d77d68b98c16441e27c to your computer and use it in GitHub Desktop.
scrape twitter.com/{account}/lists/{list_name}/members
//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