Permalink
Browse files

Javascript execute errors

  • Loading branch information...
1 parent bbe5cac commit 3e5fdc74b112c4c96ebb5420c63a285dac7be566 Daniel Park committed Oct 5, 2012
Showing with 0 additions and 80 deletions.
  1. +0 −80 movies/movies.showtimes.xml
@@ -1,80 +0,0 @@
-<?xml version="1.0"?>
-<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
- <meta>
- <author>Sam Pullara</author>
- </meta>
- <bindings>
- <select produces="XML" itemPath="showtimes.theater">
- <urls>
- <url>http://movies.yahoo.com/showtimes-tickets/</url>
- </urls>
- <paging model="offset">
- <start default="1" id="start"/>
- <pagesize max="50" id="results"/>
- <total default="10"/>
- </paging>
- <inputs>
- <key id="name" type="xs:string" paramType="variable" required="true"/>
- <key id="location" type="xs:string" paramType="variable" required="true"/>
- <key id="date" type="xs:string" paramType="variable"/>
- </inputs>
- <execute><![CDATA[
- var YAHOO = {Media:{WowSearch:{}}};
- y.include("http://movies.yahoo.com/dynamic-js/showtimes-movie-list.js");
- var object = new YAHOO.Media.WowSearch.setData;
-
- response.object = <error>Not found</error>;
-
- for each (var m in object.topMovies.movieArray) {
- if (m.t == name) {
- var url = "http://movies.yahoo.com/showtimes-tickets/movies/" + m.i + "-";
- url += "?location=" + encodeURI(location);
- if (date) {
- url += "&" + encodeURI(date);
- }
- var moviepage = y.query("select * from html where url=@url and xpath='//div[@id=\"movie_times\"]' ", {url:url}).results
- var showtimes = <showtimes/>;
- for each (var sts in moviepage..tr) {
- if (sts.td[2].span.text().toString() == "online ticketing not available") {
- continue;
- }
- var theater = <theater/>;
- theater.name += <name>{sts.td[0].a}</name>;
- for each (var st in sts.td[1].ul.li) {
- theater.showtime += <showtime>{st.a}</showtime>;
- }
- showtimes.theater += theater;
- }
- response.object = showtimes;
- break;
- }
- }
- ]]></execute>
- </select>
- <select produces="XML" itemPath="movies.movie">
- <urls>
- <url>http://movies.yahoo.com/showtimes-tickets/</url>
- </urls>
- <paging model="offset">
- <start default="1" id="start"/>
- <pagesize max="50" id="results"/>
- <total default="10"/>
- </paging>
- <inputs>
- </inputs>
- <execute><![CDATA[
- var YAHOO = {Media:{WowSearch:{}}};
- y.include("http://movies.yahoo.com/dynamic-js/showtimes-movie-list.js");
-
- var movies=<movies/>;
- var object = new YAHOO.Media.WowSearch.setData;
-
- for each (var m in object.topMovies.movieArray) {
- movies.movie += <movie>{m.t}</movie>;
- }
-
- response.object = movies;
- ]]></execute>
- </select>
- </bindings>
-</table>

0 comments on commit 3e5fdc7

Please sign in to comment.