Skip to content

Instantly share code, notes, and snippets.

@cantino
Created March 3, 2010 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cantino/320406 to your computer and use it in GitHub Desktop.
Save cantino/320406 to your computer and use it in GitHub Desktop.
// 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