/* Virus Bulletin Infofeed */ /* Peter Sergeant - pete.sergeant@virusbtn.com */ /* The logic behind this infofeed is to minimise as far * * as I am able the amount of code that a webmaster * * needs to embed in order to include this on his or her * * page. Thus, the main subroutine is contained here, * * and is called from the requesting page with arguments * * rather than being included on the webmasters' sites */ /* It is, however, worth pointing out that a webmaster, * * if they were paying attention, could lift & rename * * the draw table function, and then just use prevtable * * to create their own version of this. */ // Data Starts Here. This part is auto-generated or // something. var month_year = "March 2008"; var prevtable = new Array(); prevtable[0] = new Array('NetSky', 'Worm', '22.16 ', '' ); prevtable[1] = new Array('Mytob', 'Worm', '8.41 ', '' ); prevtable[2] = new Array('Virut', 'Virus', '4.36 ', '' ); prevtable[3] = new Array('Mydoom', 'Worm', '4.35 ', '' ); prevtable[4] = new Array('Bagle', 'Worm', '3.65 ', '' ); prevtable[5] = new Array('Zafi', 'Worm', '2.27 ', '' ); prevtable[6] = new Array('Agent', 'Trojan', '1.73 ', '' ); prevtable[7] = new Array('Small', 'Trojan', '1.50 ', '' ); prevtable[8] = new Array('Stration/Warezov', '', '1.06 ', '' ); prevtable[9] = new Array('Grew', 'Worm', '1.03 ', '' ); // This is the bad-boy function itself function draw_table (type_flag, number_flag, percent_flag, number_wanted, border, width) { // Let's make sure number_wanted is vaguely sane, // and if it ain't, we'll *make* it sane. // Let's get rounded, baby var clean_number = Math.abs(parseInt(number_wanted)); // Get into *my* bounds.... if (clean_number > 10) { clean_number = 10; } if (clean_number < 1) { clean_number = 1; } // Introduce some other sanity... var clean_tf = parseInt(type_flag); var clean_nf = parseInt(number_flag); var clean_pf = parseInt(percent_flag); // We made it this far, honey. Time to get loopin', // and trippin', and create some mad phat HTML... // First lets make something to store this all in var output_html = ""; // We need table headers... var column_count = 1; // This calculates how many header cells we'll need if (clean_tf) {column_count++} if (clean_nf) {column_count++} if (clean_pf) {column_count++} output_html += ""; output_html += ""; // Type Header if (clean_tf) { output_html += ""; } // Instances Header // if (clean_nf) { // output_html += ""; // } // Percentage Header if (clean_pf) { output_html += ""; } output_html += ""; // Timely info... :) //prevtable[clean_number] = new Array('W32/Bugbear', 'File', 'New', 'New', 'bugbear.xml'); //clean_number = clean_number + 1; // Let's roll... for (count = 0; count < clean_number; count++) { // This lets us do something every 2nd line... var row_number = count % 2; row_number++; output_html += ""; // Name it output_html += ""; // Type it if (clean_tf) { output_html += ""; } // Number it // if (clean_nf) { // output_html += ""; // } // Peruse it if (clean_pf) { output_html += ""; } output_html += ""; } // Information... output_html += ""; return output_html + "
"; output_html += "Top Malware during "+month_year; output_html += "
Malware family"; output_html += "Type"; output_html += ""; // output_html += "Instances"; // output_html += ""; output_html += "Percentage"; output_html += "
"; output_html += ""; } else { output_html += "index.xml'>"; } output_html += prevtable[count][0]; output_html += ""; output_html += prevtable[count][1]; output_html += ""; // output_html += prevtable[count][2]; // output_html += ""; output_html += prevtable[count][2]; output_html += " %
"; }