<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Eric Nagel</title>
	
	<link>http://www.ericnagel.com</link>
	<description>PPC &amp; SEO Affiliate Marketer</description>
	<lastBuildDate>Tue, 09 Mar 2010 21:20:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ericnagel" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="ericnagel" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">ericnagel</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Building a Datafeed Site – Step 3</title>
		<link>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-3.html</link>
		<comments>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-3.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 21:20:29 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Datafeeds]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1224</guid>
		<description><![CDATA[			
				
			
		
In step 3, we&#8217;re going to actually display the data saved in the database! So far I&#8217;ve held your hand along the way, but now I&#8217;m just going to point you in the right direction, because there isn&#8217;t one way to do this. Merchants handle categories in their datafeeds differently, so you&#8217;re going to have [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-step-3.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-step-3.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.ericnagel.com/wp-content/uploads/2010/03/iStock_000009058356XSmall.jpg" alt="Final piece of the puzzle" title="Final piece of the puzzle" width="250" height="109" class="blogimage left" />In step 3, we&#8217;re going to actually display the data saved in the database! So far I&#8217;ve held your hand along the way, but now I&#8217;m just going to point you in the right direction, because there isn&#8217;t one way to do this. Merchants handle categories in their datafeeds differently, so you&#8217;re going to have to look at what the merchants you&#8217;ve chosen to work with are doing, and adjust accordingly.</p>
<p>Looking at my tea example, I wanted pages for <a href="http://www.greenwhiteandblacktea.com/browse-green-tea.php" target="_blank">Green Tea</a>, <a href="http://www.greenwhiteandblacktea.com/browse-white-tea.php" target="_blank">White Tea</a>, <a href="http://www.greenwhiteandblacktea.com/browse-black-tea.php" target="_blank">Black Tea</a> and <a href="http://www.greenwhiteandblacktea.com/browse-oolong-tea.php" target="_blank">Oolong Tea</a>. So (in theory, I don&#8217;t do it this way) we could make the Green Tea page /browse.php?cCategory=green+tea, and then pull in all the green teas. How do we do that? This is where you have to think.</p>
<p>What I&#8217;m doing is the following:</p>
<pre class="brush: sql;">select * from products where MerchantSubcategory like '%green tea%' or MerchantCategory like '%green tea%' order by Name;</pre>
<p>That works nicely for my dataset. However, if you were using the <a href="http://www.shareasale.com/a-viewmerchant.cfm?merchantID=11744" target="_blank">Baghaus</a> datafeed, your query may be </p>
<pre class="brush: sql;">select * from products where Name like '%Tylie Malibu%' order by Price desc;</pre>
<p>Once you have your data, loop through it &#038; display the products on the page, with a link to the product details page. You can use a list, or a table&#8230; whatever you&#8217;d like. In the end, you&#8217;ll be linking to individual products, like: /item.php?ProductID=466820102</p>
<p>And on item.php, you&#8217;ll do a quick lookup and display the product:</p>
<pre class="brush: php;">$cQuery = &quot;select * from products where ProductID=&quot; . (int)$_GET['ProductID'] . &quot; limit 1&quot;;
$oResult = mysql_query($cQuery);
$rsData = mysql_fetch_array($oResult);</pre>
<pre class="brush: php;">&lt;a href=&quot;&lt;?= $rsData['Link'] ?&gt;&quot; title=&quot;&lt;?= $rsData['Name'] ?&gt;&quot; rel=&quot;nofollow&quot;&gt;&lt;?= $rsData['Name'] ?&gt;&lt;/a&gt;</pre>
<p>If you look at my tea site, you&#8217;ll notice I&#8217;m not using links like those in the blog post. Instead, I&#8217;m using .htaccess to rewrite the URLs, to make them &#8220;pretty&#8221;. You can learn about this in my <a href="http://www.ericnagel.com/2010/03/follow-up-on-datafeeds-podcast.html">Follow-up on Datafeeds Podcast</a> blog post.</p>
<p>Finally, one problem you&#8217;ll be sure to run into is that merchants often have broken images in their datafeeds. This sucks, but there isn&#8217;t much you can do about it.</p>
<p>At first, I had a PHP script that made sure the image existed, and if so displayed it and if not, displayed another one. But, that slowed down the page display <em>considerably</em>. So instead, I use a bit of <a href="http://maisonbisson.com/blog/post/12150/detecting-broken-images-in-javascript/" target="_blank">Javascript to replace broken images</a> with a pre-defined image:</p>
<pre class="brush: jscript;">&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
function ImgError(source){
	source.src = &quot;/images/no-image.gif&quot;;
	source.onerror = &quot;&quot;;
	return true;
}
&lt;/script&gt;</pre>
<p><a href="http://en.wikipedia.org/wiki/Warren_Buffett" target="_blank">Warren Buffett</a> once commented, &#8220;I want to give my kids just enough so that they would feel that they could do anything, but not so much that they would feel like doing nothing&#8221;.</p>
<p>In this datafeed series, I want to think the same thing. If I give you a finished site, you haven&#8217;t learned anything. However, if I give you the framework, and set you in the right direction, the finished product will be something you developed, not something you copied.</p>
<p>If you&#8217;ve followed from Step 1, and I know some of you have, you should be well on your way to a finished site. But if you&#8217;re waiting for a template to work off of, here it is:</p>
<p><center><a href='http://www.ericnagel.com/wp-content/uploads/2010/03/simple1.zip' target="_blank"><strong>Download the Zip</strong></a></center></p>
<p>By no means is this a website that you can actually launch, but the framework is there for you to build off of.</p>
<p>As always, if you need help, leave a comment, <a href="mailto:eric@ericnagel.com">email me</a>, or find me on Twitter <a href="http://twitter.com/esnagel">@esnagel</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=fOA22U8jP-0:NC1BinW3P0Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=fOA22U8jP-0:NC1BinW3P0Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=fOA22U8jP-0:NC1BinW3P0Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=fOA22U8jP-0:NC1BinW3P0Y:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=fOA22U8jP-0:NC1BinW3P0Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=fOA22U8jP-0:NC1BinW3P0Y:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-3.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building a Datafeed Site – Step 2</title>
		<link>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-2.html</link>
		<comments>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-2.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 17:59:13 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Datafeeds]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ShareASale]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1217</guid>
		<description><![CDATA[			
				
			
		
By now, we have selected the niche and chosen a template, added some supporting files and created the database, and are now ready to populate the products table with actual products!
The first step, if you haven&#8217;t done so already, is to download the datafeed from the ShareASale website. While many merchants offer FTP access, and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-step-2.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-step-2.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>By now, we have <a href="http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-1.html">selected the niche and chosen a template</a>, <a href="http://www.ericnagel.com/2010/03/building-a-datafeed-site-%e2%80%93-step-1b.html">added some supporting files and created the database</a>, and are now ready to populate the products table with actual products!</p>
<p>The first step, if you haven&#8217;t done so already, is to download the datafeed from the <a href="http://www.ericnagel.com/out.php?q=shareasale" target="_blank">ShareASale</a> website. While many merchants offer FTP access, and we could automate this a bit more, it&#8217;s easier when getting started to upload the data manually (yeah, uploading a zip of the datafeed is &#8220;manual&#8221; to me).</p>
<p>You&#8217;ll need to create a &#8220;temp&#8221; folder, chmod it to 777 so the script can write to it, and maybe change where your unzip program sits on your server (line 17)</p>
<p>The script to load the products table isn&#8217;t terribly long, but I&#8217;m not going to paste the whole thing in this blog post. So&#8230;</p>
<p><center><a href="http://www.ericnagel.com/wp-content/uploads/2010/03/admin-sas-datafeed.phps"><strong>Download the file here</strong></a></center></p>
<p>Then, upload the file to your website, go to yourdomain.com/admin-sas-datafeed.php and click on the &#8220;Choose File&#8221; button, then select the zip file from your computer, and click &#8220;Upload&#8221;.<br />
<img src="http://www.ericnagel.com/wp-content/uploads/2010/03/2010-03-08-124743.png" alt="Uploading data" title="Uploading data" width="345" height="158" class="blogimage" /></p>
<p>What this does is unzips the .zip file, reads the .txt file and if there&#8217;s a new product, adds it to the database. If the product already exists, it gets updated. Finally, any product that wasn&#8217;t just added or updated, gets removed.</p>
<p>Repeat as necessary for each merchant that you&#8217;re working with.</p>
<p>This step isn&#8217;t very long, or difficult (considering I give you everything you need!) but it&#8217;s exciting as now you have a database full of products, ready to display on your website!</p>
<p>Next up&#8230; we&#8217;ll work on the display of the products.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=-myn2OmJnc0:agUqcw0m7XM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=-myn2OmJnc0:agUqcw0m7XM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=-myn2OmJnc0:agUqcw0m7XM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=-myn2OmJnc0:agUqcw0m7XM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=-myn2OmJnc0:agUqcw0m7XM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=-myn2OmJnc0:agUqcw0m7XM:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Datafeed Site – Step 1b</title>
		<link>http://www.ericnagel.com/2010/03/building-a-datafeed-site-%e2%80%93-step-1b.html</link>
		<comments>http://www.ericnagel.com/2010/03/building-a-datafeed-site-%e2%80%93-step-1b.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 00:49:35 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Datafeeds]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1211</guid>
		<description><![CDATA[			
				
			
		
The next step in building a datafeed website is getting the data into the database, but to do this, we need to build an administrative section to your website, and add some helper functions &#038; files.
vars.php was a file seen in Step 1, which I use to store the mysql connection and other variables. Here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-%25e2%2580%2593-step-1b.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-%25e2%2580%2593-step-1b.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>The next step in <a href="http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-1.html">building a datafeed website</a> is getting the data into the database, but to do this, we need to build an administrative section to your website, and add some helper functions &#038; files.</p>
<p>vars.php was a file seen in <a href="http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-1.html">Step 1</a>, which I use to store the mysql connection and other variables. Here&#8217;s a simplified version of the one I&#8217;m using:</p>
<pre class="brush: php;">&lt;?php
	// MySQL
	$DB_NAME = 'your_db_name';
	$DB_USER = 'your_db_username';
	$DB_PASSWORD = 'your_db_password';
	$DB_HOST = 'your_db_host';

	mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD);
	mysql_select_db($DB_NAME);

	// Your ShareASale ID
	$nSASID = 132296;

	// Shortcut / Alias
	function myres($cString) {
		return mysql_real_escape_string(stripslashes($cString));
	} // ends function mres($cString)
?&gt;</pre>
<p>Change lines 3-6 and 12.</p>
<p>Next, you&#8217;ll need to set-up an admin.php page, like so:</p>
<pre class="brush: php;">&lt;?php
	include('./vars.php');
	include('./admin-password.php');
	$bNavHome = true;
	include('./header.php');
?&gt;
			&lt;div class=&quot;post&quot;&gt;
				&lt;h2 class=&quot;title&quot;&gt;GreenWhiteAndBlackTea.com Admin&lt;/h2&gt;
				&lt;div class=&quot;entry&quot;&gt;
					&lt;ul&gt;
						&lt;li&gt;&lt;a href=&quot;admin-sas-datafeed.php&quot;&gt;Upload ShareASale Datafeed&lt;/a&gt;&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;
			&lt;/div&gt;&lt;!-- ends class=&quot;post&quot; --&gt;
&lt;?php
	include('./footer.php');
?&gt;</pre>
<p>Change as necessary &#8211; this is just an index for your admin section.</p>
<p>and admin-password.php:</p>
<pre class="brush: php;">&lt;?php
if (!$_SERVER['PHP_AUTH_USER']) {
        Header(&quot;WWW-authenticate: basic realm=\&quot;&quot; . $_SERVER['HTTP_HOST'] . &quot; Admin\&quot;&quot;);
        Header(&quot;HTTP/1.0 401 Unauthorized&quot;);
        exit;
}
else {
        if (($_SERVER['PHP_AUTH_USER'] == 'the-username-you-want')
        &amp;&amp; ($_SERVER['PHP_AUTH_PW'] == 'ssssshhhhh-super-secret')) {
                // OK!!!!
				$_SESSION['bAdmin'] = true;
                ;
        }
        else {
                Header(&quot;WWW-authenticate: basic realm=\&quot;&quot; . $_SERVER['HTTP_HOST'] . &quot; Admin\&quot;&quot;);
                Header(&quot;HTTP/1.0 401 Unauthorized&quot;);
                echo(&quot;Login failed.\n&quot;);
                exit;
        }
}
?&gt;</pre>
<p>Set your username &#038; password that you&#8217;d like on lines 8 &#038; 9</p>
<p>Finally, in your MySQL database, create the products table:</p>
<pre class="brush: sql;">CREATE TABLE `products` (
  `ProductID` int(10) unsigned NOT NULL,
  `Name` varchar(255) NOT NULL,
  `MerchantID` int(10) unsigned NOT NULL,
  `Merchant` varchar(255) NOT NULL,
  `Link` varchar(255) NOT NULL,
  `Thumbnail` varchar(255) NOT NULL,
  `BigImage` varchar(255) NOT NULL,
  `Price` float(8,2) unsigned NOT NULL,
  `RetailPrice` float(8,2) unsigned NOT NULL,
  `Category` varchar(50) NOT NULL,
  `Subcategory` varchar(50) NOT NULL,
  `Description` text NOT NULL,
  `Custom1` varchar(255) NOT NULL,
  `Custom2` varchar(255) NOT NULL,
  `Custom3` varchar(255) NOT NULL,
  `Custom4` varchar(255) NOT NULL,
  `Custom5` varchar(255) NOT NULL,
  `Lastupdated` datetime NOT NULL,
  `Status` varchar(50) NOT NULL,
  `Manufacturer` varchar(255) NOT NULL,
  `PartNumber` varchar(255) NOT NULL,
  `MerchantCategory` varchar(255) NOT NULL,
  `MerchantSubcategory` varchar(255) NOT NULL,
  `ShortDescription` varchar(255) NOT NULL,
  `ISBN` varchar(25) NOT NULL,
  `UPC` varchar(25) NOT NULL,
  `SKU` varchar(255) NOT NULL,
  `CrossSell` varchar(255) NOT NULL,
  `MerchantGroup` varchar(255) NOT NULL,
  `MerchantSubgroup` varchar(255) NOT NULL,
  `CompatibleWith` varchar(255) NOT NULL,
  `CompareTo` varchar(255) NOT NULL,
  `QuantityDiscount` varchar(255) NOT NULL,
  `Bestseller` tinyint(1) unsigned NOT NULL,
  `AddToCartURL` varchar(255) NOT NULL,
  `ReviewsRSSURL` varchar(255) NOT NULL,
  `Option1` varchar(255) NOT NULL,
  `Option2` varchar(255) NOT NULL,
  `Option3` varchar(255) NOT NULL,
  `Option4` varchar(255) NOT NULL,
  `Option5` varchar(255) NOT NULL,
  `bActiveProduct` tinyint(1) unsigned NOT NULL,
  UNIQUE KEY `ProductID` (`ProductID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;</pre>
<p>I&#8217;m wrapping up the script which loads the data, which will be posted tomorrow.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=biWJ_JW6Y4Y:m4B1ETKStzw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=biWJ_JW6Y4Y:m4B1ETKStzw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=biWJ_JW6Y4Y:m4B1ETKStzw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=biWJ_JW6Y4Y:m4B1ETKStzw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=biWJ_JW6Y4Y:m4B1ETKStzw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=biWJ_JW6Y4Y:m4B1ETKStzw:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/building-a-datafeed-site-%e2%80%93-step-1b.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Datafeed Site – Step 1</title>
		<link>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-1.html</link>
		<comments>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-1.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 20:36:06 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Datafeeds]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ShareASale]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1202</guid>
		<description><![CDATA[			
				
			
		
This is the first in a series of how to build a datafeed site. I&#8217;m building the site right now, and will share the experience with you.
This will be an intermediate to advanced method of using datafeeds to build a site. If you&#8217;re looking for a simple way to get started, go check out Pop [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-step-1.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fbuilding-a-datafeed-site-step-1.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.ericnagel.com/wp-content/uploads/2010/03/iStock_000012056415XSmall.jpg" alt="Datafeeds" title="Datafeeds" width="225" height="150" class="blogimage left" />This is the first in a series of how to build a datafeed site. I&#8217;m building the site right now, and will share the experience with you.</p>
<p>This will be an intermediate to advanced method of using datafeeds to build a site. If you&#8217;re looking for a simple way to get started, go check out <a href="http://www.ericnagel.com/out.php?q=popshops">Pop Shops</a> or <a href="http://www.ericnagel.com/out.php?q=datafeedr">Datafeedr</a>. What I&#8217;m going to show you is how to build a high-quality site, driven by a datafeed, for free.</p>
<p>The absolute first thing you need to do is pick a niche. I&#8217;m not going to help you here, but because I&#8217;ve been talking with Deborah Carney (aka <a href="http://teamloxly.com/">Loxly</a>), I&#8217;m going to build a tea site. Loxly manages the <a href="http://www.ericnagel.com/out.php?q=amtearoom">American Tea Room</a> affiliate program, so I&#8217;m going to use their feed, along with <a href="http://www.ericnagel.com/out.php?q=artoftea">Art of Tea</a> (both <a href="http://www.ericnagel.com/out.php?q=shareasale">ShareASale</a> merchants). After the site is &#8220;done&#8221;, I&#8217;ll look at adding a <a href="http://www.ericnagel.com/out.php?q=cj">CJ</a> merchant feed in there.</p>
<p><img src="http://www.ericnagel.com/wp-content/uploads/2010/03/datafeed.gif" alt="ShareASale&#039;s datafeed icon" title="ShareASale&#039;s datafeed icon" width="40" height="20" class="blogimage right" />To find merchants in <a href="http://www.ericnagel.com/out.php?q=shareasale">ShareASale</a> that have datafeeds, login and look under &#8220;Find/Join Merchants&#8221; and click on &#8220;<a href="http://www.shareasale.com/a-datafeeds.cfm">View those with Datafeeds</a>&#8220;. To keep things simple, pick a merchant (or two, or three) with a couple hundred products. If you choose ecampus, with 2.7mm products, you&#8217;re on your own.</p>
<p>Choosing a domain name isn&#8217;t extremely important, but as <a href="http://vinnyohare.com/">Vinny O&#8217;Hare</a> reminded me, have the keyword in there. So I&#8217;m building out <a href="http://www.GreenWhiteAndBlackTea.com/" title="Green White And Black Tea">GreenWhiteAndBlackTea.com</a>. Just make sure you keep the domain under 35 characters, so you can use it as your AdWords display URL.</p>
<p>Set-up the hosting, and make sure you create a MySQL database when you do this. We&#8217;re going to save the datafeed in MySQL, to make a dynamic site. Don&#8217;t worry, I&#8217;ll give you the products table structure&#8230; all 41 fields!</p>
<p>Next, find a template from <a href="http://www.freecsstemplates.org/" target="_blank">Free CSS Templates</a> that matches the theme of your niche. You&#8217;ll see on <a href="http://www.GreenWhiteAndBlackTea.com/" title="Green White And Black Tea">GreenWhiteAndBlackTea.com</a> I&#8217;m using the <a href="http://www.freecsstemplates.org/preview/begrimed" target="_blank">Begrimed theme</a>. </p>
<p>Themes from Free CSS Templates include a single index.html file, but I want you to break this into 3 php files: header.php, index.php, and footer.php. Index.php should include header.php, then have the content unique to the index page, then include footer.php. My index.php file is simply:</p>
<pre class="brush: php;">&lt;?php
	include('./vars.php');
	$bNavHome = true;
	include('./header.php');
?&gt;
&lt;div class=&quot;post&quot;&gt;
	&lt;h2 class=&quot;title&quot;&gt;Welcome to GreenWhiteAndBlackTea.com&lt;/h2&gt;
	&lt;div class=&quot;entry&quot;&gt;
		&lt;p&gt;This is &lt;strong&gt;Begrimed  &lt;/strong&gt;, a free, fully standards-compliant CSS template designed by FreeCssTemplates&lt;a href=&quot;http://www.nodethirtythree.com/&quot;&gt;&lt;/a&gt; for &lt;a href=&quot;http://www.freecsstemplates.org/&quot;&gt;Free CSS Templates&lt;/a&gt;.  This free template is released under a &lt;a href=&quot;http://creativecommons.org/licenses/by/2.5/&quot;&gt;Creative Commons Attributions 2.5&lt;/a&gt; license, so you’re pretty much free to do whatever you want with it (even use it commercially) provided you keep the links in the footer intact. Aside from that, have fun with it <img src='http://www.ericnagel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &lt;/p&gt;
		&lt;p&gt;Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem.&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;&lt;!-- ends class=&quot;post&quot; --&gt;
&lt;?php
	include('./footer.php');
?&gt;</pre>
<p>Don&#8217;t worry about vars.php right now.</p>
<p>That&#8217;s enough for one day. Next, we need to download the datafeeds, and get them into MySQL.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=UP_nNDwuhcw:zhyIxcQihC4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=UP_nNDwuhcw:zhyIxcQihC4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=UP_nNDwuhcw:zhyIxcQihC4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=UP_nNDwuhcw:zhyIxcQihC4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=UP_nNDwuhcw:zhyIxcQihC4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=UP_nNDwuhcw:zhyIxcQihC4:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/building-a-datafeed-site-step-1.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Running for Boobs</title>
		<link>http://www.ericnagel.com/2010/03/running-for-boobs.html</link>
		<comments>http://www.ericnagel.com/2010/03/running-for-boobs.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 15:11:46 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Affiliate Summit]]></category>
		<category><![CDATA[boobs]]></category>
		<category><![CDATA[running]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1195</guid>
		<description><![CDATA[			
				
			
		
If you follow me on Twitter (which you should) or are my friend on Facebook, you&#8217;ll notice I&#8217;ve been doing a lot of running this week. Well get used to it, because I&#8217;m participating in the Affiliate Summit East 2010 Nike+ Challenge, where Affiliate Summit will donate $1 to the Avon Breast Cancer Crusade for [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Frunning-for-boobs.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Frunning-for-boobs.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.ericnagel.com/wp-content/uploads/2010/03/running-for-boobs.jpg" alt="Running for Boobs" title="Running for Boobs" width="250" height="334" class="blogimage left" />If you <a href="http://twitter.com/esnagel" target="_blank">follow me on Twitter</a> (which you should) or are my friend on Facebook, you&#8217;ll notice I&#8217;ve been doing a lot of running this week. Well get used to it, because I&#8217;m participating in the <a href="http://www.affiliatesummit.com/2010/02/15/affiliate-summit-east-2010-challenge/" target="_blank">Affiliate Summit East 2010 Nike+ Challenge</a>, where Affiliate Summit will donate $1 to the <a href="http://www.avoncompany.com/women/avoncrusade/" target="_blank">Avon Breast Cancer Crusade</a> for each mile run (up to $5,000).</p>
<p>This actually works out perfectly for me. First, I&#8217;ve been meaning to run more, and now I have a reason to. Second, if you put a challenge in front of me, I&#8217;ll probably take it (except for the <a href="http://www.evtv1.com/player.aspx?itemnum=8865" target="_blank">Ole 96er</a> – I will not participate in eating contests anymore).</p>
<p>Finally, there&#8217;s been too much breast cancer in my family, especially lately, so anything I can do to help raise funds for awareness, access to care and finding a cure, I&#8217;ll be sure to help.</p>
<p>My goal is to run 250 miles over the 24-week period. While outside, I&#8217;ll be using my <a href="http://www.amazon.com/gp/product/B000CSWCQA?ie=UTF8&#038;tag=didd-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B000CSWCQA" target="_blank">Garmin Forerunner</a> for accurate recording (then <a href="http://www.awsmithson.com/tcx2nikeplus/" target="_blank">converting the Garmin tcx file and uploading it to the Nike Running site</a>) and while inside (treadmill running), I&#8217;ll be using the <a href="http://www.amazon.com/gp/product/B002RR6TZY?ie=UTF8&#038;tag=didd-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B002RR6TZY" target="_blank">Nike+ kit</a>.</p>
<p>In addition to Affiliate Summit&#8217;s donation on my behalf, I&#8217;ll be donating $1 for every mile I run to <a href="http://www.roswellpark.org/" target="_blank">Roswell Park</a> here in Buffalo. Roswell Park is America&#8217;s first cancer center, founded in 1898. The people at Roswell Park do great things for their patients and are focused on their mission to <a href="http://www.roswellpark.org/AboutUs/Mission_and_Vision" target="_blank">understand, prevent and cure cancer</a>.</p>
<p>Your encouragement is greatly appreciated! There will be plenty of days I don&#8217;t want to run, and my running buddies have already been a great help this week. <img src='http://www.ericnagel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=wjKGgQ8oZc4:opBJBn5jq2c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=wjKGgQ8oZc4:opBJBn5jq2c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=wjKGgQ8oZc4:opBJBn5jq2c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=wjKGgQ8oZc4:opBJBn5jq2c:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=wjKGgQ8oZc4:opBJBn5jq2c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=wjKGgQ8oZc4:opBJBn5jq2c:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/running-for-boobs.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Follow-up on Datafeeds Podcast</title>
		<link>http://www.ericnagel.com/2010/03/follow-up-on-datafeeds-podcast.html</link>
		<comments>http://www.ericnagel.com/2010/03/follow-up-on-datafeeds-podcast.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 14:23:27 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[both sides of the tracks]]></category>
		<category><![CDATA[Datafeeds]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1192</guid>
		<description><![CDATA[			
				
			
		
I was listening to the &#8220;both sides of the tracks&#8221; podcast about Sports Marketing, Datafeeds and Traffic Geyser that Jason, Joe &#038; I recorded earlier this week,  and realized I forgot a point that I wanted to cover.
Joe was talking about a custom script he had written which generated tens of thousands of HTML [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Ffollow-up-on-datafeeds-podcast.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Ffollow-up-on-datafeeds-podcast.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I was listening to the &#8220;<a href="http://geekcast.fm/archives/category/both-sides-of-the-tracks/" target="_blank" title="both sides of the tracks">both sides of the tracks</a>&#8221; podcast about <a href="http://geekcast.fm/archives/sports-marketing-datafeeds-and-traffic-geyser/" target="_blank" title="Datafeed podcast">Sports Marketing, Datafeeds and Traffic Geyser</a> that Jason, Joe &#038; I recorded earlier this week,  and realized I forgot a point that I wanted to cover.</p>
<p>Joe was talking about a custom script he had written which generated tens of thousands of HTML pages on his server (one per product). We then jumped into PopShops and DataFeedr, completely skipping over how I handle datafeeds! So I&#8217;m writing this blog post to outline another solution.</p>
<p>By using .htaccess, PHP and a database, you can save the datafeed in your MySQL database and use a single PHP file with some .htaccess magic to make it appear as though you have thousands of pages on your site.</p>
<p>The basic concept is you&#8217;ll have a URL, such as mydomain.com/kabusecha-plum-123.html but that file does not exist on your server! Instead, .htaccess intercepts the request, and rewrites it to a dynamic PHP file (item.php). The .htaccess will look like:</p>
<pre class="brush: plain;">RewriteEngine On
RewriteRule (.*)\-([0-9]+).html$ item.php?nItemID=$2 [L]</pre>
<p>What this does is finds any requests for a file that ends in -##.html (dash, any number, dot html) and tells the server what the user really meant was item.php?nItemID=## (whatever that number was). Now your item.php file connects to the database, pulls up record $_GET['nItemID'] and inserts that information in your template.</p>
<p>Now when you have to update your template, you update just the item.php file, and all of your “.html” files are automatically updated!</p>
<p>I&#8217;m in talks with <a href="http://teamloxly.com/" target="_blank">Loxly</a> on coming up with a full case study on how to effectively use datafeeds for an affiliate website.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=xs3ZNBIdex0:CW_RzstgOB4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=xs3ZNBIdex0:CW_RzstgOB4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=xs3ZNBIdex0:CW_RzstgOB4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=xs3ZNBIdex0:CW_RzstgOB4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=xs3ZNBIdex0:CW_RzstgOB4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=xs3ZNBIdex0:CW_RzstgOB4:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/follow-up-on-datafeeds-podcast.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Got My Panties.com In A Bunch</title>
		<link>http://www.ericnagel.com/2010/03/got-my-panties-com-in-a-bunch.html</link>
		<comments>http://www.ericnagel.com/2010/03/got-my-panties-com-in-a-bunch.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:44:17 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[bonus]]></category>
		<category><![CDATA[both sides of the tracks]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[panties.com]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1182</guid>
		<description><![CDATA[			
				
			
		
There&#8217;s not much worse than screwing an affiliate out of a bonus he/she earned. If you&#8217;re going to do this, don&#8217;t get caught red handed. Not like panties.com did.
I mentioned panties.com&#8217;s contest in the Feb-1 both sides of the tracks podcast, &#8220;Jason Retires, Contests &#038; Buffalo&#8220;. Their bonus was quite simple:
We are so confident you&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fgot-my-panties-com-in-a-bunch.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F03%2Fgot-my-panties-com-in-a-bunch.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.motivatedphotos.com/?id=63516" target="_blank"><img src="http://www.ericnagel.com/wp-content/uploads/2010/03/panties-com1.jpg" alt="Panties.com - Back at ya!" title="Panties.com - Back at ya!" width="250" height="313" class="blogimage left" /></a>There&#8217;s not much worse than screwing an affiliate out of a bonus he/she earned. If you&#8217;re going to do this, don&#8217;t get caught red handed. Not like <a href="http://www.clubcouponcode.com/panties-com-m910.php" title="panties.com coupon code">panties.com</a> did.</p>
<p>I mentioned panties.com&#8217;s contest in the Feb-1 <a href="http://geekcast.fm/archives/category/both-sides-of-the-tracks/" target="_blank">both sides of the tracks podcast</a>, &#8220;<a href="http://geekcast.fm/archives/jason-retires-contests-buffalo/" target="_blank">Jason Retires, Contests &#038; Buffalo</a>&#8220;. Their bonus was quite simple:</p>
<blockquote><p>We are so confident you&#8217;ll make a sale that we&#8217;ll pay you $50 if you put one of our new panties.com banners on your website and do not make a sale by February 28th!</p></blockquote>
<p>So I placed the banner, and emailed the program manager on Mon, Jan 25, 2010 at 4:44 PM. On Mon, Jan 25, 2010 at 4:59 PM, Lila (the program manager) got back to me. Checking the server access logs, there were 3 IP&#8217;s that accessed this page on that day: myself, my server, and 199.120.67.39 (Lila at panties.com)</p>
<pre class="brush: plain;">199.120.67.39 - - [25/Jan/2010:16:52:55 -0500] &quot;GET /panties-com-m910.php HTTP/1.1&quot; 200 14201 &quot;http://www.clubcouponcode.com/&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)&quot;</pre>
<p>Today I was thinking to myself that I didn&#8217;t make a sale (what a shame) and I need to contact her for my $50 bonus. So I logged into <a href="http://www.ericnagel.com/out.php?q=shareasale" target="_blank">ShareASale</a>, checked my stats (just to be sure) and imagine my surprise when I saw I made a sale! Yeah! A $48 sale means $7.20 for me!</p>
<p>What was strange, however, was the sale occurred at 02/28/2010 06:09:55 PM – just hours before the bonus period was ending. So again I turned to my trusty server access logs and found the following:</p>
<pre class="brush: plain;">199.120.67.39 - - [28/Feb/2010:18:05:41 -0500] &quot;GET / HTTP/1.1&quot; 200 24842 &quot;-&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)&quot;
199.120.67.39 - - [28/Feb/2010:18:06:01 -0500] &quot;GET /panties-com-m910.php HTTP/1.1&quot; 200 11364 &quot;http://www.clubcouponcode.com/&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)&quot;
199.120.67.39 - - [28/Feb/2010:18:06:39 -0500] &quot;GET /go/merchant.php?nMerchantID=910 HTTP/1.1&quot; 200 955 &quot;http://www.clubcouponcode.com/panties-com-m910.php&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)&quot;</pre>
<p>Lila went right to my homepage, clicked on the merchant page, clicked on the link to set the cookie, and bought something nice for herself. She felt that it was cheaper for her to pay a $7.20 commission rather than a $50 bonus. But she failed to realize the implications of me tracking this down.</p>
<p>What a shallow thing to do. If you don&#8217;t want to pay a bonus, don&#8217;t put it out there. Instead, I feel tricked to have placed your banner on my site, and will make sure I spread the word how you ripped me off.</p>
<p>Anyone else participate in the panties.com February bonus program? Did you get your bonus, or did you end up making a sale on the last day, too?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=sERAYtTbV2k:euyi4HGVuRs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=sERAYtTbV2k:euyi4HGVuRs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=sERAYtTbV2k:euyi4HGVuRs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=sERAYtTbV2k:euyi4HGVuRs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=sERAYtTbV2k:euyi4HGVuRs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=sERAYtTbV2k:euyi4HGVuRs:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/03/got-my-panties-com-in-a-bunch.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Affiliate Meetup in Buffalo</title>
		<link>http://www.ericnagel.com/2010/02/affiliate-meetup-in-buffalo.html</link>
		<comments>http://www.ericnagel.com/2010/02/affiliate-meetup-in-buffalo.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 21:58:33 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[both sides of the tracks]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1178</guid>
		<description><![CDATA[			
				
			
		

On Saturday, March 27th we&#8217;ll be hosting an affiliate meetup at the Pearl Street Grill &#038; Brewery at 1pm. Jason Rubacky from ShareASale (and my co-host on &#8220;both sides of the tracks&#8220;) is coming into town, and we&#8217;re inviting affiliates and merchants to come &#038; talk shop.
Details can be found on ABestWeb.com
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F02%2Faffiliate-meetup-in-buffalo.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F02%2Faffiliate-meetup-in-buffalo.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.ericnagel.com/wp-content/uploads/2010/02/pearl-street.png" alt="Pearl Street Grill &amp; Brewery" title="Pearl Street Grill &amp; Brewery" width="300" height="83" class="alignnone size-full wp-image-1179" /></p>
<p>On Saturday, March 27th we&#8217;ll be hosting an affiliate meetup at the <a href="http://www.pearlstreetgrill.com/" target="_blank">Pearl Street Grill &#038; Brewery</a> at 1pm. Jason Rubacky from <a href="http://www.ericnagel.com/out.php?q=shareasale">ShareASale</a> (and my co-host on &#8220;<a href="http://geekcast.fm/archives/category/both-sides-of-the-tracks/" target="_blank">both sides of the tracks</a>&#8220;) is coming into town, and we&#8217;re inviting affiliates and merchants to come &#038; talk shop.</p>
<p>Details can be found on <a href="http://forum.abestweb.com/showthread.php?p=987410">ABestWeb.com</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=gThVeesjnqE:CL2Zwrp2cPU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=gThVeesjnqE:CL2Zwrp2cPU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=gThVeesjnqE:CL2Zwrp2cPU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=gThVeesjnqE:CL2Zwrp2cPU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=gThVeesjnqE:CL2Zwrp2cPU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=gThVeesjnqE:CL2Zwrp2cPU:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/02/affiliate-meetup-in-buffalo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking ShareASale Commissions with Prosper202</title>
		<link>http://www.ericnagel.com/2010/01/shareasale-prosper202.html</link>
		<comments>http://www.ericnagel.com/2010/01/shareasale-prosper202.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 19:46:26 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Prosper202]]></category>
		<category><![CDATA[ShareASale]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1165</guid>
		<description><![CDATA[			
				
			
		
Prosper202 is a powerful affiliate marketing tracking software package, with the ability to give you your revenue, cost, and ROI on your PPC campaigns. But the true power is shown when you automate as much as possible.
I&#8217;ve previously written how to use the ShareASale API, but left it up to you to fill in the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F01%2Fshareasale-prosper202.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F01%2Fshareasale-prosper202.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.ericnagel.com/wp-content/uploads/2010/01/shareasale-prosper202.png" alt="" title="Shareasale + Prosper202" width="225" height="130" class="blogimage left" /><a href="http://prosper.tracking202.com/apps/" target="_blank">Prosper202</a> is a powerful affiliate marketing tracking software package, with the ability to give you your revenue, cost, and ROI on your PPC campaigns. But the true power is shown when you automate as much as possible.</p>
<p>I&#8217;ve previously written <a href="http://www.ericnagel.com/2009/11/shareasale-api.html" title="how to use the ShareASale API ">how to use the ShareASale API</a>, but left it up to you to fill in the blanks. In this example, I&#8217;m going to show you how to automatically get your ShareASale revenues to post back to Prosper202.</p>
<p>Before we begin, make sure you&#8217;re read the <a href="http://www.ericnagel.com/2009/11/shareasale-api.html" title="how to use the ShareASale API ">first post I wrote</a>, or else this one will go by quickly. What this script does is fetches your sales from the previous day and submits the values and SIDs to your Prosper202 installation.</p>
<pre class="brush: php;">
$dYesterday = date(&quot;m/d/Y&quot;, time()-86400);

$cURL = 'https://shareasale.com/x.cfm?action=activity&amp;affiliateId=yourid&amp;token=yourtoken&amp;dateStart=' . $dYesterday . '&amp;dateEnd=' . $dYesterday . '&amp;XMLFormat=0';
// $cURL = 'sas.csv';

$fp = fopen($cURL, &quot;r&quot;);
if ($fp) {
	$rsMap = array();
	while (empty($rsMap) &amp;&amp; (($rsHeadings = fgetcsv($fp, 1000, &quot;|&quot;)) !== FALSE)) {
		if (md5(serialize($rsHeadings)) != '5b448a7bdbeea0be7d7f758f5f8ee90b') {
			// echo(md5(serialize($rsHeadings)) . &quot;\n&quot;);
			// print_r($rsHeadings);

			while (list($nIndex, $cColumn) = each($rsHeadings)) {
				// echo(&quot;$cColumn =&gt; $nIndex&lt;br /&gt;\n&quot;);

				$cColumn = ereg_replace(&quot;\(.+\)&quot;, &quot;&quot;, $cColumn);

				$rsMap[$cColumn] = $nIndex;
			} // ends while (list($nIndex, $cColumn) = each($rsHeadings))
			// print_r($rsMap);
		} // ends
	}

	/*
	Array
	(
		[Trans ID] =&gt; 0
		[User ID] =&gt; 1
		[Merchant ID] =&gt; 2
		[Trans Date] =&gt; 3
		[Trans Amount] =&gt; 4
		[Commission] =&gt; 5
		[Comment] =&gt; 6
		[Voided] =&gt; 7
		[Pending Date] =&gt; 8
		[Locked] =&gt; 9
		[Aff Comment] =&gt; 10
		[Banner Page] =&gt; 11
		[Reversal Date] =&gt; 12
		[Click Date] =&gt; 13
		[Click Time] =&gt; 14
		[Banner Id] =&gt; 15
	)
	*/
	while (($rsStatData = fgetcsv($fp, 1000, &quot;|&quot;)) !== FALSE) {
		// print_r($rsStatData);
		if (
			(md5(serialize($rsDeal)) != '5b448a7bdbeea0be7d7f758f5f8ee90b') &amp;&amp;
			($rsStatData[$rsMap['Commission']] &gt; 0) &amp;&amp;
			!empty($rsStatData[$rsMap['Aff Comment']]) &amp;&amp;
			($rsStatData[$rsMap['Aff Comment']] != &quot;none&quot;)
			) {

			$cPostback = 'http://yourdomain.com/tracking202/static/gpb.php?amount=' . urlencode($rsStatData[$rsMap['Commission']]) . '&amp;subid=' . urlencode($rsStatData[$rsMap['Aff Comment']]);
			// echo(&quot;$cPostback\n&quot;);
			$fpPostback = @fopen($cPostback, &quot;r&quot;);
			if ($fpPostback !== false) {
				fclose($fpPostback);
			} // ends

		} // ends if (!empty($rsDeal))

	} // ends while (($data = fgetcsv($fp, 1000, &quot;|&quot;)) !== FALSE)
	fclose($fp);
} // ends if ($fp)
</pre>
<p>The script creates a URL to grab yesterday&#8217;s stats, creates an array of the column headers ($rsMap), loops through the rest of the stats and if:</p>
<ul>
<li>the line isn&#8217;t empty</li>
<li>the Commission is greater than 0.00</li>
<li>there is a SID</li>
<li>the SID is not &#8220;none&#8221;</li>
</ul>
<p>then it pings your Prosper202 installation and updates the database with the commission for that SID.</p>
<p>Most of the code in this script is just reading the CSV file and getting the column names in place. The real work is done in lines 55-60.</p>
<p>Remember you&#8217;re limited to 200 API calls per month with ShareASale, so schedule this script to run daily (via cron).</p>
<p>If you have any questions, please leave them in the comments. And if you haven&#8217;t done so already, <a href="http://www.ericnagel.com/out.php?q=shareasale" target="_blank">signup with ShareASale</a>!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=2eBx137__yc:-cOi6h3D0Fk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=2eBx137__yc:-cOi6h3D0Fk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=2eBx137__yc:-cOi6h3D0Fk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=2eBx137__yc:-cOi6h3D0Fk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=2eBx137__yc:-cOi6h3D0Fk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=2eBx137__yc:-cOi6h3D0Fk:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/01/shareasale-prosper202.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Jim Kukral Kicked My A** For 40 Minutes</title>
		<link>http://www.ericnagel.com/2010/01/jim-kukral-kicked-my-a-for-40-minutes.html</link>
		<comments>http://www.ericnagel.com/2010/01/jim-kukral-kicked-my-a-for-40-minutes.html#comments</comments>
		<pubDate>Thu, 21 Jan 2010 20:09:11 +0000</pubDate>
		<dc:creator>Eric Nagel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Affiliate Summit]]></category>
		<category><![CDATA[asw10]]></category>

		<guid isPermaLink="false">http://www.ericnagel.com/?p=1158</guid>
		<description><![CDATA[			
				
			
		
I attended Jim Kukral&#8217;s session at Affiliate Summit entitled, &#8220;How to get Motivated for Success&#8221; only to hear Jim speak. He has a natural stage presence, and I was going simply to listen to a great public speaker. I didn&#8217;t expect to get anything out of the session, but Jim definitely proved me wrong.
Jim&#8217;s first [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; text-align: center">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F01%2Fjim-kukral-kicked-my-a-for-40-minutes.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ericnagel.com%2F2010%2F01%2Fjim-kukral-kicked-my-a-for-40-minutes.html&amp;source=esnagel&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I attended <a href="http://twitter.com/JimKukral" target="_blank">Jim Kukral</a>&#8217;s session at <a href="http://www.ericnagel.com/out.php?q=affiliatesummit" target="_blank">Affiliate Summit</a> entitled, &#8220;How to get Motivated for Success&#8221; only to hear Jim speak. He has a natural stage presence, and I was going simply to listen to a great public speaker. I didn&#8217;t expect to get anything out of the session, but Jim definitely proved me wrong.</p>
<p>Jim&#8217;s first shot at the audience was: get over yourself. Lose your ego. The reason I&#8217;m bothering to bring this up is because that&#8217;s how I found my success in the affiliate industry. For years, I thought I knew how to be a successful affiliate, and I didn&#8217;t listen to anyone. Then, frustrated with my failures (more on this later) and presented with a training opportunity with Jeremy Palmer, I left behind everything I thought I knew and followed Jeremy&#8217;s training. 1-1/2 years later, I was a full-time affiliate marketer.</p>
<p>Next, you need to produce, or perish. Get rid of distractions: turn off Twitter, Gmail, and your phone and get some real work done. Stop reading my blog (when you&#8217;re done with this article &#038; left a comment) and get back to work! A tool I use for this is <a href="http://www.online-stopwatch.com/" target="_blank"> online-stopwatch.com</a>. I tell myself, I&#8217;m going to do &#8220;X&#8221; for 20 minutes, and that&#8217;s all I do. When something else pops into my head, I write it down, and get back to the task at hand. Focus.</p>
<p>You need to get out there &#038; do something. Don&#8217;t worry about what others are doing – worry about what you&#8217;re doing. You need to work your butt off. At this part of the session, Jim called me out, but in a good way. Yeah, I work hard. I&#8217;m up between 4:30 and 5:00 in the morning, I hit the gym (while listening to <a href="http://geekcast.fm/" target="_blank">GeekCast.fm</a> on my iPod), then come home &#038; help get the kids off to school, work hard all day, spend some time with the family in the evening, and often get back online to answer some emails or plan tomorrow&#8217;s to-do list. Even right now, I&#8217;m writing this blog post while flying home.</p>
<blockquote><p>Doers get what they want, everyone else gets what they get &#8211; Jim Kukral</p></blockquote>
<p>What&#8217;s your goal? Write it down, and work on it every day.</p>
<p>Besides being hard workers, Jim and I have something else in common: we&#8217;re failures. But, we&#8217;re not losers. Failures fail hard, fail fast, and try again. Losers give up.</p>
<p>Get rid of the negative people in your life. It&#8217;s hard when they&#8217;re family, but believe me, you&#8217;ll feel better about what you&#8217;re doing, you&#8217;ll be more focused, and you&#8217;ll get more done.</p>
<p>Jim ended his session by asking the audience what they&#8217;re going to do in the next 6 months. He challenged people to come up to him and tell him what they&#8217;re going to do. And at <a href="http://www.ericnagel.com/out.php?q=ase" target="_blank">Affiliate Summit East</a> in New York, Jim wants to hear back from them. </p>
<p>I&#8217;ll be at ASE10 in NY, too – what are you going to have done? Tell me in the comments, or send me an email if you don&#8217;t want to share with the world. How can I help you get there?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ericnagel?a=HBjrVJiIODI:h_SFaqBrJRs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=HBjrVJiIODI:h_SFaqBrJRs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ericnagel?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=HBjrVJiIODI:h_SFaqBrJRs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=HBjrVJiIODI:h_SFaqBrJRs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ericnagel?a=HBjrVJiIODI:h_SFaqBrJRs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ericnagel?i=HBjrVJiIODI:h_SFaqBrJRs:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.ericnagel.com/2010/01/jim-kukral-kicked-my-a-for-40-minutes.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
