#!/usr/bin/perl ################################################################ # DO NOT EDIT ANYTHING BELOW # ################################################################ ################################################################ # TITLE: Popularity # # VERSION: 1.36 # # CREATED ON: August 13, 2000 # # LAST UPDATED: October 22, 2000 # # E-MAIL: support@cgibiz.com # # WEB SITE: http://www.cgibiz.com # ################################################################ # COPYRIGHT (C) 2000 ARVYDAS STRAUSAS. ALL RIGHTS RESERVED # ################################################################ # Copyright Notice # # ---------------- # # This script can be freely used and distributed, but any # # modification of it without the written consent of Arvydas # # Strausas is strictly prohibited. Copying any of the code # # contained within this script and claiming it as your own is # # also prohibited. You may not remove any of these header # # notices. By using this code you agree to indemnify author # # from any liability that might arise from it's use. # ################################################################ use integer;use cg;use Socket;cg::content_type("text/html");$cg::params{"version"}=de("Qpxfsfe!cz!=b!ubshfu>`cmbol!isfg>#iuuq;00xxx/dhjcj{/dpn#?Qpqvmbsjuz!2/47=0b?");my$url=$cg::params{"url"};$url=~s/http:\/\///os;$url=cg::escape($url);my$template="form";my@report;my$i;my$s;my@engines=("AltaVista","www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=link%3A\$url+-+host%3A\$url&search=Search"," pages found.","Details","Google","www.google.com/search?q=link%3A\$url",". ","Details","HotBot","hotbot.lycos.com/?MT=http%3A%2F%2F\$url&submit=SEARCH&SM=url&DV=0&RG=all&RD=RG&DC=10&DE=2&_v=2&OPs=MDRTP","","Details","Infoseek","www.go.com/Split?qt=link%3A\$url+-site%3A\$url&sv=IS&lk=noframes&pat=go"," matches","Details","Lycos","lycospro.lycos.com/srchpro/?aloc=sb_init_mylink&first=1&lpv=1&type=advwebsites&query=&t=all&mlu=\$url&mli=&mle=&x=0&y=0"," web","Details");if($url){my$ur;my$popularity;my$content;for($i=0;$i<@engines;$i+=4){if(!$cg::params{$engines[$i]}){next;}$ur=$engines[$i+1];$ur=~s/\$url/$url/gs;if($content=http_request($ur)){if($engines[$i]=~/hotbot/ios){my$j=index($content," than ");my$k;my$l;if($j>0){$k=rindex($content,">",$j)+1;$l=index($content,"<",$j);}else{$j=index($content," matches ");$j=index($content," Matches ")if$j<0;$k=rindex($content,">",$j)+1;$l=$j;}$popularity=substr($content,$k,$l-$k);$popularity=~s/ / /gios;}else{$content=~/([0123456789,]+)$engines[$i + 2]/i;$popularity=$1;}if(length($popularity)<128){$ur=$engines[$i+3];$ur=~s/\$url/$url/gs;my@ar=($engines[$i],$popularity,$ur);push(@report,\@ar);}}}$template="report";}open(TEMPLATE,"templates/$template.html")or error("templates/$template.html");while(defined($s=