1/********************************************************************* 2 * #### jQuery Awesome Sosmed Share Button / AyoShare.js v17 #### 3 * Coded by Ican Bachors 2014. 4 * https://github.com/bachors/jQuery-Awesome-Sosmed-Share-Button 5 * Updates will be posted to this site. 6 *********************************************************************/ 7jQuery.fn.ayoshare = function(opt) { 8 var defaultopt = { 9 counter: false, 10 button: { 11 google: false, 12 stumbleupon: false, 13 facebook: false, 14 linkedin: false, 15 pinterest: false, 16 bufferapp: false, 17 reddit: false, 18 vk: false, 19 pocket: false, 20 twitter: false, 21 flipboard: false, 22 digg: false, 23 email: false, 24 whatsapp: false, 25 telegram: false, 26 viber: false, 27 line: false, 28 bbm: false, 29 sms: false 30 } 31 }; 32 opt.counter = (opt.counter == undefined ? defaultopt.counter : opt.counter); 33 opt.button.google = (opt.button.google == undefined ? defaultopt.button.google : opt.button.google); 34 opt.button.stumbleupon = (opt.button.stumbleupon == undefined ? defaultopt.button.stumbleupon : opt.button.stumbleupon); 35 opt.button.facebook = (opt.button.facebook == undefined ? defaultopt.button.facebook : opt.button.facebook); 36 opt.button.linkedin = (opt.button.linkedin == undefined ? defaultopt.button.linkedin : opt.button.linkedin); 37 opt.button.pinterest = (opt.button.pinterest == undefined ? defaultopt.button.pinterest : opt.button.pinterest); 38 opt.button.bufferapp = (opt.button.bufferapp == undefined ? defaultopt.button.bufferapp : opt.button.bufferapp); 39 opt.button.reddit = (opt.button.reddit == undefined ? defaultopt.button.reddit : opt.button.reddit); 40 opt.button.vk = (opt.button.vk == undefined ? defaultopt.button.vk : opt.button.vk); 41 opt.button.pocket = (opt.button.pocket == undefined ? defaultopt.button.pocket : opt.button.pocket); 42 opt.button.twitter = (opt.button.twitter == undefined ? defaultopt.button.twitter : opt.button.twitter); 43 opt.button.flipboard = (opt.button.flipboard == undefined ? defaultopt.button.flipboard : opt.button.flipboard); 44 opt.button.digg = (opt.button.digg == undefined ? defaultopt.button.digg : opt.button.digg); 45 opt.button.email = (opt.button.email == undefined ? defaultopt.button.email : opt.button.email); 46 opt.button.whatsapp = (opt.button.whatsapp == undefined ? defaultopt.button.whatsapp : opt.button.whatsapp); 47 opt.button.telegram = (opt.button.telegram == undefined ? defaultopt.button.telegram : opt.button.telegram); 48 opt.button.viber = (opt.button.viber == undefined ? defaultopt.button.viber : opt.button.viber); 49 opt.button.line = (opt.button.line == undefined ? defaultopt.button.line : opt.button.line); 50 opt.button.bbm = (opt.button.bbm == undefined ? defaultopt.button.bbm : opt.button.bbm); 51 opt.button.sms = (opt.button.sms == undefined ? defaultopt.button.sms : opt.button.sms); 52 var ua = navigator.userAgent; 53 jQuery(this).each(function(i, d) { 54 var b = jQuery(this).data('ayoshare'), 55 html = ''; 56 var c = (jQuery(this).attr('id') != null && jQuery(this).attr('id') != undefined ? '#' + jQuery(this).attr('id') : '.' + jQuery(this).attr('class')); 57 if (opt.button.facebook) { 58 html += '<div class="facebook button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'facebook\');" title="Facebook">'; 59 if(opt.counter){ 60 html += '<i class="icon"><i class="fa fa-facebook"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 61 ayo_facebook(b, c, i); 62 }else{ 63 html += '<i class="mobile"><i class="fa fa-facebook"></i></i></a></div>'; 64 } 65 } 66 if (opt.button.reddit) { 67 html += '<div class="reddit button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'reddit\');" title="Reddit">'; 68 if(opt.counter){ 69 html += '<i class="icon"><i class="fa fa-reddit"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 70 ayo_reddit(b, c, i); 71 }else{ 72 html += '<i class="mobile"><i class="fa fa-reddit"></i></i></a></div>'; 73 } 74 } 75 if (opt.button.linkedin) { 76 html += '<div class="linkedin button' + (opt.counter ? '' : ' small') + '">
76<a onclick="ayo_share_og(\'' + b + '\', \'linkedin\');" title="Linkedin">'; 77 if(opt.counter){ 78 html += '<i class="icon"><i class="fa fa-linkedin"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 79 ayo_linkedin(b, c, i); 80 }else{ 81 html += '<i class="mobile"><i class="fa fa-linkedin"></i></i></a></div>'; 82 } 83 } 84 if (opt.button.pinterest) { 85 html += '<div class="pinterest button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'pinterest\');" title="Pinterest">'; 86 if(opt.counter){ 87 html += '<i class="icon"><i class="fa fa-pinterest"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 88 ayo_pinterest(b, c, i); 89 }else{ 90 html += '<i class="mobile"><i class="fa fa-pinterest"></i></i></a></div>'; 91 } 92 } 93 if (opt.button.stumbleupon) { 94 html += '<div class="stumbleupon button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'stumbleupon\');" title="Stumbleupon">'; 95 if(opt.counter){ 96 html += '<i class="icon"><i class="fa fa-stumbleupon"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 97 ayo_stumbleupon(b, c, i); 98 }else{ 99 html += '<i class="mobile"><i class="fa fa-stumbleupon"></i></i></a></div>'; 100 } 101 } 102 if (opt.button.bufferapp) { 103 html += '<div class="bufferapp button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'bufferapp\');" title="Bufferapp">'; 104 if(opt.counter){ 105 html += '<i class="icon"><i class="fa fa-bufferapp"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 106 ayo_bufferapp(b, c, i); 107 }else{ 108 html += '<i class="mobile"><i class="fa fa-bufferapp"></i></i></a></div>'; 109 } 110 } 111 if (opt.button.vk) { 112 html += '<div class="vk button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'vk\');" title="VK">'; 113 if(opt.counter){ 114 html += '<i class="icon"><i class="fa fa-vk"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 115 ayo_vk(b, c, i); 116 }else{ 117 html += '<i class="mobile"><i class="fa fa-vk"></i></i></a></div>'; 118 } 119 } 120 if (opt.button.pocket) { 121 html += '<div class="pocket button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'pocket\');" title="Pocket">'; 122 if(opt.counter){ 123 html += '<i class="icon"><i class="fa fa-get-pocket"></i></i><div class="counter"><p><i class="fa fa-spinner fa-spin"></i></p></div></a></div>'; 124 ayo_pocket(b, c, i); 125 }else{ 126 html += '<i class="mobile"><i class="fa fa-get-pocket"></i></i></a></div>'; 127 } 128 } 129 if (opt.button.google) { 130 html += '<div class="google button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'google\');" title="Google+">'; 131 html += '<i class="mobile"><i class="fa fa-google-plus"></i></i></a></div>'; 132 } 133 if (opt.button.twitter) { 134 html += '<div class="twitter button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'twitter\');" title="Twitter">'; 135 html += '<i class="mobile"><i class="fa fa-twitter"></i></i></a></div>'; 136 } 137 if (opt.button.flipboard) { 138 html += '<div class="flipboard button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'flipboard\');" title="Flipboard">'; 139 html += '<i class="mobile"><i class="fa fa-flipboard"></i></i></a></div>' 140 } 141 if (opt.button.digg) { 142 html += '<div class="digg button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'digg\');" title="Digg">'; 143 html += '<i class="mobile"><i class="fa fa-digg"></i></i></a></div>' 144 } 145 if (opt.button.email) { 146 html += '<div class="email button' + (opt.counter ? '' : ' small') + '">
146<a onclick="ayo_share_og(\'' + b + '\', \'email\');" title="Email">'; 147 html += '<i class="mobile"><i class="fa fa-envelope"></i></i></a></div>'; 148 } 149 if(ua.match(/mobile/i)){ 150 if (opt.button.whatsapp) { 151 html += '<div class="whatsapp button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'whatsapp\');" title="Whatsapp">'; 152 html += '<i class="mobile"><i class="fa fa-whatsapp"></i></i></a></div>'; 153 } 154 if (opt.button.telegram) { 155 html += '<div class="telegram button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'telegram\');" title="Telegram">'; 156 html += '<i class="mobile"><i class="fa fa-telegram"></i></i></a></div>'; 157 } 158 if (opt.button.viber) { 159 html += '<div class="viber button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'viber\');" title="Viber">'; 160 html += '<i class="mobile"><i class="fa fa-volume-control-phone"></i></i></a></div>'; 161 } 162 if (opt.button.line) { 163 html += '<div class="line button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'line\');" title="Line">'; 164 html += '<i class="mobile"><i class="fa fa-line"></i></i></a></div>'; 165 } 166 if (opt.button.bbm) { 167 html += '<div class="bbm button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'bbm\');" title="BBM">'; 168 html += '<i class="mobile"><i class="fa fa-bbm"></i></i></a></div>'; 169 } 170 if (opt.button.sms) { 171 html += '<div class="sms button' + (opt.counter ? '' : ' small') + '"><a onclick="ayo_share_og(\'' + b + '\', \'sms\');" title="SMS">'; 172 html += '<i class="mobile"><i class="fa fa-comment"></i></i></a></div>'; 173 } 174 } 175 jQuery(this).html('<div class="ayoshare">' + html + '</div>'); 176 }); 177 178 function ayo_bufferapp(c, d, z) { 179 jQuery.ajax({ 180 url: 'https://api.bufferapp.com/1/links/shares.json?url=' + encodeURIComponent(c), 181 crossDomain: true, 182 dataType: 'jsonp' 183 }).done(function(a) { 184 var b = ayo_num(a.shares); 185 jQuery(d + ':eq(' + z + ') .ayoshare .bufferapp .counter p').html(b); 186 }).fail(function() { 187 jQuery(d + ':eq(' + z + ') .ayoshare .bufferapp .counter p').html(0); 188 189 }) 190 } 191 192 function ayo_facebook(c, d, z) { 193 jQuery.ajax({ 194 url: 'https://graph.facebook.com/v2.7/?id=' + encodeURIComponent(c) + '&access_token=443213172472393|l2IEt1tuyYta_278fR5NAg8V1jI', 195 crossDomain: true, 196 dataType: 'jsonp' 197 }).done(function(a) { 198 var b = ayo_num(a.share.share_count); 199 jQuery(d + ':eq(' + z + ') .ayoshare .facebook .counter p').html(b); 200 }).fail(function() { 201 jQuery(d + ':eq(' + z + ') .ayoshare .facebook .counter p').html(0); 202 203 }) 204 } 205 206 function ayo_linkedin(c, d, z) { 207 jQuery.ajax({ 208 url: 'https://www.linkedin.com/countserv/count/share?url=' + encodeURIComponent(c) + '&callback=?', 209 crossDomain: true, 210 dataType: 'json' 211 }).done(function(a) { 212 var b = ayo_num(a.count); 213 jQuery(d + ':eq(' + z + ') .ayoshare .linkedin .counter p').html(b); 214 }).fail(function() { 215 jQuery(d + ':eq(' + z + ') .ayoshare .linkedin .counter p').html(0); 216 217 }) 218 } 219 220 function ayo_pinterest(c, d, z) { 221 jQuery.ajax({ 222 url: 'https://api.pinterest.com/v1/urls/count.json?url=' + encodeURIComponent(c) + '&callback=?', 223 crossDomain: true, 224 dataType: 'json' 225 }).done(function(a) { 226 var b = ayo_num(a.count); 227 jQuery(d + ':eq(' + z + ') .ayoshare .pinterest .counter p').html(b); 228 }).fail(function() { 229 jQuery(d + ':eq(' + z + ') .ayoshare .pinterest .counter p').html(0); 230 231 }) 232 } 233 234 function ayo_vk(f, g, z) { 235 jQuery.ajax({ 236 type: "GET", 237 dataType: "xml", 238 url: "https://query.yahooapis.com/v1/public/yql", 239 data: { 240 q: "SELECT content FROM data.headers WHERE url=\"http://vk.com/share.php?act=count&index=1&url=" + encodeURIComponent(f) + "\" and ua=\"#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36\"", 241 format: "xml", 242 env: "store://datatables.org/alltableswithkeys" 243 } 244 }).done(function(a) { 245 var b = jQuery(a).find("content").text(); 246 var c = b.split(","); 247 var d = c[1].split(")"); 248 var e = ayo_num(d[0]); 249 jQuery(g + ':eq(' + z + ') .ayoshare .vk .counter p').html(e); 250 }).fail(function() { 251 jQuery(g + ':eq(' + z + ') .ayoshare .vk .counter p').html(0); 252 253 }) 254 } 255 256 function ayo_reddit(d, e, z) { 257 jQuery.ajax({ 258 url: 'https://www.reddit.com/api/info.json?url=' + encodeURIComponent(d), 259 crossDomain: true, 260 dataType: 'json' 261 }).done(function(a) { 262 var b = (a.data.children != null) ? a.data.children.length : 0; 263 var c = (b == 25) ? 25 + '+' : b; 264 jQuery(e + ':eq(' + z + ') .ayoshare .reddit .counter p').html(c); 265 }).fail(function() { 266 jQuery(e + ':eq(' + z + ') .ayoshare .reddit .counter p').html(0); 267 268 }) 269 } 270 271 function ayo_stumbleupon(e, f, z) { 272 jQuery.ajax({ 273 type: "GET", 274 dataType: "xml", 275 url: "https://query.yahooapis.com/v1/public/yql", 276 data: { 277 q: "SELECT content FROM data.headers WHERE url=\"http://www.stumbleupon.com/services/1.01/badge.getinfo?url=" + encodeURIComponent(e) + "\" and ua=\"#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36\"", 278 format: "xml", 279 env: "store://datatables.org/alltableswithkeys" 280 } 281 }).done(function(a) { 282 var b = jQuery(a).find("content").text(); 283 var c = b.match(/views\":([0-9]+),/i); 284 var d = (c !== null) ? ayo_num(c[1]) : 0; 285 jQuery(f + ':eq(' + z + ') .ayoshare .stumbleupon .counter p').html(d); 286 }).fail(function() { 287 jQuery(f + ':eq(' + z + ') .ayoshare .stumbleupon .counter p').html(0); 288 289 }) 290 } 291 292 function ayo_pocket(e, f, z) { 293 jQuery.ajax({ 294 type: "GET", 295 dataType: "xml", 296 url: "https://query.yahooapis.com/v1/public/yql", 297 data: { 298 q: "SELECT content FROM data.headers WHERE url=\"https://widgets.getpocket.com/v1/button?label=pocket&count=horizontal&v=1&url=" + encodeURIComponent(e) + "\" and ua=\"#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36\"", 299 format: "xml", 300 env: "store://datatables.org/alltableswithkeys" 301 } 302 }).done(function(a) { 303 var b = jQuery(a).find("content").text(); 304 var c = b.match(/<em\sid=\"cnt\">([0-9]+)<\/em>/i); 305 var d = (c !== null) ? ayo_num(c[1]) : 0; 306 jQuery(f + ':eq(' + z + ') .ayoshare .pocket .counter p').html(d); 307 }).fail(function() { 308 jQuery(f + ':eq(' + z + ') .ayoshare .pocket .counter p').html(0); 309 310 }) 311 } 312 313 function ayo_num(a) { 314 var b = parseInt(a, 10); 315 if (b === null) { 316 return 0; 317 } 318 if (b >= 1000000000) { 319 return (b / 1000000000).toFixed(1).replace(/\.0jQuery/, "") + "g"; 320 } 321 if (b >= 1000000) { 322 return (b / 1000000).toFixed(1).replace(/\.0jQuery/, "") + "m"; 323 } 324 if (b >= 1000) { 325 return (b / 1000).toFixed(1).replace(/\.0jQuery/, "") + "k"; 326 } 327 return b; 328 } 329 330} 331 332function ayo_share_og(c, s) { 333 var e = new RegExp(location.host); 334 if (window.location.href == c) { 335 var tit = (jQuery(document).attr('title') !== null && jQuery(document).attr('title') !== undefined ? jQuery(document).attr('title') : ''), 336 des = (jQuery('meta[name="description"]').attr("content") != null && jQuery('meta[name="description"]').attr("content") != undefined ? jQuery('meta[name="description"]').attr("content") : ''), 337 img = (jQuery('meta[property="og:image"]').attr("content") != null && jQuery('meta[property="og:image"]').attr("content") != undefined ? jQuery('meta[property="og:image"]').attr("content") : ''); 338 if (s == 'facebook') { 339 window.open('https://www.facebook.com/sharer/sharer.php?u=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left
339=0,top=0'); 340 } else if (s == 'google') { 341 window.open('https://plus.google.com/share?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 342 } else if (s == 'linkedin') { 343 tit = 'EANA'; 344 des = ''; 345 window.open('https://www.linkedin.com/shareArticle?mini=true&url=' + c + '&title=' + tit + '&summary=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 346 } else if (s == 'reddit') { 347 window.open('http://reddit.com/submit?url=' + c + '&title=' + tit + ' - ', '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 348 } else if (s == 'pinterest') { 349 window.open('http://pinterest.com/pin/create/button/?url=' + c + '&media=' + img + '&description=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 350 } else if (s == 'stumbleupon') { 351 window.open('http://www.stumbleupon.com/badge/?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 352 } else if (s == 'bufferapp') { 353 window.open('https://bufferapp.com/add?url=' + c + '&text=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 354 } else if (s == 'vk') { 355 window.open('http://vk.com/share.php?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 356 } else if (s == 'pocket') { 357 window.open('https://getpocket.com/save?title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 358 } else if (s == 'twitter') { 359 tit = 'EANA'; 360 window.open('https://twitter.com/share?text=' + tit + ' - &url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 361 } else if (s == 'flipboard') { 362 window.open('https://share.flipboard.com/bookmarklet/popout?v=2&title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 363 } else if (s == 'digg') { 364 window.open('http://digg.com/submit?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 365 } else if (s == 'whatsapp') { 366 window.location = 'whatsapp://send?text=' + tit + '%20' + c; 367 } else if (s == 'telegram') { 368 window.location = 'tg://msg_url?text=' + tit + '%20' + c; 369 } else if (s == 'viber') { 370 window.location = 'viber://forward?text=' + tit + '%20' + c; 371 } else if (s == 'email') { 372 window.location = 'mailto:?subject=' + tit + '&body=' + des + '%20' + c; 373 } else if (s == 'line') { 374 window.location = 'line://msg/text/' + tit + '%20' + c; 375 } else if (s == 'bbm') { 376 window.location = 'bbmi://api/share?message=' + tit + '%20' + c; 377 } else if (s == 'sms') { 378 window.location = 'sms:?body=' + tit + '%20' + c; 379 } 380 } else if (e.test(c)) { 381 jQuery.ajax({ 382 url: c 383 }).done(function(a) { 384 var tit = (jQuery(a).filter('title').text() != null && jQuery(a).filter('title').text() != undefined ? jQuery(a).filter('title').text() : ''), 385 des = (jQuery(a).filter('meta[name="description"]').attr("content") != null && jQuery(a).filter('meta[name="description"]').attr("content") != undefined ? jQuery(a).filter('meta[name="description"]').attr("content") : ''), 386 img = (jQuery(a).filter('meta[property="og:image"]').attr("content") != null && jQuery(a).filter('meta[property="og:image"]').attr("content") != undefined ? jQuery(a).filter('meta[property="og:image"]').attr("content") : ''); 387 if (s == 'facebook') { 388 window.open('https://www.facebook.com/sharer/sharer.php?u=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left
388=0,top=0'); 389 } else if (s == 'google') { 390 window.open('https://plus.google.com/share?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 391 } else if (s == 'linkedin') { 392 window.open('https://www.linkedin.com/shareArticle?mini=true&url=' + c + '&title=' + tit + '&summary=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 393 } else if (s == 'reddit') { 394 window.open('http://reddit.com/submit?url=' + c + '&title=' + tit + ' - ', '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 395 } else if (s == 'pinterest') { 396 window.open('http://pinterest.com/pin/create/button/?url=' + c + '&media=' + img + '&description=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 397 } else if (s == 'stumbleupon') { 398 window.open('http://www.stumbleupon.com/badge/?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 399 } else if (s == 'bufferapp') { 400 window.open('https://bufferapp.com/add?url=' + c + '&text=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 401 } else if (s == 'vk') { 402 window.open('http://vk.com/share.php?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 403 } else if (s == 'pocket') { 404 window.open('https://getpocket.com/save?title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 405 } else if (s == 'twitter') { 406 window.open('https://twitter.com/share?text=' + tit + ' - &url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 407 } else if (s == 'flipboard') { 408 window.open('https://share.flipboard.com/bookmarklet/popout?v=2&title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 409 } else if (s == 'digg') { 410 window.open('http://digg.com/submit?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 411 } else if (s == 'whatsapp') { 412 window.location = 'whatsapp://send?text=' + tit + '%20' + c; 413 } else if (s == 'telegram') { 414 window.location = 'tg://msg_url?text=' + tit + '%20' + c; 415 } else if (s == 'viber') { 416 window.location = 'viber://forward?text=' + tit + '%20' + c; 417 } else if (s == 'email') { 418 window.location = 'mailto:?subject=' + tit + '&body=' + des + '%20' + c; 419 } else if (s == 'line') { 420 window.location = 'line://msg/text/' + tit + '%20' + c; 421 } else if (s == 'bbm') { 422 window.location = 'bbmi://api/share?message=' + tit + '%20' + c; 423 } else if (s == 'sms') { 424 window.location = 'sms:?body=' + tit + '%20' + c; 425 } 426 }); 427 } else { 428 jQuery.ajax({ 429 type: "GET", 430 dataType: "xml", 431 url: "https://query.yahooapis.com/v1/public/yql", 432 data: { 433 q: "SELECT content FROM data.headers WHERE url=\"" + c + "\" and ua=\"#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36\"", 434 format: "xml", 435 env: "store://datatables.org/alltableswithkeys" 436 } 437 }).done(function(x) { 438 var a = jQuery(x).find("content").text(), 439 tit = (jQuery(a).filter('title').text() != null && jQuery(a).filter('title').text() != undefined ? jQuery(a).filter('title').text() : ''), 440 des = (jQuery(a).filter('meta[name="description"]').attr("content") != null && jQuery(a).filter('meta[name="description"]').attr("content") != undefined ? jQuery(a).filter('meta[name="description"]').attr("content") : ''), 441 img = (jQuery(a).filter('meta[property="og:image"]').attr("content") != null && jQuery(a).filter('meta[property="og:image"]').attr("content") != undefined ? jQuery(a).filter('meta[property="og:image"]').attr("content") : ''); 442 if (s == 'facebook') { 443 window.open('https://www.facebook.com/sharer/sharer.php?u=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left
443=0,top=0'); 444 } else if (s == 'google') { 445 window.open('https://plus.google.com/share?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 446 } else if (s == 'linkedin') { 447 window.open('https://www.linkedin.com/shareArticle?mini=true&url=' + c + '&title=' + tit + '&summary=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 448 } else if (s == 'reddit') { 449 window.open('http://reddit.com/submit?url=' + c + '&title=' + tit + '+-+', '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 450 } else if (s == 'pinterest') { 451 window.open('http://pinterest.com/pin/create/button/?url=' + c + '&media=' + img + '&description=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 452 } else if (s == 'stumbleupon') { 453 window.open('http://www.stumbleupon.com/badge/?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 454 } else if (s == 'bufferapp') { 455 window.open('https://bufferapp.com/add?url=' + c + '&text=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 456 } else if (s == 'vk') { 457 window.open('http://vk.com/share.php?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 458 } else if (s == 'pocket') { 459 window.open('https://getpocket.com/save?title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 460 } else if (s == 'twitter') { 461 window.open('https://twitter.com/share?text=' + tit + '+-+&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 462 } else if (s == 'flipboard') { 463 window.open('https://share.flipboard.com/bookmarklet/popout?v=2&title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 464 } else if (s == 'digg') { 465 window.open('http://digg.com/submit?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 466 } else if (s == 'whatsapp') { 467 window.location = 'whatsapp://send?text=' + tit + '%20' + c; 468 } else if (s == 'telegram') { 469 window.location = 'tg://msg_url?text=' + tit + '%20' + c; 470 } else if (s == 'viber') { 471 window.location = 'viber://forward?text=' + tit + '%20' + c; 472 } else if (s == 'email') { 473 window.location = 'mailto:?subject=' + tit + '&body=' + des + '%20' + c; 474 } else if (s == 'line') { 475 window.location = 'line://msg/text/' + tit + '%20' + c; 476 } else if (s == 'bbm') { 477 window.location = 'bbmi://api/share?message=' + tit + '%20' + c; 478 } else if (s == 'sms') { 479 window.location = 'sms:?body=' + tit + '%20' + c; 480 } 481 }).fail(function() { 482 var tit = (jQuery(document).attr('title') !== null && jQuery(document).attr('title') !== undefined ? jQuery(document).attr('title') : ''), 483 des = (jQuery('meta[name="description"]').attr("content") != null && jQuery('meta[name="description"]').attr("content") != undefined ? jQuery('meta[name="description"]').attr("content") : ''), 484 img = (jQuery('meta[property="og:image"]').attr("content") != null && jQuery('meta[property="og:image"]').attr("content") != undefined ? jQuery('meta[property="og:image"]').attr("content") : ''); 485 if (s == 'facebook') { 486 window.open('https://www.facebook.com/sharer/sharer.php?u=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left
486=0,top=0'); 487 } else if (s == 'google') { 488 window.open('https://plus.google.com/share?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 489 } else if (s == 'linkedin') { 490 window.open('https://www.linkedin.com/shareArticle?mini=true&url=' + c + '&title=' + tit + '&summary=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 491 } else if (s == 'reddit') { 492 window.open('http://reddit.com/submit?url=' + c + '&title=' + tit + ' - ', '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 493 } else if (s == 'pinterest') { 494 window.open('http://pinterest.com/pin/create/button/?url=' + c + '&media=' + img + '&description=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 495 } else if (s == 'stumbleupon') { 496 window.open('http://www.stumbleupon.com/badge/?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 497 } else if (s == 'bufferapp') { 498 window.open('https://bufferapp.com/add?url=' + c + '&text=' + des, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 499 } else if (s == 'vk') { 500 window.open('http://vk.com/share.php?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 501 } else if (s == 'pocket') { 502 window.open('https://getpocket.com/save?title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 503 } else if (s == 'twitter') { 504 window.open('https://twitter.com/share?text=' + tit + ' - &url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 505 } else if (s == 'flipboard') { 506 window.open('https://share.flipboard.com/bookmarklet/popout?v=2&title=' + tit + '&url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 507 } else if (s == 'digg') { 508 window.open('http://digg.com/submit?url=' + c, '', 'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0'); 509 } else if (s == 'whatsapp') { 510 window.location = 'whatsapp://send?text=' + tit + '%20' + c; 511 } else if (s == 'telegram') { 512 window.location = 'tg://msg_url?text=' + tit + '%20' + c; 513 } else if (s == 'viber') { 514 window.location = 'viber://forward?text=' + tit + '%20' + c; 515 } else if (s == 'email') { 516 window.location = 'mailto:?subject=' + tit + '&body=' + des + '%20' + c; 517 } else if (s == 'line') { 518 window.location = 'line://msg/text/' + tit + '%20' + c; 519 } else if (s == 'bbm') { 520 window.location = 'bbmi://api/share?message=' + tit + '%20' + c; 521 } else if (s == 'sms') { 522 window.location = 'sms:?body=' + tit + '%20' + c; 523 } 524 }); 525 } 526}
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.