awis.au3

License

Author

henry.nosp@m.tejera@gmai.nosp@m.l.com

Description

AutoIT bindings for Alexa Web Information Service (AWIS) API

Summary
awis.au3
Functions
_GetXMLHTTP()Returns an XMLHTTP object
_AWIS_GetURLInfoThe URL Information Action provides information about websites.
_AWIS_CategoryBrowseGet lists of sites within a specific category ordered by traffic rank, or create a browseable directory of websites The CategoryBrowse action provide a directory service based on the Open Directory, www.dmoz.org, and enhanced with Alexa traffic data.
_AWIS_CategoryListingsThe CategoryListings action is a directory service based on the Open Directory, www.dmoz.org.
_AWIS_SitesLinkingInThe Sites Linking In action returns a list of web sites linking to a given web site.
_AWIS_TrafficHistoryThe TrafficHistory action returns the daily Alexa Traffic Rank, Reach per Million Users, and Unique Page Views per Million Users for each day since June 2007.
_AWIS_TopSitesThe TopSites action provides lists of web sites ordered by Alexa Traffic Rank.
_buildQueryParamsBuilds the url for the request to ATS The url will be urlencoded as per RFC 3986 and the uri params will be in alphabetical order
_generateSignatureGenerates an HMAC signature per RFC 2104.
_makeRequestMakes request to AWIS
_parseResponseUrlInfo()Parses XML response from AWIS for UrlInfo action.
_parseResponseCategoryBrowse()Parses XML response from AWIS for CategoryBrowse action.
_parseResponseCategoryListings()Parses XML response from AWIS for CategoryListings action.
_parseResponseSitesLinkingIn()Parses XML response from AWIS for SitesLinkingIn action.
_parseResponseTrafficHistoryParses XML response from AWIS for SitesLinkingIn action.
_parseResponseTopSitesParses XML response from AWIS for TopSites action.
_LogLogging utility that you can use to output messages.
_ErrFuncCOM error hanlder

Functions

_GetXMLHTTP()

Func _GetXMLHTTP()

Returns an XMLHTTP object

Returns

XMLHTTP objectreturns the first object available in the system

_AWIS_GetURLInfo

Func _AWIS_GetURLInfo($Count,  
$ResponseGroup,  
$Start,  
$Url,  
$XMLResponse =  False)

The URL Information Action provides information about websites.  Examples of this information may include data on how popular a site is, sites that are related, and contact information for the owner of a site.

Parameters

$ConuntString number of results (maximum) per page to return.
$ResponseGroupString Response groups allow the user more control over what data is returned.
$StartInt 1-based index of result at which to start
$UrlString Any valid URL.  The URL parameter specifies the URL, host or domain about which you would like to receive information.
$XMLResponseBoolean If True the value returned is the XML response, if False returned a Scripting.Dictionary

_AWIS_CategoryBrowse

Func _AWIS_CategoryBrowse($Count,  
$ResponseGroup,  
$Start,  
$Path,  
$Descriptions =  True,
$XMLResponse =  False)

Get lists of sites within a specific category ordered by traffic rank, or create a browseable directory of websites The CategoryBrowse action provide a directory service based on the Open Directory, www.dmoz.org, and enhanced with Alexa traffic data.

Parameters

$ConuntString number of results (maximum) per page to return.
$ResponseGroupString Response groups allow the user more control over what data is returned.;
$StartInt 1-based index of result at which to start
$PathString Valid category path (Top/Arts, Top/Business/Automotive)
$DescriptionsBoolean indicating whether to return descriptions with categories.  (Default is True)
$XMLResponseBoolean If True the value returned is the XML response, if False returned a Scripting.Dictionary

_AWIS_CategoryListings

Func _AWIS_CategoryListings($Count,  
$ResponseGroup,  
$Start,  
$Path,  
$SortBy =  "Popularity",
$Recursive =  False,
$Descriptions =  True,
$XMLResponse =  False)

The CategoryListings action is a directory service based on the Open Directory, www.dmoz.org.  For any given category, it returns a list of site listings contained within that category.

Parameters

$ConuntNumber of results to return for this request, beginning from specified Start number (maximum 20)
$ResponseGroupString “Listings” is the only available response group.
$PathString Valid category path.  Note that top-level categories will not return any listings unless Recursive=yes is specified.
$StartInt 1-based index of result at which to start.  Note: An empty document will be returned if this value exceeds the total number of available results.
$SortByString Indicates how to sort the results returned by this service: ( Popularity | Title | AverageReview ) Deault is Popularity.
$RecursiveBoolean specify whether to return listings for the current category only, or for the current category plus all subcategories.
$sDescriptionboolean indicating whether to return descriptions with categories Default is True
$XMLResponseBoolean If True the value returned is the XML response, if False returned a Scripting.Dictionary

_AWIS_SitesLinkingIn

Func _AWIS_SitesLinkingIn($Count,  
$Start,  
$Url,  
$XMLResponse =  False)

The Sites Linking In action returns a list of web sites linking to a given web site.  Within each domain linking into the web site, only a single link - the one with the highest page-level traffic - is returned.  The data is updated once every two months.; Atention: In this action the URL no allow http://www.  For more information check this: https://forums.aws.amazon.com/thread.jspa?messageID=308327&#308327

Parameters

$ConuntString number of results (maximum) per page to return.  Note that the response document may contain fewer results than this maximum.
$ResponseGroupString Response groups allow the user more control over what data is returned.  By specifying one or more response groups when making the request, you can retrieve only the information you are interested in
$StartInt 1-based index of result at which to start.
$UrlString Any valid URL.  The URL parameter specifies the URL, host or domain about which you would like to receive information.
$XMLResponseBoolean If True the value returned is the XML response, if False returned a Scripting.Dictionary.

_AWIS_TrafficHistory

Func _AWIS_TrafficHistory($Count,  
$Url,  
$Start,  
$Range =  3,
$XMLResponse =  False)

The TrafficHistory action returns the daily Alexa Traffic Rank, Reach per Million Users, and Unique Page Views per Million Users for each day since June 2007.  This same data is used to produce the traffic graphs found on alexa.com.

Parameters

$ConuntString number of results (maximum) per page to return.
$ResponseGroupString “History” is the only available response group.
$UrlString Any valid URL.  The URL parameter specifies the URL, host or domain about which you would like to receive information.
$StartString start date for results.  The first start available date is “20070601” (June 1, 2007).
$RangeString number of days to return.  Note that the response document may contain fewer results than this maximum if data is not available.  Default is 3.
$XMLResponseBoolean If True the value returned is the XML response, if False returned a Scripting.Dictionary.

_AWIS_TopSites

Func _AWIS_TopSites($Count,  
$ResponseGroup,  
$Start,  
$CountryCode,  
$XMLResponse =  False)

The TopSites action provides lists of web sites ordered by Alexa Traffic Rank.  A global list is available, as well as lists for individual countries.

Parameters

$CountString number of results (maximum) per page to return.  Maximum is ‘100’.
$ResponseGroupString Any valid response group.
$StartInt number of result at which to start.  Used for paging through results.
$CountryCodeString Valid country code.
$XMLResponseBoolean If True the value returned is the XML response, if False returned a Scripting.Dictionary.

_buildQueryParams

Func _buildQueryParams($oParameters)

Builds the url for the request to ATS The url will be urlencoded as per RFC 3986 and the uri params will be in alphabetical order

Parameters

$oParametersScripting dictionary with the query parameters.

Returns

String

_generateSignature

Func _generateSignature($sUrlParams,
$sHost)

Generates an HMAC signature per RFC 2104.

Parameters

$sURLString URL to use in createing signature $sHost -String Services hots URL

Returns

String

_makeRequest

Func _makeRequest($sURL)

Makes request to AWIS

Parameters

$sURLString URL to make request to

Returns

String Result of request

_parseResponseUrlInfo()

Func _parseResponseUrlInfo($sResponse)

Parses XML response from AWIS for UrlInfo action.

Parameters

$sResponseString XML response from AWIS.

Returns

Scripting dictionary with Response fields.

_parseResponseCategoryBrowse()

Func _parseResponseCategoryBrowse($sResponse)

Parses XML response from AWIS for CategoryBrowse action.

Parameters

$sResponseString XML response from AWIS.

Returns

Scripting.Dictionary with Response fields

_parseResponseCategoryListings()

Func _parseResponseCategoryListings($sResponse)

Parses XML response from AWIS for CategoryListings action.

Parameters

$sResponseString XML response from AWIS.

Returns

Scripting.Dictionary with Response fields.

_parseResponseSitesLinkingIn()

Func _parseResponseSitesLinkingIn($sResponse)

Parses XML response from AWIS for SitesLinkingIn action.

Parameters

$sResponseString XML response from AWIS.

Returns

Scripting.Dictionary with Response fields.

_parseResponseTrafficHistory

Func _parseResponseTrafficHistory($sResponse)

Parses XML response from AWIS for SitesLinkingIn action.

Parameters $sResponse - String XML response from AWIS.

Returns

Scripting.Dictionary with Response fields.

_parseResponseTopSites

Func _parseResponseTopSites($sResponse)

Parses XML response from AWIS for TopSites action.

Parameters $sResponse - String XML response from AWIS.

Returns

Scripting.Dictionary with Response fields.

_Log

Func _Log($sText,
$iStyle)

Logging utility that you can use to output messages.

Parameters

$sTextString $iStyle
1LOG Displays a plain log message
2INFO Displays an info log message
3WARN Displays a warning log message
4ERROR Displays an error log message

_ErrFunc

Func _ErrFunc($oError)

COM error hanlder

Func _GetXMLHTTP()
Returns an XMLHTTP object
Func _AWIS_GetURLInfo($Count,  
$ResponseGroup,  
$Start,  
$Url,  
$XMLResponse =  False)
The URL Information Action provides information about websites.
Func _AWIS_CategoryBrowse($Count,  
$ResponseGroup,  
$Start,  
$Path,  
$Descriptions =  True,
$XMLResponse =  False)
Get lists of sites within a specific category ordered by traffic rank, or create a browseable directory of websites The CategoryBrowse action provide a directory service based on the Open Directory, www.dmoz.org, and enhanced with Alexa traffic data.
Func _AWIS_CategoryListings($Count,  
$ResponseGroup,  
$Start,  
$Path,  
$SortBy =  "Popularity",
$Recursive =  False,
$Descriptions =  True,
$XMLResponse =  False)
The CategoryListings action is a directory service based on the Open Directory, www.dmoz.org.
Func _AWIS_SitesLinkingIn($Count,  
$Start,  
$Url,  
$XMLResponse =  False)
The Sites Linking In action returns a list of web sites linking to a given web site.
Func _AWIS_TrafficHistory($Count,  
$Url,  
$Start,  
$Range =  3,
$XMLResponse =  False)
The TrafficHistory action returns the daily Alexa Traffic Rank, Reach per Million Users, and Unique Page Views per Million Users for each day since June 2007.
Func _AWIS_TopSites($Count,  
$ResponseGroup,  
$Start,  
$CountryCode,  
$XMLResponse =  False)
The TopSites action provides lists of web sites ordered by Alexa Traffic Rank.
Func _buildQueryParams($oParameters)
Builds the url for the request to ATS The url will be urlencoded as per RFC 3986 and the uri params will be in alphabetical order
Func _generateSignature($sUrlParams,
$sHost)
Generates an HMAC signature per RFC 2104.
Func _makeRequest($sURL)
Makes request to AWIS
Func _parseResponseUrlInfo($sResponse)
Parses XML response from AWIS for UrlInfo action.
Func _parseResponseCategoryBrowse($sResponse)
Parses XML response from AWIS for CategoryBrowse action.
Func _parseResponseCategoryListings($sResponse)
Parses XML response from AWIS for CategoryListings action.
Func _parseResponseSitesLinkingIn($sResponse)
Parses XML response from AWIS for SitesLinkingIn action.
Func _parseResponseTrafficHistory($sResponse)
Parses XML response from AWIS for SitesLinkingIn action.
Func _parseResponseTopSites($sResponse)
Parses XML response from AWIS for TopSites action.
Func _Log($sText,
$iStyle)
Logging utility that you can use to output messages.
Func _ErrFunc($oError)
COM error hanlder