Sometimes, I just want to generate a bunch of test data.
fzaninotto/Faker is awesome for generating fake data, but when you want something that is more real, such as book titles, how do you do it? I use my two favourite tools: Amazon... and Google Chrome :)
1: Go to http://www.amazon.com/best-sellers-books-Amazon/zgbs/books
2: Run the following inside the Google Chrome Developer Console:
books = [];
$('.zg_itemWrapper').each(function() {
books.push({
title: $(this).find('.zg_title').text().trim(),
author: $(this).find('.zg_byline').text().trim().replace(/^by /, ''),
link: $(this).find('a:first').attr('href').trim().replace(/\/ref=.*/, '')
});
} )
3: Copy and paste the JSON from
JSON.stringify(books)
4: ???
5: PROFIT!