Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting empty results #14

Closed
qais-aboujaoude opened this issue Feb 18, 2018 · 3 comments
Closed

Getting empty results #14

qais-aboujaoude opened this issue Feb 18, 2018 · 3 comments

Comments

@qais-aboujaoude
Copy link

qais-aboujaoude commented Feb 18, 2018

Whether I'm using the CLI or the API I'm not getting any results.
Last year things were working perfectly. Last time I tested it around January it was also working.
This seems to be a recent change.

$ pitchfork -a 'wilco'
Your search returned no results!  Please try a differnt query.

$ pitchfork -a 'radiohead'
Your search returned no results!  Please try a differnt query.

 pitchfork wilco 'yankee hotel foxtrot'
Your search returned no results!  Please try a differnt query.

app.get('/test', (req, res) => {
  var s = new pitchfork.Search('radiohead')
  s.on('ready', function(results){
    console.log("results", results)
  })
})

app.get('/pitchfork/:album/:artist', (req, res) => {
  let list = []
  let album = req.params.album
  let artist = req.params.artist
  let query = album + ' ' + artist
  let search = new pitchfork.Search(query)  
  search.promise.then(results => {
    results.forEach(review => {
      list.push(review.attributes)
      res.send(list)
    })
  })
})

If I log the search object here is the outcome:

Search {
  results: [],
  query: { artist: 'radiohead', album: undefined, cb: undefined },
  promise: { state: 'pending' } }
results []
@omardelarosa
Copy link
Owner

@qais-aboujaoude I think some changes were recently made to the pitchfork site and the DOM selectors were updated. however, the newest version of this package v0.0.16 on npm should work. If so, let me know and I can close this issue.

@qais-aboujaoude
Copy link
Author

@omardelarosa

Updated to v0.0.16.

Now it works fine, both the API and the CLI. Thanks a lot.

Funny thing. Today I decided to make my own pitchfork module. First time I do an NPM package and it's not working 😛

Again, thanks for the quick fix.

@omardelarosa
Copy link
Owner

😄 This particular fix actually came from a PR: #13

They've made a lot of subtle changes to the pitchfork website the past year or two, so it's been tough to keep up with all of them. Anyway, good luck with your pitchfork module and send me a link whenever you publish to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants