Documentation ¶
Overview ¶
MozApi project MozApi.go
Index ¶
Constants ¶
View Source
const ( URL_METRICS_PAGE_AUTHORITY = 34359738368 URL_METRICS_DOMAIN_AUTHORITY = 68719476736 URL_METRICS_TIME_LAST_CRAWLED = 144115188075855872 )
Variables ¶
This section is empty.
Functions ¶
func CheckResultError ¶
Since return type of moz api can be: {status:401, error_message:"the error"} or [{pda:82}, {pda:71}] so we need a handler to check if return has error, or has the needed moz data values if no 'error_message', then proceed to extract the moz return data using the ExtractMozData
func ExtractMozData ¶
just convert the json string from moz api call to array of map
func GetURLMetrics ¶
func GetURLMetrics(accessid string, key string, cols uint64, secondsExpire time.Duration, urls []string) ([]byte, error)
Does a http post to the moz api url, with your accessid, secret key, url metrics option, and the urls you want to get url metrics sample call: GetURLMetrics(xxxx, keyxxxx, URL_METRICS_PAGE_AUTHORITY | URL_METRICS_DOMAIN_AUTHORITY, 300, []string{"google.com", "yahoo.com"})
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.