Advertising using the Tenping API

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.

  1. Sign up for Tenping
  2. Visit “http://tenping.kr/API”
  3. Copy the “Request URL” from the “API Guide”
  4. Paste it wherever you are using the source below
  5. 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)

  • 쿠키죠 to 쿠키죠" aria-label=" to 쿠키죠">

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

    2021년 January 9일 at 9:57 pm

Leave a Reply

이메일 주소는 공개되지 않습니다. (* 질문, 건의사항 등은 "질문게시판"을 이용해주세요)