26
PeakClick + Dreamhost = SimpleXML
Niche Marketing
9:00 pm
I was anxious to start using PeakClick so I could give it a useful review. However, I came across an obstacle in implementing their feed. My host, Dreamhost, has file() disabled as a safety against hacking. This means that to use the PeakClick feed on Dreamhost, you need to use cURL (a php function).
The problem is that I would imagine many people who use these kinds of PPC feeds don’t know much about php and just copy and paste what PeakClick gives them. That’s certainly what I tried to do at first. Remember that customer service I spoke of that PeakClick prides themselves on so much that they make it a main selling point? Well, their exact reply to my problem was “there is most likely a bug in your script with curl, please try to debug it.” Granted, I understand it’s not their job to teach me php, but I was hoping for many a little snippet of code or atleast a resourceful link. So I decided to look for another solution to my problem.
What I found was SimpleXML. Its a great, easy way to integrate XML without any hard work. You don’t even have to know anything about php. The one requirement is that your server is running php 5. For Dreamhost this is no problem, simply go to “manage domains” and then edit your domain and click the “PHP 5″ option. Then just add the SimpleXML code into your webpage wherever you want the PeakClick feed to appear. Here is the complete code:
################## CONFIGURATION #######################
$_aff = 0000; # Your Affiliate ID
$_subaff = 1; # Your Subaffiliate ID
$_numResults = 5; # Number of search results displayed
$_ip = $_SERVER["REMOTE_ADDR"];
$keyword = "yourkewordhere";
############################################################
// sets the name of XML file
$file = "http://feed.peakclick.com/res.php?aff=$_aff&subaff=$_subaff" . ( $keyword != "" ? "&keyword=" . urlencode( $keyword ) : "" ) . "&num=$_numResults&ip=$_ip&thumbs=1&xml=1";
// loads the file
$xml = simplexml_load_file($file) or die ("Unable to load XML file!");
foreach( $xml->result as $result )
{
foreach($result->record as $record)
{
#### This part determines how the results look ####
echo “<div id=\”record\”>”;
echo “<a href=\”" . $record->click . “\”>”;
echo “<h3> ” . $record->title . “</h3>”;
echo ” <dl ><dt>” . $record->thumbnail . “</dt> <dd>” . $record->description . “</dd></dl>”;
echo “</a>”;
echo “</div>”;
############################################################
}
}
?>
It’s really so easy. The only part you would need to change is the output. You’d probably want to style the way it looks but that can easily be done with style sheets. And you can change anything in the “echo” statements to suite your needs.






1
February 7th, 2006 at 7:35 am
So how happy are you with peakclick?
2
February 7th, 2006 at 9:13 am
Well, I’m still in my testing phase. So far I would say I don’t think It will ever replace adsense or even YPN, but I think its good as an additional source of income. Sorry I don’t really have a good definitive answer yet, but soon I will post a full review.
3
March 4th, 2006 at 3:21 pm
nice blog you have here !
so is there any other way to parse peakclick feeds since i have php 4 on my hosting….. any help would be nice
regards
4
March 6th, 2006 at 7:13 am
well if your host allows file() then you can just use the peakclick scipt to parse the feeds. If your host doesn’t allow file() and doesn’t have php5 then you’ll have to use cURL. I am sure there is a simple way to get cURL to parse the the feed, but I was never able to get it to work for me. Good Luck!
5
March 6th, 2006 at 8:27 am
I was able to parse their feeds with their search script but i think not all those links are pay per click ? i was using include php …. search.php?aid….. and it is working but like i said i think those are not ppc links i get with their feeds
6
March 6th, 2006 at 8:25 pm
hm, i think they are SUPPOSED to be ppc links. When you print the feed, you can display the bid for each link, so that makes me think you should be getting paid for the clicks. However, my stats aren’t even showing any clicks (even when I clicked on one of the links from work to test it). I think next I’m going to put a peakclick feed on a site I get high traffic on for a little while to test if I get any clicks that way.
7
March 7th, 2006 at 7:14 am
i did some testing and not all are paid links … some dont even count as clicks and some are 0 cents ! only one was for 1 cent ! i have not yet contacted them for approval so i can make more tests …. we will see