The Most Active and Friendliest
Affiliate Marketing Community Online!

“Voluum”/  “Adplexity”/

Need Help With CPAGrip php rss feed script



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.

$tracking_id = ''; //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 = ''&tracking_id='.urlencode($tracking_id);
if($xml = simplexml_load_file($feedurl, 'SimpleXMLElement', LIBXML_NOCDATA)) {
foreach($xml->offers->offer as $offeritem) {

//lets use a custom tracking domain for the links :)
$offeritem->offerlink = str_replace('','',$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.'">';

break; //lets stop listing offers and exit the loop.
echo 'Sorry there are no offers available for your region at this time.';
echo 'error fetching xml offer feed.';
Last edited by a moderator: