I'm making a greasemonkey script to extract video URL code from youtube result: I have this:
// ==UserScript==
// @name extract
// @namespace here
// @include http://stackoverflow.com/
// @grant GM_xmlhttpRequest
// @version 0.1
// ==/UserScript==
window.setTimeout(conseguir_articulos_youtube, 5000);
function conseguir_articulos_youtube(){
GM_xmlhttpRequest({
method: "GET",
url: "http://www.youtube.com/results?search_sort=video_date_uploaded&uni=3&search_type=videos&search_query=humor",
onload: on_load_extract
});
}
function on_load_extract(data){
var datos=data.responseText;
alert(datos);
}
I use xmlHttpRequest to retrieve the content of youtube, but the code of the page present in the response is not complete. There is a form to retrieve the complete source code of a page in javascript?