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
{{ $associateId := "YOUR_ASSOCIATE_ID" }} | |
{{ $itemId := index .Params 0 }} | |
{{ $json := getJSON "http://example.com/amazon/lookup.php?item=" $itemId }} | |
<div class="amazon-shortcode-box"> | |
<div class="amazon-shortcode-image"> | |
<a href="http://www.amazon.co.jp/exec/obidos/ASIN/{{ $itemId }}/{{ $associateId }}/" name="amazon-shortcode" target="\_blank"> | |
<img src="{{ $json.image_url }}" alt="{{ $json.title }}" /> | |
</a> | |
</div> |
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 | |
require_once('vendor/autoload.php'); | |
require_once('conf.php'); // ACCESS_KEY, SECRET_KEY, ASSOCIATE_TAGを定義 | |
const RETRY_COUNT = 5; // 試行回数 | |
const RETRY_SLEEP_SEC = 10; // 試行時の待ち時間(秒) | |
const RESULT_ERROR_JSON = '{ "result": false }'; | |
use ApaiIO\Configuration\GenericConfiguration; |
NewerOlder