Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (25 sloc) 1.2 KB
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<sampleQuery>select * from {table} where place1="london" and place="paris"</sampleQuery>
<author>Christian Heilmann</author>
<documentationURL>http://isithackday.com/hacks/geo/distance/</documentationURL>
<description>Gives you the distance of two places on earth in miles or kilometers</description>
</meta>
<bindings>
<select itemPath="" produces="XML">
<execute><![CDATA[
var out = '';
var res = y.query("select href from html where url='http://collectionsonline.nmsi.ac.uk/info.php?page=0&v=1&s=trevithick&type=all&t=objects&f=&d=' and xpath='//div[@class="+'"'+"content"+'"'+"]/p[@align="+'"'+"center"+'"'+"]/a'").results;
var out = <images/>;
for each(var i in res..a){
var url = 'http://collectionsonline.nmsi.ac.uk/'+(i.@['href']);
var url = url.replace('&amp;','&');
var inner = y.query("select * from html where url = '"+url+"' and xpath='//div//td//img'").results;
out.img += inner..img;
}
response.object = <scraped>{out}</scraped>;
]]></execute>
</select>
</bindings>
</table>
Jump to Line
Something went wrong with that request. Please try again.