
![]() |
jsp123
Save as urls.
php. Be safe, don't change the sleep time![]() ![]() <? phpfunction doRequest($method, $url, $referer, $vars) { set_time_limit(0); $method = strtoupper(trim($method)); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); if($referer){ curl_setopt($ch, CURLOPT_REFERER, $referer); } curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookiejar'); //curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookiejar'); if ($method == 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); } $data = curl_exec($ch); curl_close($ch); if ($data) { return $data; } else { return curl_error($ch); } } function get($url, $referer) { return doRequest('GET', $url, $referer, 'NULL'); } function post($url, $referer, $vars) { return doRequest('POST', $url, $referer, $vars); } function getbacklink($domain){ $page = get("http://siteexplorer.search.yahoo.com/advsearch?p=http%3A%2F%2F$domain&bwm=i&bwmo=&bwmf=s", ""); return $page; } function blstats($list){ echo "<div id="results">"; echo "<ul> "; foreach($list as $l){ sleep(2); $bl = getbacklink($l); preg_match("#of about <strong>(.*?)</strong>#", $bl, $match); $count = $match[1]; echo "<li class="domain">$l</li><li class="backlinks">$count</li> "; flush(); } echo "</ul> "; echo "</div> "; } function array_trim(&$value) { $value = trim($value," hv "); } $style = "#form{width: 275px; background: #ececec; padding: 0 30px 30px 30px; float: left;} #results{float: left; display: block;} ul{list-style: none;} li{padding:10px; border-bottom: #ccc 1px solid;} li.domain{float: left;width: 200px;} li.backlinks{font-weight:bold;} h3{margin: 0 0 0 30px; font-size: 32px; color: #ccc;} #form h3{color: #666; font-size: 18px; margin: 5px;} #form h3 span{color: #ff0000; font-size: 12px;}"; echo "<style>$style</style>"; echo "<h3>Mass Backlink Checker</h3> <ul> "; echo "<div id="form"> <form action="urls. php" method="POST"><h3>List domains below <span class="notice">(one per line)</span></h3> <textarea name="list" cols="30" rows="35">digg.com ebay.com</textarea><br /> <input name="submit" type="submit" value="sumbit"> </form></div>"; if(trim($_REQUEST['list'])){ $rlist = trim($_REQUEST['list']); $rlist = str_replace(" ", " ", str_replace(" ", " ", $rlist)); $list = explode(" ", $rlist); //var_dump($fruit); array_walk($list, 'array_trim'); blstats($list); } else { echo "<div id="results"><span id="error">Please Enter Some Domains</span></div>"; } ?> perkiset
Good stuff JSP, thanks!
/p m0nkeymafia
I like things like this cos it spurs you on to reuse the code
|

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads