Skip to content

Commit

Permalink
Refactoring smushit table, removing unnecessary complexity as the tab…
Browse files Browse the repository at this point in the history
…le was using executable JavaScript when the same goal can be achieved by simply using yql's inputs/key features
  • Loading branch information
John Tregoning authored and John Tregoning committed Mar 9, 2010
1 parent be5b99d commit 59a9b97
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions smushit/smushit.xml
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="any" https="false">
<meta>
<author>Chirag Shah</author>
<documentationURL>http://developer.yahoo.com/yslow/smushit/</documentationURL>
<sampleQuery>select * from smushit where url='http://l.yimg.com/a/i/brand/purplelogo/uh/us/news.gif'</sampleQuery>
<sampleQuery>select * from smushit where url="http://l.yimg.com/a/i/brand/purplelogo/uh/us/news.gif"</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<select produces="JSON">
<urls>
<url env="all">http://smushit.eperf.vip.ac4.yahoo.com/ysmush.it/ws.php</url>
</urls>
<inputs><key id='url' type='xs:string' paramType='variable' required="true"/></inputs>
<execute><![CDATA[
var base = [request.url, '?img=', url].join('');
response.object = y.rest(base).get().response;
]]></execute>
<inputs>
<key id="img" as="url" type="xs:string" paramType="query" required="true" batchable="false" />
</inputs>
</select>
</bindings>
</table>

0 comments on commit 59a9b97

Please sign in to comment.