Created
March 22, 2011 15:00
-
-
Save nhitze/881350 to your computer and use it in GitHub Desktop.
extracting Data from a GTUGs.org Directory Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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