-
Notifications
You must be signed in to change notification settings - Fork 14
/
google-url-extractor.js
1 lines (1 loc) · 2.11 KB
/
google-url-extractor.js
1
javascript:(function(){output='<html><head><title>Google Search Extractor</title><style type=\'text/css\'>body,table{font-family:Tahoma,Verdana,Segoe,sans-serif;font-size:11px;color:#000}h1,h2,th{color:#405850}th{text-align:left}h2{font-size:11px;margin-bottom:3px}</style></head><body>';output+="<table><tbody><h1>Google%20Search%20Extractor</h1></td></tr></tbody></table>";pageAnchors=document.getElementsByTagName('a');divClasses=document.getElementsByTagName('div');var%20linkcount=0;var%20linkLocation='';var%20linkAnchorText='';output+='<table><th>#</th><th>Enlace</th><th>Titulo</th>';for(i=0;i<pageAnchors.length;i++){if(pageAnchors[i].parentNode.parentNode.getAttribute('class')!='iUh30'){var%20anchorText%20=%20pageAnchors[i].textContent;var%20anchorLink%20=%20pageAnchors[i].href;var%20linkAnchor%20=%20anchorLink%20+%20'\t'+anchorText;var%20anchorID%20=%20pageAnchors[i].id;if(anchorLink!=''){if(anchorLink.match(/^((?!google\.|cache|blogger.com|\.yahoo\.|youtube\.com\/\?gl=|youtube\.com\/results|javascript:|api\.technorati\.com|botw\.org\/search|del\.icio\.us\/url\/check|digg\.com\/search|search\.twitter\.com\/search|search\.yahoo\.com\/search|siteanalytics\.compete\.com|tools\.seobook\.com\/general\/keyword\/suggestions|web\.archive\.org\/web\/|whois\.domaintools\.com|www\.alexa\.com\/data\/details\/main|www\.bloglines\.com\/search|www\.majesticseo\.com\/search\.php|www\.semrush\.com\/info\/|www\.semrush\.com\/search\.php|www\.stumbleupon\.com\/url|wikipedia.org\/wiki\/Special:Search).)*$/i)){if(anchorID.match(/^((?!hdtb_more|hdtb_tls|uh_hl).)*$/i)){linkLocation+=anchorLink+'<br%20/>';linkAnchorText+=anchorText+'<br%20/>';linkcount++;if%20(anchorText%20===%20undefined)%20anchorText%20=%20pageAnchors[i].innerText;output+='<tr>';output+='<td>'+linkcount+'</td>';output+='<td>'+pageAnchors[i].href+'</a></td>';output+='<td>'+anchorText+'</td>';output+='</tr>\n';}}}}}output+='</table><br/><h2>Listado</h2><div>';output+=linkLocation;output+='</div>';with(window.open()){document.write(output);document.close();}})();/*Funciona mejor con https://chrome.google.com/webstore/detail/ginfinity/dgomfdmdnjbnfhodggijhpbmkgfabcmn/related*/