Created
March 3, 2010 07:28
-
-
Save cantino/320406 to your computer and use it in GitHub Desktop.
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
// query: select * from html where url="http://some.url.com" and xpath='//title' | |
var yql_url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22" + encodeURIComponent(url) + "%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2Ftitle'&format=json&callback=?"; | |
$.getJSON(yql_url, function(json) { | |
if (json && json.query && json.query.results && json.query.results.title) { | |
$('#page_title').html(json.query.results.title); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment