/alexa

Golang Alexa Ranking

Primary LanguageGoMIT LicenseMIT

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 )