Skip to main content

Powershell: How to get alexa rank for a specific domain

Get alexa rank for practicehabits.net with powershell
Get alexa rank for practicehabits.net with powershell

http://data.alexa.com/data?cli=10&url=practicehabits.net


# Description: Get alexa rank for a specific $domain
# Created by:  Tuyen Dang
# Created on: 20160319
# Last modified by:
# Last modified on:
# History:

$domain = "practicehabits.net"
$LogDir = "C:\Temp\"
$url = "http://data.alexa.com/data?cli=10&url=" + $domain
# $start_time = Get-Date
$TodayLong = $todaylong = get-date -Format yyyyMMddHHmmss

$output = $LogDir + "alexa-" + $domain + "-" + $TodayLong + ".xml"

Invoke-WebRequest -Uri $url -OutFile $output

# Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
# End of script



Result

<?xml version="1.0" encoding="UTF-8"?>

<!-- Need more Alexa data?  Find our APIs here: https://aws.amazon.com/alexa/ -->
<ALEXA VER="0.9" URL="practicehabits.net/" HOME="0" AID="=" IDN="practicehabits.net/">
<SD>
<POPULARITY URL="practicehabits.net/" TEXT="910023" SOURCE="panel"/>
<REACH RANK="1218397"/>
<RANK DELTA="-6994944"/>
<COUNTRY CODE="VN" NAME="Vietnam" RANK="13934"/>
</SD>
</ALEXA>

Popular posts from this blog

Check and install php7.0-mbstring extention on Ubuntu 16.04 and Microsoft Windows

While learning Facebook SDK for PHP I overlooked one of system requirements preventing my code from running on my host. That is The mbstring extension. Facebook SDK for PHP's system requirements Check if mbstring is enabled root@ubuntu001:~# php -a Interactive mode enabled php > echo extension_loaded('mbstring'); php >exit root@ubuntu001:~# apt-cache search php7 | grep mbstring php7.0-mbstring - MBSTRING module for PHP root@ubuntu001:~# Install php7.0-mbstring root@ubuntu001:~# apt-get install php7.0-mbstring Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required:   fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0   libjpeg-turbo8 libjpeg8 libmcrypt4 libtiff5 libvpx3 libxpm4 Use 'apt autoremove' to remove them. The following additional packages will be installed:   libapache2-mod-php7.0 php7.0-cli ph...

Powershell: Test-NetConnection

PS C:\Users\tuyen> get-help Test-NetConnection NAME     Test-NetConnection SYNTAX     Test-NetConnection [[-ComputerName] <string>] [-TraceRoute] [-Hops <int>] [-InformationLevel {Quiet |     Detailed}]  [<CommonParameters>]     Test-NetConnection [[-ComputerName] <string>] [-CommonTCPPort] {HTTP | RDP | SMB | WINRM}     [-InformationLevel {Quiet | Detailed}]  [<CommonParameters>]     Test-NetConnection [[-ComputerName] <string>] -Port <int> [-InformationLevel {Quiet | Detailed}]     [<CommonParameters>]     Test-NetConnection [[-ComputerName] <string>] -DiagnoseRouting [-ConstrainSourceAddress <string>]     [-ConstrainInterface <uint32>] [-InformationLevel {Quiet | Detailed}]  [<CommonParameters>] ALIASES     TNC REMARKS     Get-Help cannot find the Help files fo...