Skip to content

Conversation

@davidsawyer
Copy link

This fixes #13

Looks like an update to Hacker News' HTML broke the app's parsing. One single addition of a <tr> was the culprit.

I'd also recommend updating http://whoisryannystrom.com/hackernews.json:

{
  "feed": {
    "titles": "//table[@id='hnmain']/tr[4]/td/table//td[@class='title'][not(@align)]/a",
    "details": "//table[@id='hnmain']/tr[4]/td/table//td[@class='subtext']",
    "score": "//span[@class='score']",
    "comment_node": "(//a)[last()]"
  },
  "comments": {
    "comments": "//table[@id='hnmain']/tr[4]/td/table[2]/tr",
    "user": "//span[@class='comhead']/a[1]",
    "text": "//span[@class='comment']/span",
    "removed": "//span[@class='comment']",
    "indent": "//img[@src='s.gif']",
    "permalink": "//span[@class='age']/a"
  },
  "page": {
    "text": "//table[@id='hnmain']/tr[4]/td/table[1]/tr[4]/td[2]"
  },
  "user": {
    "username": "//table[@id='hnmain']/tr[4]/td//table//tr[1]/td[2]/a",
    "created": "//table[@id='hnmain']/tr[4]/td//table//tr[2]/td[2]",
    "karma": "//table[@id='hnmain']/tr[4]/td//table//tr[3]/td[2]",
    "about": "//table[@id='hnmain']/tr[4]/td//table//tr[4]/td[2]",
  }
}

@davidsawyer
Copy link
Author

It looks like they've changed the number of <tr>s back to how it was before, so the problem solved itself... for now at least. We still may want to check tr[4] as a fallback if tr[3] queries return no results, though.

Let me know your thoughts.

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

Successfully merging this pull request may close these issues.

Feed is consistently failing to load

1 participant