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

VMware vCenter: user@vsphere.local password expired - Authentication Failure

SSO log file: C:\ProgramData\VMware\vCenterServer\logs\sso\vmware-sts-idmd.log [2017-10-15T12:19:28.148+07:00 vsphere.local        e18baecc-2ce5-479a-adec-1bcbef603cdb ERROR] [IdentityManager] Failed to authenticate principal [tuyendq@vsphere.local]. User password expired. [2017-10-15T12:19:28.148+07:00 vsphere.local        e18baecc-2ce5-479a-adec-1bcbef603cdb INFO ] [IdentityManager] Authentication failed for user [tuyendq@vsphere.local] in tenant [vsphere.local] in [15] milliseconds with provider [vsphere.local] of type [com.vmware.identity.idm.server.provider.vmwdirectory.VMwareDirectoryProvider] [2017-10-15T12:19:28.148+07:00 vsphere.local        e18baecc-2ce5-479a-adec-1bcbef603cdb ERROR] [ServerUtils] Exception 'com.vmware.identity.idm.PasswordExpiredException: User account expired: {Name: tuyendq, Domain: vsphere.local}' com.vmware.identity.idm.PasswordExpiredException: User account expired: {Name: tuyendq, D...

Linux command: grep - Global Regular Expression Print

grep command grep, egrep, fgrep, rgrep - print lines matching a pattern

Windows Command: arp - Address Resolution Protocol

Notes from daily work situation. While troubleshooting HSRP, I need to delete arp table on my computer. arp -d * Take a look at other options with arp command: C:\Users\Administrator>arp /? Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP). ARP -s inet_addr eth_addr [if_addr] ARP -d inet_addr [if_addr] ARP -a [inet_addr] [-N if_addr] [-v] -a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed. -g Same as -a. -v Displays current ARP entries in verbose mode. All invalid entries and entries on the loop-back interface will be shown. inet_addr Specifies an internet address. -N if_a...