Advertising using the Tenping API
I saw a Tenping ad on Facebook and decided to test it out with PHP.
If we consider the overall sales through the revenue rankings on the Tenping site, I wonder if we can keep this running for long...
If the results from the test are good, I'll write about various methods to utilize Tenping (like optimizing click-through rates).
(* The source code will only be available to registered seniors, hehe)
Anyway, here's an example of outputting using the Tenping API.
- Sign up for Tenping
- Visit “http://tenping.kr/API”
- Copy the “Request URL” from the “API Guide”
- Paste it wherever you are using the source below
- Use the $tenping value for output
<?php
$cache_file = './data/list.json'; // Location to save cache file
$cache_time = 1800; // Time to cache
if(is_file($cache_file))
{
$data = file_get_contents($cache_file);
if(time()-filemtime($cache_file)>$cache_time = 1800) $data = '';
}
if(!$data)
{
// Enter the Request URL copied from the API.
// CampainType is the desired type selected from below plus the value.
// (1:CPC+5, 2:CPA, 4:CPS, 8:CPI, 32:CPV, 64:CPADB, 128:CPC)
$url = 'http://tenping.kr/adbox/list?MemberID=?!?!?!?!?!?!?&CampaignType=129&MinClickPoint=30&MinCurrentPoint=1000';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
file_put_contents($cache_file, $data);
}
$json = json_decode($data, true);
if($json['ResultCode'] == '200')
{
$tenping = $json['List'][mt_rand(0, count($json['List')-1)];
}
// You can output and use the $tenping value.
?>
* If you haven’t registered as a senior when using the API, you won't be able to check the unit price and remaining quantity (ClickPoint, CurrentPoint) of Tenping content.
Please register as a senior at prince@kilho.net and send your last 4 digits of your phone number via email for verification.
I'll send you any related Tenping information when it comes out ^^











Comment (1)
안녕하세요 글은 잘보았습니다
혹시 어떻게 적용해야하는지 자세히 글 작성가능하신지 여쭈어봅니다..
텐핑 api관련해서는 글이 많이없어 부탁드립니다ㅠ