2
我在Github發現了這個PHP-Oara圖書館https://github.com/fubralimited/php-oara,我已經設置好了所有東西。如何從亞馬遜會員獲取報告
$networkName = "Amazon"; //Ex: AffiliateWindow
//Retrieving the credentials for the network
$config = Zend_Registry::getInstance()->get('credentialsIni');
$configName = strtolower($networkName);
$credentials = $config->$configName->toArray();
//Path for the cookie located inside the Oara/data/curl folder
$credentials["cookiesDir"] = "example";
$credentials["cookiesSubDir"] = $networkName;
$credentials["cookieName"] = "test";
//The name of the network, It should be the same that the class inside Oara/Network
$credentials['networkName'] = $networkName;
//Which point of view "Publisher" or "Advertiser"
$credentials['type'] = "Publisher";
//The Factory creates the object
$network = Oara_Factory::createInstance($credentials);
我還添加了對credentials.ini
文件進行必要的細節:
;------------Amazon (All the newtwork are available)------------
;The user name used in Amazon associates to log in
amazon.user = 'my amazon affiliate email'
;The password used in Amazon associates to log in
amazon.password = 'my amazon affiliate password'
;Network we are going to log in: uk, es, us, ca, de, fr, it, jp, cn.
amazon.network = 'us'
但我發現了以下錯誤:
Failed to find log in form!
我以爲這只是名稱首先登錄表格:
if (!preg_match('/<form name="signIn".*?<\/form>/is', $page, $form)) {
die('Failed to find log in form!');
}
由於名稱https://affiliate-program.amazon.com實際上是sign_in
,但是當我將其更改爲沒有任何效果時。
但真正的問題是,$page
變量實際上是空的。 假設這個庫已經損壞或者我在設置上做了什麼錯誤是否安全? 你可以推薦任何其他的圖書館,可以做同樣的事情,或可能指出我的一些資源,可以幫助我寫我自己的圖書館登錄到亞馬遜附屬網站並獲取一些報告。
在此先感謝!