Skip to content

Instantly share code, notes, and snippets.

@kawahara
Created August 3, 2012 14:51
Show Gist options
  • Save kawahara/3248316 to your computer and use it in GitHub Desktop.
Save kawahara/3248316 to your computer and use it in GitHub Desktop.
<?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