이 코드를 붙여 귀하의 요구 사항 즉에 따라 않는
forexample 페이지 cjcall.php를 만들키워드, DEV ID는, 페이지
include('../../../../wp-load.php');
$stringkeyw=urlencode(get_option('cj_keyword'));
if(get_option('rm_num_products')==''){
$pperkeyword=50;
}else{
$pperkeyword= get_option('rm_num_products');
}//number of products against keyword
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://product-search.api.cj.com/v2/product-search?website-id=".get_option('cj_siteid')."&keywords=".$stringkeyw."&records-per-page=".$pperkeyword."&serviceable-area=US");
curl_setopt($ch, CURLOPT_HEADER,false);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization:".get_option('cj_devid').""));
$result = curl_exec($ch);
당 레코드가 다른 페이지를 만들고이 페이지에서 XML을 가져 오는 다음 코드를 붙여 넣습니다
$hurl= home_url();
$homepage = file_get_contents(''.$hurl.'/wp-content/plugins/rapid_monetizer/cronjob/cjcall.php');
$object = simplexml_load_string($homepage);
foreach($object->products->product as $cjres)
{
//do your code with products coming in $cjres
}
당신이 (등, 문서)이 API에 링크 할 수 있습니까? – Till
API 참조 및 WSDL –