TE
科技回声
首页
24小时热榜
最新
最佳
问答
展示
工作
中文
GitHub
Twitter
首页
Simple PHP Algorithm to Get Wikipedia Hits
1 点
作者
Jagadeesh1210
超过 11 年前
<?php //Algorithm for WikiStats<p>while(1) { echo "<i></i><i>Welcome to Wikistats</i><i></i>\n"; echo "Enter the Keyword ....\n"; $var = fgets(STDIN); //echo $var; $var=str_replace(' ','_',$var); $day=date("d"); $rurl="curl 'http://stats.grok.se/en/".date("Y").date("m")."/".$var."' | grep 'has been'"; //$data=system("curl 'http://stats.grok.se/en/201312/india' | grep 'has been'"); $data=system($rurl); $split = explode(" ", $data); $rcount=$split[count($split)-1];<p>echo "\n\n-------------------------------------------"; echo "\nWiki Statasticts for Keyword :: ".$var; echo "\nPresentMonthHits -> ".$rcount."\n\n"; echo "AverageDayHits -> ".$rcount/$day."\n\n"; echo "-------------------------------------------\n"; } ?>
暂无评论
暂无评论