Skip to content

Instantly share code, notes, and snippets.

@Aymkdn
Created August 24, 2017 08:13
Show Gist options
  • Save Aymkdn/e46609bc4250d4d1129734c2ac5a1d90 to your computer and use it in GitHub Desktop.
Save Aymkdn/e46609bc4250d4d1129734c2ac5a1d90 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Todd Vierling</author>
<description>HTML selector that returns a flat, escaped string rather than a node tree. Suitable for use with Pipes and other applications wishing to embed HTML in another XML-like container.</description>
<sampleQuery>select * from {table} where url='http://www.yahoo.com/' and xpath='//a'</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>{url}</url>
</urls>
<inputs>
<key id="url" type="xs:string" paramType="variable" required="true" />
<key id="xpath" type="xs:string" paramType="variable" required="false" />
</inputs>
<execute><![CDATA[
var results = y.rest(url).accept('text/html').get().response;
if (xpath) results = y.xpath(results, xpath);
response.object = results.toXMLString();
]]></execute>
</select>
</bindings>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment