Help us shape the future of Go! Take the 2026 Go Developer Survey

alexa

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2020 License: MIT Imports: 6 Imported by: 1

README

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 )

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountryRank

func CountryRank(url string) (string, string, string, error)

GlobalRank get Global Rank of website in Alexa It returns country rank in string, country name in string, country code in string and any rank error encountered.

func GlobalRank

func GlobalRank(url string) (string, error)

GlobalRank get Global Rank of website in Alexa It returns global rank in string type and any rank error encountered.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL