Jump to content

Recommended Posts

Posted (edited)

Source:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <String.au3>
FileInstall('d:\speedtest-servers.txt', @ScriptDir & '\speedtest-servers-morthawt.txt', 1)
$CC = IPDetails()
$file = FileRead(@ScriptDir & '\speedtest-servers-morthawt.txt')
$sections = _StringBetween($file, '<server value="', '</server>')
$Count = 0
For $a In $sections
    If StringInStr($a, '[' & $CC & ']  -', 1) Then
        $ID = StringSplit($a, '"')[1]
        $Location = StringReplace(StringSplit($a, '">', 1)[2], '</server>', '')
        ConsoleWrite($ID & @CRLF & $Location & @CRLF & @CRLF)
        $Count += 1
        $URL = 'http://www.speedtest.net/?s=' & $ID
        $hPID = ShellExecute('iexplore.exe', $URL, '', '', @SW_MINIMIZE)
        Sleep(65000)
        ProcessClose($hPID)
    EndIf
Next
Func IPDetails()
    $_presource = InetRead('http://freegeoip.net/xml/', 1)
    If @error Then
        SetError(1)
        Return ''
    EndIf
    $_source = BinaryToString($_presource)
    $start = StringInStr($_source, '<CountryCode>', 0, 1) + 13
    $end = StringInStr($_source, '</CountryCode>')
    $CountryCode = StringMid($_source, $start, $end - $start)
    Return $CountryCode
EndFunc   ;==>IPDetails

I have included the compiled script which contains the file with all the speedtest.net servers and ID's in it. I wanted to just get a wide range of servers (all in the UK) to get a good picture of what my speeds are now that I have changed ISP, without having to sit there and click each one visually and probably not remember which blips I had gone over etc. So this will detect your country and load up a minimized IE that will run the test after 10 seconds if you leave it alone, then wait 65 seconds, close IE and open a new one with the next server.

This was a massive time saver for me and I was able to find a great server to do my tests with in the future.

EDIT:

If you are going to use this, for real, make sure you open internet explorer, login with the "Remember me" option and then close IE. That way your test results will be logged on your account so you can trace what got you the highest scores.

speed tester.zip

Edited by Morthawt
Posted (edited)

No news is good or bad news.

 

I didn't test because that website is flagged as being malicious on two separate HOSTS lists I use. Therefore it wouldn't work anyway. If it's trying to determine your IP, then why not use _GetIP()?

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

wow speedtest.net is marked as a bad site? what on earth..

EDIT:

Its not the IP thats needed, its the country code. So I get it from that site. But I had another of my programs that uses that geo site stop working. Turned out the website was down. I am about to try it again manually in my browser to see if it is working again.

Yup, the geoip site is working now. It should work.

Edited by Morthawt
Posted

This site >> freegeoip.net is marked as malicious, not speedtest.net.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Still, that is strange. All it is is a free IP get-location service. I use it with the program to get the 2 digit country code so that the program will only select servers from that country. Pretty useful. I use it on another program to track the general location of people trying to run a gaming clan-only file if they are not an actual member of the clan. It is amazing how many random people end up with your files when you upload them to virustotal and email them to AV companies for whitelisting. Companies from Russia, tech universities in the USA.. I had to build in hardware blocking in the end to prevent constant false "Unauthorized attempt" log entries on my server so that the program will kick them out before creating a log. Kind of annoying really. But I digress. The site is really useful in my opinion (when it's not down..).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...