Skip to content

Instantly share code, notes, and snippets.

@nhitze
Created March 22, 2011 15:00
Show Gist options
  • Save nhitze/881350 to your computer and use it in GitHub Desktop.
Save nhitze/881350 to your computer and use it in GitHub Desktop.
extracting Data from a GTUGs.org Directory Page
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Nils Hitze</author>
<description>extracting Data from a GTUGs.org Directory Page</description>
<documentationURL>http://munich.gtugs.org</documentationURL>
<sampleQuery>SELECT * FROM {table} WHERE chapter_id=1011</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="JSON">
<urls>
<url>http://www.gtugs.org/chapter.jsp?id={chapter_id}</url>
</urls>
<inputs>
<key id="chapter_id" type="xs:string" paramType="variable" required="true" />
</inputs>
<execute><![CDATA[
var xpath = '//div[@class="tabbertab"]/div/div/h4';
var url = "http://www.gtugs.org/chapter.jsp?id="+chapter_id;
var yql = "SELECT * FROM html where url='"+url+"' and xpath='"+xpath+"'";
var result = y.query(yql);
response.object = result.results.h4.content;
]]></execute>
</select>
</bindings>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment