ashim888 / awis

A python script to query Amazon's Alexa Web Information Service (AWIS).
GNU General Public License v3.0
37 stars 18 forks source link

Error in response #9

Closed cincoai closed 6 years ago

cincoai commented 6 years ago

obj=CallAwis('www.dealsea.com','Rank', 'my id', 'my key')

obj.urlinfo()

Returns:

<?xml version="1.0" encoding="unicode-escape"?>\nRequestExpiredRequest has expired. Timestamp date is 2017-08-31T00:41:56.381165e6ee50f7-5ca7-a1f4-2866-8a34076f48e6

cincoai commented 6 years ago

I noticed the signature calculated by your code is different from the one calculated by AWIS sample Java code.

mesaleh commented 6 years ago

This is because the timestamp is not UTC, which is required by AWIS. This should fix it:

def create_timestamp(self): now = datetime.datetime.utcnow() timestamp = now.isoformat() + "Z" return timestamp

jimmyVadako commented 6 years ago

Im with python 3 I have made some changes to your files but when I try this.

from myawis import *

Access_Key_ID="x" Secret_Access_Key="x" URLINFO_RESPONSE_GROUPS="History" RANGE=str(30) START=str(20180128) obj = CallAwis('www.ripple.com',URLINFO_RESPONSE_GROUPS, Access_Key_ID, Secret_Access_Key)

print(obj)

print(obj.traffichistory(RANGE,START))

I get this error:

<?xml version="1.0" encoding="utf-8"?>

AlexaErrorRequest could not be execute due to an Alexa error
ashim888 commented 6 years ago

@cincoai Please verify once, Implemented V4 signing process by @liehendi11