Tải bản đầy đủ - 0 (trang)
Hack 78. Find Links to Any Web Site

Hack 78. Find Links to Any Web Site

Tải bản đầy đủ - 0trang

bookmarklet.

ThishackusesJavaScripttogettheURLofthecurrentpage

you'reviewinginyourbrowser.Fromthere,itpassestheURLto

aserver-sidescriptthatassemblestheproperYahoo!queryand

fetchesthetop10resultswithYahoo!SearchWebServices.A

newpop-upwindowwillgiveaquicklookatwhichsitesare

linkingtothecurrentpage,withoutleavingyourplace.



5.3.1.TheCode

Thefirstpartofthishackisaserver-sidescriptthatretrieves

thesearchresultsandformatsthemfordisplay.TheHTML

resultwillendupbeinginsertedintoaseparatepop-upbrowser

windowabovethecurrentpage.

ThescriptacceptsaURLwiththequerystringvariableq.From

there,itcreatesaYahoo!SearchWebServicesURLusingthe

speciallink:syntax.

Tocreatethescript,savethefollowingcodetoafilecalled

yl.aspandbesuretoincludeyourownuniqueapplicationIDin

thecode:















































































body{



background-color:#fff;



color:#000;



font-family:verdana,sans-serif;



font-size:11px;



margin:0px;



padding:0px;



border:0px;















































}



li{padding:1px;padding-bottom:2



YahooLinkbacks



























//bringwindowtotop,necessaryforMo





window.focus();



<%















OnErrorResumeNext

Response.Buffer=True

''ExpectingaURLstringtobeinthequerystring"q"

szQ=Request("q")

If(szQ<>"")Then%>






















href="http://search.yahoo.com/search?p=













Linkbacks