Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

negah/alexa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Ranking for go Build Status

Use Alexa public rank api in golang.

Install

go get github.com/negah/alexa

Example

package main

import(
  "github.com/negah/alexa"
  "fmt"
)

func main(){
  url := "google.com"

  globalRank, err := alexa.GlobalRank(url)

  if err != nil {
    fmt.Printf("%s", err)
  } else {
    fmt.Printf("%s rank in alexa is %s\n", url, globalRank)
  }

  countryRank, countryName, _, err := alexa.CountryRank(url)

  if err != nil {
    fmt.Printf("%s", err)
  } else {
    fmt.Printf("%s has rank %s in %s", url, countryRank, countryName )
  }
}

License

MIT

Author

Dariush Abbasi (a.k.a @dariubs )