The Most Active and Friendliest
Affiliate Marketing Community Online!

“Voluum”/  “Adplexity”/

Need Help With CPAGrip php rss feed script

S

silverfox

Guest
As of today I have joined cpagrip to monetize my android app but for know I came to a problem I am using a php script to load offers from cpagrip this works great for text based links and thumbnail links but I don't know how to filter the cpagrip offers inside the php script for a certain offer.

Like " I have anti virus website so like to show only offers that are relegated to anti virus."

Plus I like to know how to make the thumbnail clickable now I have a clickable text link but like to chance it.

Below you will find my php script that I have so far any help with would be great.

<?php
$tracking_id = 'user@gmail.com'; //This is used to track the user doing the offer. can be email, clickid, subid.. etc
$userip = $_SERVER['REMOTE_ADDR']; //We need to get the users ip, so the rss feed can display the correct offers for their country.
$user_agent = $_SERVER['HTTP_USER_AGENT']; //lets collect their user agent to pass along.
$max_offers = 3; //max number of offers to display.

$offer_cnt = 0;
$feedurl = 'http://www.cpagrip.com/common/offer...ent).'&tracking_id='.urlencode($tracking_id);
if($xml = simplexml_load_file($feedurl, 'SimpleXMLElement', LIBXML_NOCDATA)) {
foreach($xml->offers->offer as $offeritem) {
$offer_cnt++;

//lets use a custom tracking domain for the links :)
$offeritem->offerlink = str_replace('www.cpagrip.com','filetrkr.com',$offeritem->offerlink);

//uncomment below if you want to display a point value.
//$points = floatval($offeritem->payout) * 100; //lets make offers worth $1.20 appear as 120 points.
//echo '<strong>Earn '.$points.' Points</strong><br/>';

echo '<a target="_blank" href="'.$offeritem->offerlink.'">'.$offeritem->title.'</a><br/>';

//uncomment to show offers description
//echo $offeritem->description.'<br/>';

//uncomment to show offers image
echo '<img src="'.$offeritem->offerphoto.'">';

if($offer_cnt>=$max_offers){
break; //lets stop listing offers and exit the loop.
}
}
if($offer_cnt==0){
echo 'Sorry there are no offers available for your region at this time.';
}
}else{
echo 'error fetching xml offer feed.';
}
?>
 
Last edited by a moderator:
MI
Top