Changeset 374

Show
Ignore:
Timestamp:
04/28/08 21:14:22 (3 weeks ago)
Author:
t-bone
Message:

Refs #95

  • Add Gigablast cache
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • extension/resurrect/content/netError.xhtml

    r372 r374  
    323323          image='chrome://resurrect/skin/cacheicons/msn.png' 
    324324        /> 
     325        <xul:button 
     326          value='gigablast' label=' &resurrect.gigablast;' 
     327          image='chrome://resurrect/skin/cacheicons/gigablast.png' 
     328        /> 
    325329      </fieldset> 
    326330 
  • extension/resurrect/content/resurrect-select-mirror.xul

    r373 r374  
    4949        image='chrome://resurrect/skin/cacheicons/msn.png' 
    5050    /> 
     51    <button 
     52        value='gigablast' label=' &resurrect.gigablast;' 
     53        image='chrome://resurrect/skin/cacheicons/gigablast.png' 
     54    /> 
    5155    </vbox> 
    5256 
  • extension/resurrect/content/resurrect.js

    r372 r374  
    117117        var gotoUrl=null; 
    118118        var encUrl=encodeURIComponent(rawUrl); 
     119        var xmlUrl=rawUrl.replace('&', '&amp;'); 
    119120 
    120121        switch (mirror) { 
     
    150151            break; 
    151152        case 'msn': 
    152             var xmlUrl=rawUrl.replace('&', '&amp;'); 
    153153            var soapBody='<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:Search xmlns:ns1="http://testuri.org"><Request><AppID xsi:type="xsd:string">FD382E93B5ABC456C5E34C238A906CAB2DEEB5D6</AppID><Query xsi:type="xsd:string">'+xmlUrl+'</Query><CultureInfo xsi:type="xsd:string">en-US</CultureInfo><SafeSearch xsi:type="xsd:string">Off</SafeSearch><Requests><SourceRequest><Source xsi:type="xsd:string">Web</Source><Offset xsi:type="xsd:int">0</Offset><Count xsi:type="xsd:int">1</Count><ResultFields xsi:type="xsd:string">All</ResultFields></SourceRequest></Requests></Request></ns1:Search></SOAP-ENV:Body></SOAP-ENV:Envelope>'; 
    154154 
     
    164164            } catch (e) { 
    165165                gotoUrl='http://search.msn.com/results.aspx?q='+encUrl; 
     166            } 
     167 
     168            break; 
     169        case 'gigablast': 
     170            var apiUrl=[ 
     171                    'http://feed.gigablast.com/search', 
     172                    '?q=', encUrl, 
     173                    '&site=', (rawUrl.match(/:\/\/([^/]+)/)[1]), 
     174                    '&n=1&ns=0&raw=9&bq=0&nrt=0' 
     175                ].join(''); 
     176 
     177            var xhr=new XMLHttpRequest(); 
     178            xhr.open('GET', apiUrl, false); 
     179            xhr.send(null); 
     180 
     181            try { 
     182                var docId=xhr.responseXML 
     183                    .getElementsByTagName('docId')[0].textContent; 
     184                gotoUrl='http://www.gigablast.com/index.php' 
     185                    +'?page=get&ih=1&ibh=1&cas=0&d=' 
     186                    +docId; 
     187            } catch (e) { 
     188                gotoUrl='http://www.gigablast.com/index.php?q='+encUrl; 
    166189            } 
    167190 
  • extension/resurrect/locale/en-US/overlay.dtd

    r372 r374  
    1111<!ENTITY resurrect.archive "The Internet Archive"> 
    1212<!ENTITY resurrect.msn "Live Search (MSN) Cache"> 
     13<!ENTITY resurrect.gigablast "Gigablast Cache"> 
    1314<!ENTITY resurrect.inCurrTab "In the current tab/window"> 
    1415<!ENTITY resurrect.inNewTab "In a new tab">