自分のサイトにある商品かチェック
メインのindex.phpに自分のサイトの商品かのチェックを加えます。
商品IDを取り出し、urllist.phpの配列で定義されているかで判断します。

ぜひクリックしてね→

商品IDを取り出し、urllist.phpの配列で定義されているかで判断します。
<?php
mb_regex_encoding("UTF-8");
mb_internal_encoding("UTF-8");
require_once('config.php');
require_once('urllist.php');
require_once('getmoshiapi.php');
$p = 0;
$maxnum = 100;
$s = "sales";
if(($ArticleSearch = getmoshi_tag($authorization_code, $tag, $p, $maxnum, $s)) !== FALSE){
$ranking = 1;
foreach ($ArticleSearch->Articles->Article as $Article) {
$pid = (int)$Article->ArticleId;
if(isset($arr_pageurl[$pid])){
(自分のサイトのページ)
$ranking++;
if(ranking > $max_rank){ break;}
} else {
}
}
}
?>

ぜひクリックしてね→