pitchfork-scraper
v1.2.0
Published
A simple Pitchfork scraper
Downloads
2
Readme
pitchfork scraper
A super simple Pitchfork.com HTML scraper to get the first item from a query.
Usage
$ npm install --save pitchfork-scraper # or yarn add pitchfork-scraper
var pitchfork = require('pitchfork-scraper');
pitchfork('yankee hotel foxtrot')
.then((review) => {
console.log(`${review.album} is a ${review.score}`) // => 'Yankee Hotel Foxtrot is a 10'
})
.catch((err) => throw err);
The promise returns the first item to match the query with the following properties.
pitchfork('blood sugar sex magik')
.then((review) => {
console.log(review);
})
{
"artist": "Red Hot Chilli Peppers",
"album": "Blood Sugar Sex Magik",
"score": "7.1",
"cover": "http://cdn4.pitchfork.com/albums/23480/homepage_large.892bf6c0.jpg",
"review": "On their 1991 breakthrough album, the Red Hot Chili Peppers were the partially-clothed id, barreling toward the funk and..."
}
Testing
Super simple tesing using Ava.
$ git clone https://github.com/trmml/pitchfork-scraper
$ cd pitchfork-scraper && npm install
$ ava --verbose
If you wanna help, feel free to make a pull request :smile_cat: