Permalink
Browse files

Refactoring smushit table, removing unnecessary complexity as the tab…

…le was using executable JavaScript when the same goal can be achieved by simply using yql's inputs/key features
  • Loading branch information...
1 parent be5b99d commit 59a9b9748172ff9fe7d89a209340797aa2377a54 John Tregoning committed Mar 9, 2010
Showing with 7 additions and 9 deletions.
  1. +7 −9 smushit/smushit.xml
View
16 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.