Skip to content

Instantly share code, notes, and snippets.

@kingkool68
Created April 21, 2014 18:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingkool68/11152740 to your computer and use it in GitHub Desktop.
Save kingkool68/11152740 to your computer and use it in GitHub Desktop.
Download the URL, title, and date for all of the posts on a given archive page URL such as http://www.pewresearch.org/category/publications/fact-tank/project/u-s-politics/2014/pages/all/ Copy and paste this into the Console of the developer tools.
jQuery( document ).ready( function($) {
var csv = "data:text/csv;charset=utf-8,";
var csvData = [];
$('#content .post').each(function() {
$this = $(this);
csvData.push( [this.href, $this.find('h2').text(), $this.find('.meta span:last-of-type').text() ] );
});
for( i=0; i < csvData.length; i++ ) {
var row = '"' + csvData[i].join('","') + '"';
if( i < csvData.length ){
row += "\n";
}
csv += row;
}
window.open( encodeURI(csv) );
});
@mpiccorossi
Copy link

this is handy ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment