PageSourceSearch

https://vox.news/Javascripts/GetHeadlines.js

js vox.news collected 2026-10-08 20:50:38 UTC 4,311 bytes, 111 lines download raw bytes

1$( window ).load( function ()
2{
3    $( document ).ready( function ()
4    {
5        var url = document.URL;
6        GetShares( url );
7        $( "#Container" ).click( function () { TurnOff(); } );
8        $( '.BtnFacebook' ).click( function () { ShareWindow( 'http://www.facebook.com/sharer/sharer.php?u=' + url ); } );
9        $( '.BtnTwitter' ).click( function () { ShareWindow( 'https://twitter.com/intent/tweet?status=' + document.title + ' - ' + url ); } );
10        $( '.BtnGoogle' ).click( function () { ShareWindow( 'https://plus.google.com/share?url=' + url ); } );
11        $( '.BtnAdd2Any' ).click( function () { ShareWindow( 'http://www.addtoany.com/share_save' ); } );
12        $( '.Shares' ).click( function () { ShareWindow( 'http://www.addtoany.com/share_save' ); } );
13
14        $( "#query" ).focus( function ()
15        {
16            if ( $( '#query' ).val() == "Search" )
17            {
18                $( '#query' ).val( '' )
19            }
20        } );
21
22        $( "#query" ).blur( function ()
23        {
24            if ( $( '#query' ).val() == "" )
25            {
26                $( '#query' ).val( 'Search' )
27            }
28        } );
29    } );
30} );
31
32function ShareWindow( url )
33{
34    var iMyWidth = ( window.screen.width / 2 ) - ( 300 + 10 );
35    var iMyHeight = ( window.screen.height / 2 ) - ( 400 + 50 );
36    shareWindow = window.open( url, 'shareWin', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=450,left=' + iMyWidth + ',top=200' );
37    shareWindow.focus();
38};
39
40function GetShares( url )
41{
42    var fburl = "http://graph.facebook.com/?id=" + url;
43    $.getJSON( fburl, function ( data )
44    {
45        var fbshares = data["shares"];
46        if ( isNaN( fbshares ) )
47        {
48            fbshares = 0;
49        } else
50        {
51            fbshares = data["shares"];
52        }
53        var fbfinalshares = fbshares.toString().replace( /\B(?=(\d{3})+(?!\d))/g, "," );//add comma(s) to final number
54        $( ".Facebook" ).html( 'Facebook (' + fbfinalshares + ')' ); // add to class name so there can be multiple places on a page with this share number
55
56        var twitterurl = 'http://urls.api.twitter.com/1/urls/count.json?url=' + url + '&callback=?';
57        $.getJSON( twitterurl, function ( data )
58        {
59            var twshares = data["count"];
60            var twfinalshares = twshares.toString().replace( /\B(?=(\d{3})+(?!\d))/g, "," );//add comma(s) to final number
61            $( ".Twitter" ).html( 'Twitter (' + twfinalshares + ')' ); // add to class name so there can be multiple places on a page with this share number
62
63            var sumofboth = fbshares + twshares;
64            var subtractnumber = 200;
65            var rawnumber;
66            var resetnumber;
67
68            if ( sumofboth >= subtractnumber )
69            {
70                resetnumber = ( sumofboth - subtractnumber );
71            } else
72            {
73                resetnumber = ( sumofboth - sumofboth );
74            }
75            if ( sumofboth > 0 )
76            {
77                sumofboth = sumofboth + 1;
78                setInterval( function ()
79                {
80                    if ( resetnumber == sumofboth )
81                    {
82                        clearInterval;
83                    } else
84                    {
85                        rawnumber = resetnumber; resetnumber++;
86                    }
87                    rawnumber = rawnumber.toString().replace( /\B(?=(\d{3})+(?!\d))/g, "," );//add comma(s) to final number
88                    $( ".Shares" ).html( '<b>' + rawnumber + '</b><br>Shares' );
89                }, 1.3 )
90            }
91            else
92            {
93                sumofboth = 0;
94                $( ".Shares" ).html( '<b>0</b><br>Shares' ); // add to class name so there can be multiple places on a page with this share number
95            }            
96        } );
97    } );
98};
99
100function SubmitSearch()
101{
102    if ( $( '#SearchInput' ).val() == "Search" )
103    {
104        var searchterm = "";
105    } else
106    {
107        var searchterm = $( '#SearchInput' ).val();
108    }
109    var searchurl = "http://www.goodgopher.com/SearchResults.asp?pr=GG&query=" + searchterm;
110    $( location ).attr( 'href', searchurl );
111};

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.