All Projects → omardelarosa → Pitchfork Npm

omardelarosa / Pitchfork Npm

An Unofficial Pitchfork Music API client for Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pitchfork Npm

Headlesschrome
A Go package for working with headless Chrome. Run interactive JavaScript commands on web pages with Go and Chrome.
Stars: ✭ 112 (+124%)
Mutual labels:  cli, scraper
Instascrape
🚀 A fast and lightweight utility and Python library for downloading posts, stories, and highlights from Instagram.
Stars: ✭ 76 (+52%)
Mutual labels:  cli, scraper
Spam Bot 3000
Social media research and promotion, semi-autonomous CLI bot
Stars: ✭ 79 (+58%)
Mutual labels:  cli, scraper
Cum
comic updater, mangafied
Stars: ✭ 117 (+134%)
Mutual labels:  cli, scraper
Scrape Twitter
🐦 Access Twitter data without an API key. [DEPRECATED]
Stars: ✭ 166 (+232%)
Mutual labels:  cli, scraper
Ferret
Declarative web scraping
Stars: ✭ 4,837 (+9574%)
Mutual labels:  cli, scraper
Xidel
Command line tool to download and extract data from HTML/XML pages or JSON-APIs, using CSS, XPath 3.0, XQuery 3.0, JSONiq or pattern matching. It can also create new or transformed XML/HTML/JSON documents.
Stars: ✭ 335 (+570%)
Mutual labels:  cli, scraper
Regina
Fetch new releases from http://www.juno.co.uk/.
Stars: ✭ 6 (-88%)
Mutual labels:  cli, scraper
Para
Para - community plugin manager and a "swiss army knife" for Terraform/Terragrunt - just 1 tool to facilitate all your workflows.
Stars: ✭ 47 (-6%)
Mutual labels:  cli
Ascii Combat
A simple CLI text adventure game, created for learning purposes, feel free to contribute.
Stars: ✭ 49 (-2%)
Mutual labels:  cli
Graphql Zeus
GraphQL client and GraphQL code generator with GraphQL autocomplete library generation ⚡⚡⚡ for browser,nodejs and react native
Stars: ✭ 1,043 (+1986%)
Mutual labels:  cli
Nomadctld
ssh server with ability to exec/attach/logs/tail/stop/restart hashicorp nomad containers
Stars: ✭ 47 (-6%)
Mutual labels:  cli
Cli
💻 Decentraland command-line interface
Stars: ✭ 49 (-2%)
Mutual labels:  cli
Gosearch
🔍 Search the Go packages via command-line
Stars: ✭ 48 (-4%)
Mutual labels:  cli
Pectin
Rollup-related tools for incremental transpilation of packages in Lerna-based monorepos
Stars: ✭ 50 (+0%)
Mutual labels:  cli
Nodejs
Everything related to the Node.js ecosystem for the commercetools platform.
Stars: ✭ 47 (-6%)
Mutual labels:  cli
Social Scraper
Tổng hợp script crawl dữ liệu từ các mạng xã hội & website tiếng Việt
Stars: ✭ 47 (-6%)
Mutual labels:  scraper
Scrapstagram
An Instagram Scrapper
Stars: ✭ 50 (+0%)
Mutual labels:  scraper
Picofeed
A minimal terminal rss reader
Stars: ✭ 50 (+0%)
Mutual labels:  cli
Rdoc
colourised R docs in the terminal
Stars: ✭ 49 (-2%)
Mutual labels:  cli

#Pitchfork Client

Travis CI

An unofficial Node.js client for Pitchfork reviews based on the Pitchfork API Client for Python.

Install

Using NPM

npm install pitchfork

Using Github

git clone [email protected]:omardelarosa/pitchfork-npm.git

You can then use it as a command-line tool or as a node module

##API

You can require pitchfork and use it inside of any Node.JS application.

var p4k = require('pitchfork')

Search

A Search constructor that extends EventEmitter. Listeners can be attached to the 'ready' event which will fire when all reviews have been fetched and parsed. For example:

var p = require('pitchfork')
var s = new p.Search('wilco')

s.on('ready', function(results){
  console.log("results", results)
})

//=> [ {Review}, {Review}, {Review}, ... ]

.results

An Array of Review objects.

.init()

Called once when Search is instantiated to fetch results. Not usually called directly

Page

A Page constructor that extends EventEmitter. This constructor takes an integer argument specifying which page of reviews you wish to fetch from /reviews/albums/:page_num. Listeners can be attached to the 'ready' event which will fire when all reviews have been fetched and parsed. For example, this would return all the most recent reviews:

var p = require('pitchfork')
var s = new p.Page(1)

s.on('ready', function(results){
  console.log("results", results)
})

//=> [ {Review}, {Review}, {Review}, ... ]

Review

The Review constructor encapsulates methods and data relating to the Pitchfork review. The Review extends EventEmitter and fires a 'ready' event when the review has been fetched and parsed.

.attributes

An Object with information about the album and its text. Sample below:

{
  "url": "/reviews/albums/9419-the-letting-go/",
  "name": "Bonnie \"Prince\" Billy - The Letting Go",
  "artist": "Bonnie \"Prince\" Billy",
  "album": "The Letting Go",
  "title": "Bonnie \"Prince\" Billy: The Letting Go | Album Reviews | Pitchfork",
  "label": "Palace / Drag City",
  "year": "2006",
  "score": 8.2,
  "cover": "http://cdn.pitchfork.com/albums/9255/homepage_large.e8a2bd20.jpg",
  "author": "Mark Richardson",
  "date": "September 18, 2006",
  "editorial": {
    "text": "...",
    "html": "..."
}

.fetch()

This method is automatically called when the Review is instantiated and returns a Promise. This generally isn't called directly.

.promise

This stores the thennable promise object generated by .fetch for attaching .then-style callbacks.

.verbose()

The full Review instance represented as JSON.

{
  "url": "/reviews/albums/9419-the-letting-go/",
  "name": "Bonnie \"Prince\" Billy - The Letting Go",
  "artist": "Bonnie \"Prince\" Billy",
  "album": "The Letting Go",
  "title": "Bonnie \"Prince\" Billy: The Letting Go | Album Reviews | Pitchfork",
  "label": "Palace / Drag City",
  "year": "2006",
  "score": 8.2,
  "cover": "http://cdn.pitchfork.com/albums/9255/homepage_large.e8a2bd20.jpg",
  "author": "Mark Richardson",
  "date": "September 18, 2006",
  "editorial": {
    "html": " <p>Though Will Oldham began his musical career while in his early twenties, ... deep absorption or self-reflection so much as a kind of fond familiarity. </p> ",
    "text": " Though Will Oldham began his musical career while in his early twenties ... deep absorption or self-reflection so much as a kind of fond familiarity.  "
  }
}

.truncated()

The attributes of the Review instance with editorial.html/editorial.text condensed into the first 300 characters of of the text assigned to the key '.text'.

{
  "url": "/reviews/albums/9419-the-letting-go/",
  "name": "Bonnie \"Prince\" Billy - The Letting Go",
  "artist": "Bonnie \"Prince\" Billy",
  "album": "The Letting Go",
  "title": "Bonnie \"Prince\" Billy: The Letting Go | Album Reviews | Pitchfork",
  "label": "Palace / Drag City",
  "year": "2006",
  "score": 8.2,
  "cover": "http://cdn.pitchfork.com/albums/9255/homepage_large.e8a2bd20.jpg",
  "author": "Mark Richardson",
  "date": "September 18, 2006",
  "text": " Though Will Oldham began his musical career while in his early twenties, he's never exactly sounded young. From his first releases as Palace Music, Oldham's whiskey-soaked vocals and lyrical obsessions with death, sex, and religion have made \"maturity\" something of a non-issue. And yet, with his mo..."
}

.text_pretty_print()

Prints a plain-text representation of the review.


CLI (Command-Line Interface)

Returns a review for a given artist and album title.

$ pitchfork wilco 'yankee hotel foxtrot'
# { ... pretty-printed, colorized quasi-JSON object... }

or you can use -a and -t flags.

$ pitchfork -a wilco -t 'yankee hotel foxtrot'
# { ... pretty-printed, colorized quasi-JSON object... }

Returns a list of reviews for a given artist with no album.

$ pitchfork -a 'wilco'
# [ 
#    { ... pretty-printed, colorized quasi-JSON object... },
#    { ... pretty-printed, colorized quasi-JSON object... },
#    { ... pretty-printed, colorized quasi-JSON object... }
# ]

For valid, uncolored JSON, use the --json flag:

$ pitchfork -a 'wilco' -t 'yankee hotel foxtrot' --json
# { ... valid JSON object... }

Flags

flag(s) required argument description
-a y artist_name returns a review by given artist
-t album_title returns a review by given album title
-j,--json returns review attributes as un-prettified json
-v, --verbose returns review entire object as json
-V, --version returns version number
-T,--truncated returns a truncated json object of the review attributes
-tx,--text returns a text version of review (ex: to pipe output to 'less' )
-p page_number returns a list of reviews located on the specified page
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].