You are not logged in or Registered. Please Login or Register to get rid of this message and the Advertisements on the forum.
SearchMember ListCalendarHelp Hello There, Guest! Register

User(s) Viewing This Thread: 1 Guest(s)
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get the Speed of a Site
03-26-2009, 01:30 AM
Post: #1
Get the Speed of a Site
Time for my next code snippet. This will connect to a url and return the average download speed in kbps and total connection time.

Rep is much appreciated

Code:
<?php

$remoteurl = "http://6ct.info";
function getSiteSpeed($remoteurl) {

$ch = curl_init();

$timeout = '5';

curl_setopt($ch, CURLOPT_URL, $remoteurl);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

$output = curl_exec($ch);

$info = curl_getinfo($ch);

Curl_close($ch);

$data['time'] = $info['total_time'];
$data['speed'] = $info['speed_download']*128/1024;
Return $data;
}
$data = getSiteSpeed('http://google.com');
$speed = $data['speed'];
$time = $data['time'];
Echo "Speed: $speed Kbps <br> \n";
Echo "Total Time: $time Seconds\n";
?>

Hope you guys enjoy this one.

Just about to start work on a GeoIP function that returns the country of a website.

Regards

Regards
FrozenNova - Forum Moderator
PHP, XHTML,CSS Coding Service Available
Find all posts by this user
Quote this message in a reply
03-28-2009, 02:27 PM
Post: #2
RE: Get the Speed of a Site
Thanks, I will try it soon since I'm really busy but I will let you know

[Image: pl-468x60_01.gif]
Find all posts by this user
Quote this message in a reply
03-29-2009, 01:23 AM
Post: #3
RE: Get the Speed of a Site
Thank you very much for the script ;). I am looking forward to the GeoIP one D

Visit this user's website Find all posts by this user
Quote this message in a reply
03-29-2009, 02:26 AM
Post: #4
RE: Get the Speed of a Site
Already launched the GeoIP take a look at the Display Flag for URL thread, it requires the maxmind GeoIP extension to be installed.

Regards
FrozenNova - Forum Moderator
PHP, XHTML,CSS Coding Service Available
Find all posts by this user
Quote this message in a reply
03-29-2009, 07:43 AM
Post: #5
RE: Get the Speed of a Site
How to implement this in proxylistscript next to the proxies? D

Or top proxies & newest proxies?


Greetz

Find all posts by this user
Quote this message in a reply
03-29-2009, 07:49 AM
Post: #6
RE: Get the Speed of a Site
Wouldnt be particularly easy without seeing a copy of the script but if you can zip up a copy of your top site and send it to me I can do it for $5.

Remeber to remember your database files

Regards
FrozenNova - Forum Moderator
PHP, XHTML,CSS Coding Service Available
Find all posts by this user
Quote this message in a reply
09-07-2009, 03:03 AM (This post was last modified: 09-07-2009 03:09 AM by ruben. Edit Reason: )
Post: #7
RE: Get the Speed of a Site
(03-29-2009 02:26 AM)FrozenNova Wrote:  Already launched the GeoIP take a look at the Display Flag for URL thread, it requires the maxmind GeoIP extension to be installed.

Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\www\speed.php on line 14 do i need curl
nvm worked when i uploaded to my host, very nice how can i check multiple ips? leaving a textbox and pointing
$data = getSiteSpeed('http://google.com'); to the textbox? i could do this in vb not in php P
Find all posts by this user
Quote this message in a reply
09-08-2009, 12:27 AM
Post: #8
RE: Get the Speed of a Site
try this
Code:
<?php

$remoteurl = "http://6ct.info,http://google.com";
function getSiteSpeed($remoteurl) {

$ch = curl_init();

$timeout = '5';

curl_setopt($ch, CURLOPT_URL, $remoteurl);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

$output = curl_exec($ch);

$info = curl_getinfo($ch);

Curl_close($ch);

$data['time'] = $info['total_time'];
$data['speed'] = $info['speed_download']*128/1024;
Return $data;
}
foreach ( $remoteurl as $rmurl) {
$data = getSiteSpeed($rmurl);
$speed = $data['speed'];
$time = $data['time'];
Echo "<h3>$rmurl</h3>";
Echo "Speed: $speed Kbps <br> \n";
Echo "Total Time: $time Seconds\n <\ br> <\br>";
}
?>

I've not tested it but basically you use the bottom section of the code as sa foreach loop with an array containing all of the urls you wish to check

Regards
FrozenNova - Forum Moderator
PHP, XHTML,CSS Coding Service Available
Find all posts by this user
Quote this message in a reply
09-08-2009, 06:15 AM
Post: #9
RE: Get the Speed of a Site
@ - FrozenNova, It's great to see you around here again ;).

I am thinking about getting the WebEvader list organized by the speed of the site, this will be very useful thanks )

Visit this user's website Find all posts by this user
Quote this message in a reply
09-08-2009, 07:11 AM
Post: #10
RE: Get the Speed of a Site
Yea I shall be back in the business soon now summer is over

I guess that code snippet works then

Regards
FrozenNova - Forum Moderator
PHP, XHTML,CSS Coding Service Available
Find all posts by this user
Quote this message in a reply

Bookmark
Bookmark to: Mr. Wong Bookmark to: Webnews Bookmark to: Icio Bookmark to: Oneview Bookmark to: Linkarena Bookmark to: Favoriten Bookmark to: Seekxl Bookmark to: Favit Bookmark to: Seoigg Bookmark to: Linksilo Bookmark to: Readster Bookmark to: Folkd Bookmark to: Yigg Bookmark to: Digg Bookmark to: Del.icio.us Bookmark to: Facebook Bookmark to: Reddit Bookmark to: StumbleUpon Bookmark to: Slashdot Bookmark to: Furl Bookmark to: Blinklist Bookmark to: Technorati Bookmark to: Newsvine Bookmark to: Blinkbits
Post Reply 


Forum Jump:

Contact UsWebEvader.orgReturn to TopReturn to ContentLite (Archive) ModeRSS Syndication