News for hackers. Stuff that matters.
Re:Using YQL to grab HN links by chaosmachine on Saturday May 02, 2009 @06:55PM (#590294)
The query is:

  select * from html where url="http://news.ycombinator.com/" and
  xpath='//tr/td/a[substring(@href,1,4)="http"][@href!="http://ycombinator.com"]'
You can play with it yourself here (needs yahoo login):

http://developer.yahoo.com/yql/console/

Re:Using YQL to grab HN links by thorax on Saturday May 02, 2009 @08:28PM (#590364)
You know, honestly, I wasn't grokking much about how cool YQL could be until I saw this example. This helps a lot. Thanks.
Re:Using YQL to grab HN links by henning on Saturday May 02, 2009 @08:38PM (#590370)
I don't get it. Don't queries like that suffer from the same problems as normal screen scraping?
Re:Using YQL to grab HN links by jfarmer on Saturday May 02, 2009 @09:41PM (#590410)
Yeah, they're obviously brittle, but it's baby steps, y'know?

I think it's pretty crazy that you can now scrape well-marked pages with a SQL-like syntax.

Re:Using YQL to grab HN links by Sephr on Saturday May 02, 2009 @07:46PM (#590328)
YQL isn't that great server-side until they add an `Access-Control-Allow-Origin: *` header. I'm pretty disappointed that they completely disallow Javascript access.
Re:Using YQL to grab HN links by spullara on Saturday May 02, 2009 @07:50PM (#590334)
It offers JSONP instead so you can access any YQL content via Javascript in a browser via script nodes.
Re:Using YQL to grab HN links by Sephr on Sunday May 03, 2009 @01:41AM (#590592)
You still have to give Yahoo! complete control with that method. With XHR, Yahoo! has no control over your webpage.
Re:Using YQL to grab HN links by spullara on Sunday May 03, 2009 @06:14AM (#590757)
It only it works in a few browsers but doesn't seem like it would hurt anything to add it. Thanks for the suggestion!
Re:Using YQL to grab HN links by sachinag on Sunday May 03, 2009 @10:51AM (#590874)
I love how HN is the only site where "[x] would be cool" turns into a feature request implemented by the vendor.
Re:Using YQL to grab HN links by spullara on Sunday May 03, 2009 @02:30PM (#591092)
Nah, we do the same thing for things suggested on Twitter :)