Created
August 3, 2012 14:51
-
-
Save kawahara/3248316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// autoload.php を読み込む | |
require_once __DIR__.'/autoload.php'; | |
$client = new RakutenRws_Client(); | |
$client->setApplicationId('アプリID'); | |
$response = $client->execute('IchibaItemSearch', array( | |
// アフィエイトIDをパラメータにセット | |
'affiliateId' => 'アフィリエイトID', | |
'keyword' => 'うどん' | |
)); | |
if ($response->isOk()) { | |
foreach ($response as $item) { | |
// 商品名を出力 | |
echo $item['itemName']."\n"; | |
// アフィリエイトURL | |
echo $item['affiliateUrl']."\n"; | |
} | |
} else { | |
echo "Error: ".$response->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment