1// Passes the RAVE RSS xml to xml-json-proxy.php which returns the XML 2 3var url = "https://www.getrave.com/rss/pasadenacc/channel2"; 4 5// AJAX request 6var xhr2 = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP")); 7xhr2.onreadystatechange = XHRhandler; 8xhr2.open("GET", "/_resources/includes/scripts/xml-json-proxy.php?url=" + escape(url), true); 9xhr2.send(null); 10// handle response 11function XHRhandler() { 12 13 if (xhr2.readyState == 4) { 14 15 // parse response as JSON 16 var json; 17 if (JSON && JSON.parse) { 18 json = JSON.parse(xhr2.responseText); 19 //console.log(json); 20 } 21 else { 22 eval("var json = " + xhr2.responseText); 23 } 24 25 var rtitle = json.channel.item.title; 26 27 if (json.channel.item.description){ 28 var rdesc = json.channel.item.description; 29 } 30 else { 31 var rdesc = ''; 32 } 33 if(json.channel.item.link.valueOf() != '{}'){ 34 var rlink = json.channel.item.link; 35 //console.log(json.channel.item.link.valueOf()); 36 } 37 else{ 38 var rlink = ''; 39 } 40 if(json.channel.image){ 41 42 var rimg = json.channel.image.url; 43 } 44 else{ 45 var rimg = '/_resources/img/rss/notice-default.png'; 46 } 47 48 if (rtitle !== "Website Notice Off"){ 49 50 $("#notice-container").loadTemplate($("#notice-template"), 51 { 52 title: rtitle, 53 description: rdesc, 54 link: rlink, 55 image: rimg 56 }) 57 $("#notice-container").css('display', 'block'); 58 } 59 else { 60 $("#notice-container").css('display', 'none'); 61 } 62 // Debugging code 63 //console.log(json); 64 //alert(rtitle); 65 66 xhr2 = null; 67 68 } 69 else { 70 $("#notice-container").css('display', 'none'); 71 } 72 73}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.