1$(document).ready(function() { 2 3 alertPHP({ 4 alertURL: encodeURIComponent('https://lonestar.criticalarc.net/api/web/feeds/eobt5vckxibejifwb6j75til7a/items?token=7udyo4m7cxrujfjnektla4ntee&format=rss'), 5 target: '.alert-rss', 6 functionname: 'getXML' 7 }); 8 9 10}); 11 12function alertPHP(o) { 13 console.log(o); 14 $.ajax({ 15 type: "POST", 16 url: '/apis/alerts/alerts-safezone.php', 17 dataType: 'json', 18 data: { 19 'file': o.file, 20 'functionname': o.functionname, 21 'alertURL': o.alertURL 22 }, 23 success: function(data, textstatus) { 24 console.log(data); 25 console.log(textstatus); 26 27 if (data.success) { 28 loadRSS(o, data.fileURL); 29 console.log('this is working'); 30 } else { 31 console.log('broke'); 32 } 33 }, 34 error: function(ts) { 35 console.log('fail 10'); 36 console.log(ts.responseText); 37 } 38 }); 39} 40 41function loadRSS(o, fileURL) { 42 console.log(fileURL); 43 $.ajax({
44 type: "GET", 45 url: fileURL, 46 success: function(response, status, xhr) { 47 var message = drawMessage(response); 48 $(o.target).html(message); 49 }, 50 error: function() { 51 console.log('no file'); 52 } 53 }); 54 55} 56 57function drawMessage(data){ 58 console.log(data); 59 let firstItem = $(data).find('channel').find('item')[0]; 60 console.log($(firstItem).find('title')); 61 let html = ''; 62 let close = ' <button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>'; 63 let link = 'https://lonestar.edu/alert'; 64 let title = $(firstItem).find('title') ? '<h3><a href="'+link+'">'+$(firstItem).find('title').text()+'</a></h3>' : ''; 65 let desc = $(firstItem).find('description') ? '<p>'+$(firstItem).find('description').text()+'</p>' : ''; 66 let descRaw = $(firstItem).find('description').text().toLowerCase(); 67 let img = $(firstItem).find('enclosure').attr('url') ? '<img src="'+$(firstItem).find('enclosure').attr('url')+'">' : ''; 68 69 /* 70 if( firstItem.find('title').text() == '**RSS All Clear Test**' ){ 71 console.log('Alert Off'); 72 }else{ 73 html += close; 74 html += img; 75 html += title; 76 html += desc; 77 html = html != '' ? '<div class="alert-rss-container">'+html+'</div>' : ''; 78 if(title){ 79 $('section.alert').fadeIn('slow'); 80 } 81 return html; 82 } 83 */ 84 85 html += close; 86 html += img; 87 html += title; 88 html += desc; 89 html = html != '' ? '<div class="alert-rss-container">'+html+'</div>' : ''; 90 if(title){ 91 //$('section.alert').fadeIn('slow'); 92 $('.alert-rss').closest('.alert').fadeIn('slow'); 93 } 94 return html; 95}
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.