This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE 'http://www.jonleblanc.com/projects/yql/weather_locations.xml' AS weather_location; select * from weather.forecast where location in (SELECT loc.id FROM weather_location WHERE location='London' LIMIT 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="test_canvas" width="400" height="400"> | |
If the canvas element is not supported in your browser, this text will be displayed | |
</canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var example = document.getElementById('test_canvas'); | |
var context = example.getContext('2d'); | |
context.fillStyle = "rgb(255,0,0)"; | |
context.fillRect(30, 30, 50, 50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="10" yahoo:created="2010-03-31T06:27:19Z" yahoo:lang="en-US" yahoo:updated="2010-03-31T06:27:19Z" yahoo:uri="http://query.yahooapis.com/v1/yql?q=select+*+from+flickr.photos.search+where+has_geo%3D%22true%22+and+text%3D%22san+francisco%22"> | |
<diagnostics> | |
<publiclyCallable>true</publiclyCallable> | |
<url execution-time="444"><![CDATA[http://api.flickr.com/services/rest/?method=flickr.photos.search&has_geo=true&text=san%20francisco&page=1&per_page=10]]></url> | |
<user-time>445</user-time> | |
<service-time>444</service-time> | |
<build-version>5275</build-version> | |
</diagnostics> | |
<results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$yql_url = 'http://query.yahooapis.com/v1/public/yql?'; | |
$query = 'SELECT * FROM flickr.photos.search WHERE has_geo="true" AND text="san francisco"'; | |
$query_url = $yql_url . 'q=' . urlencode($query) . '&format=xml'; | |
$photos = simplexml_load_file($query_url); | |
$result = build_photos($photos->results->photo); | |
echo $result; | |
function build_photos($photos){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript' src='yql_js_widget.js'></script> | |
<div id='widgetContainer'></div> | |
<script type='text/javascript'> | |
var config = {"debug":true}; | |
var format = "<br style='clear:both' /><img src='{content}' width='620' height='500' alt='map' />"; | |
var yqlQuery = "SELECT * FROM maps.map WHERE (latitude, longitude) IN (SELECT match.place.centroid.latitude, match.place.centroid.longitude FROM geo.placemaker WHERE documentURL = 'http://www.cnn.com/' AND documentType='text/html' AND appid='')"; | |
var insertEl = "widgetContainer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return { | |
//push widget on the load stack | |
push: function(query, config, format, insertEl){ | |
//validate widget variables | |
if (query == null || format == null || insertEl == null){ | |
if (setupConfig["debug"] && window.console){ console.log("Missing query, return format or insert element"); } | |
return null; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//variable instantiation | |
var yqlPublicQueryURL = "http://query.yahooapis.com/v1/public/yql?"; | |
var widgetStack = []; | |
var currString, resultFormat, queryInsert, setupConfig = []; | |
var regex = /\{([\w\-\.\[\]]+)\}/gi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************** | |
* Method: Get YQL Data | |
* Description: Use the query provided to make a | |
* request to YQL endpoint to capture data | |
*****************************************************/ | |
var getYQLData = function(query){ | |
//prepare the URL for public YQL queries: | |
var sURL = yqlPublicQueryURL + "q=" + encodeURI(query) + "&format=json&callback=yqlWidget.getYQLDataCallback"; | |
//add any environment files specified in the config |
OlderNewer