User:Auskoala/vector.js

function processbacklinks(backlinks) { var $xmllinks = $(backlinks); var output = "";

alert(backlinks.splice(1,100));

}

function getfeed {

var url = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?title=" + wgPageName + "&feed=atom&action=history";

$.get(mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/api.php?action=query&list=backlinks&bltitle=" + wgPageName + "&blfilterredir=redirects&bllimit=500", processbacklinks)

//alert(url);

$.get(url, function(data) {   var $xml = $(data);    var output = "";    $xml.find("entry").each(function { var $this = $(this), item = { title: $this.find("title").text, link: $this.find("link").text, summary: $this.find("summary").text, updated: $this.find("updated").text, author: $this.find("author").text }       //Do something with item here... output = output + " title is " + item.title + " author is " + item.author + " updated on " + item.updated + "\n"; });   $('#ta').val(output);    //alert(wgPageName);    //alert(mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "index.php?title=" + wgPageName + "&feed=atom&action=history"); }); }

function processXML(xmlresponse){ //if (status == "success") //{                    //alert("success"); //alert(response.slice(1,40)); //$('#ta').val(response.slice(1, 100)); //var xmlresponse = $.parseXML(response); var output = ""; alert(xmlresponse.length); $(xmlresponse).find("entry").each(function                          {                                ouput = output + "title is " + $(this).find("title").text + " ";                                // $('#ta').append($(this).attr("title") + "was updated by " + $(this).attr("author") + " on " + $(this).attr("updated"));                           }                     ); var xmlString = (new XMLSerializer).serializeToString(xmlresponse); $('#ta').val(output); alert(xmlString); //}            //else //{                  //  alert("ajax failed"); //}             //}              //);              //  } }

function addeditinfo { $('#p-coll-print_export').after(' '); // $('#ta').style.overflow = "auto"; $('#ta').val("hello world"); getfeed; //   $.ajax({ //          type: "GET", //         url: "http://en.wikipedia.org/w/index.php?title=MooTools&feed=atom&action=history",  //        datatype: "xml",   //       success: processXML    //      }); //$('#ta').load('http://en.wikipedia.org/w/index.php?title=Special:RecentChanges&feed=atom',  //       function processxml(xmlresponse){             //if (status == "success")                 //{                     //alert("success");                     //alert(response.slice(1,40));                     //$('#ta').val(response.slice(1, 100));                     //var xmlresponse = $.parseXML(response);    //                 var output = "";      //               $(xmlresponse).find("entry").each(function //                  {          //                      ouput = output + "title is " + $(this).find("title").text + " "; // $('#ta').append($(this).attr("title") + "was updated by " + $(this).attr("author") + " on " + $(this).attr("updated")); //              }              //       );                //     $('#ta').val(output);                 //}             //else                 //{                   //  alert("ajax failed");                 //}              //}              //); //} //} }

$( document ).ready(addeditinfo);