Mar
Automated Data Integration
One of the aspects of BHSEO with Affiliate Marketing in mind is data integration. This could be from RSS feeds to straight XML files, even just research on one product and finding offshoots yourself. I haven’t given away any “stunning” code lately (or any for that matter …) so I figured I’ll release a little [...]
One of the aspects of BHSEO with Affiliate Marketing in mind is data integration. This could be from RSS feeds to straight XML files, even just research on one product and finding offshoots yourself. I haven’t given away any “stunning” code lately (or any for that matter …) so I figured I’ll release a little source here to help you all along with automation. I’m going to keep the post here short and sweet, and let you all use your imagination with the code itself but I’ll give you a few unique uses for it.
Before I start telling you how to use it, here’s what you need – and what you may want to have.
What you NEED:
- PHP 5
- WordPress
- Desire to Learn and Think Abstractly
What you may want (and will help …)
Here’s a few things to think about with the code …
- This uses XMLRPC so will work with Splog Ping Crawl
- Can be integrated with Google Blog Search for avoiding duplicate content penalties *hint hint*
- Can be used full steam, throttled back, etc.
Now I’m going to admit this right now. It’s 3:15 in the morning right now and I’m tired as hell – but I did want to get this out because I promised a few of you I would get it done. So please forgive me if the code itself isn’t so clean, but my goal is purely to prove it can be done – and it’s not too hard to do either. My goal here on Contempt is to help you re-think about Automation in general and help you create ways to make your online endeavours much easier. For some Automation in general is considered blackhat, and to those people I’d like to remind them to wake up. Everything in life is getting automated whether you like it or not. Personally in my opinion blackhat seo is nothing other than a label for “holy shit that’s automatic”. Usually this is by people that don’t know how to do it, or have a problem looking at their newfound power and ability and can’t control it enough to not go overboard. This usually results in “i can spam links, go buy viagra go!”. It’s true – the same methods that I use sometimes could be used as an attempt to rank for buy viagra – and you know what, I’m sure with some time I could – but why? I want long term residual income off my endeavours, and right now I’m doing enough research to plan the methods down to successful ones so I don’t make stupid mistakes over and over on sites I’ve invested money into.
Anyway – like I said – It’s 3:30 so I’m ranting. Let’s move on. Here’s my overall goal with this post. In the following code I’m going to show you very simple code to extract information from a CSV, and how to format it into a good post for a review or shopping site. Here’s how you do that using PHP5 ..
<?php
$row = 1;
$handle = fopen("datafeed.csv", "r");
while (($data = fgetcsv($handle, 5000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
for ($c=0; $c < $num; $c++) {
echo "$c - ".$data[$c] . "<br />\n";
}
if($row > 5)
die();
}
fclose($handle);
?>I wrote this up quick to view the first 5 rows in a datafeed file. This’ll allow me to look at (with most feeds) the names of the fields, and then the first 4 lines to see sample data. This is an easy way to sort out “oh #5 is the URL” and “#10 is the image”. Next we’ll work on a template file so that when we post it to wordpress it’ll at least look decent. I’m not going to say my HTML is stellar, but I’m doing this as I write this so it’s purely an example. Here’s an example with a quick table, 2 sections – image and purchase URL on the left, description on the right … and of course, phpbay under it haha – Contempt style!
<?php
$row = 1;
$handle = fopen("datafeed.csv", "r");
while (($data = fgetcsv($handle, 5000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
$purchase_url = $data[8];
$image = $data[25];
$desc = $data[12];
$title = $data[16];
$var = "<center><table width=\"50%\"><tr><td>
<a href=\"$purchase_url\"><img src=\"$image\">
</a></td><td>$desc</td></tr></table><br><br>
Used Items:<br><br>[phpbay]$title, 10[/phpbay]";
echo $var."<BR><BR><BR><BR>";
if($row > 5)
die();
}
fclose($handle);
?>And just so you all have this, here’s the function that I use to post to WordPress blogs with XMLRPC. The external libs I’ll throw into a RAR (click here). Here’s the function:
<?php
function post_to_blog($url, $pass, $title, $posttext, $nick = null)
{
$xmlrpcurl = $url;
$client = new xmlrpc_client($xmlrpcurl);
$params[] = new xmlrpcval("n/a");
$params[] = new xmlrpcval("n/a");
if(isset($nick))
$params[] = new xmlrpcval("$nick"); //your wordpress login
else
$params[] = new xmlrpcval("Admin"); //your wordpress login
$params[] = new xmlrpcval("$pass"); //your wordpress password
$params[] = new xmlrpcval(
"<title>$title</title>". //the title of your post
"<category>1</category>". //the category
$posttext); //the body
$params[] = new xmlrpcval("true"); //publish now = true
$msg = new xmlrpcmsg("blogger.newPost",$params);
$response = $client->send($msg);
}
?>So yeah, when we put them together we have this…
<?php
$row = 1;
$handle = fopen("datafeed.csv", "r");
while (($data = fgetcsv($handle, 5000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
$purchase_url = $data[8];
$image = $data[25];
$desc = $data[12];
$title = $data[16];
$var = "<center><table width=\"50%\"><tr><td>
<a href=\"$purchase_url\"><img src=\"$image\">
</a></td><td>$desc</td></tr></table><br><br>
Used Items:<br><br>[phpbay]$title, 10[/phpbay]";
post_to_blog("http://myblog.com/xmlrpc.php", "password", $title, $var);
if($row > 5)
die();
}
fclose($handle);
function post_to_blog($url, $pass, $title, $posttext, $nick = null)
{
$xmlrpcurl = $url;
$client = new xmlrpc_client($xmlrpcurl);
$params[] = new xmlrpcval("n/a");
$params[] = new xmlrpcval("n/a");
if(isset($nick))
$params[] = new xmlrpcval("$nick"); //your wordpress login
else
$params[] = new xmlrpcval("Admin"); //your wordpress login
$params[] = new xmlrpcval("$pass"); //your wordpress password
$params[] = new xmlrpcval(
"<title>$title</title>". //the title of your post
"<category>1</category>". //the category
$posttext); //the body
$params[] = new xmlrpcval("true"); //publish now = true
$msg = new xmlrpcmsg("blogger.newPost",$params);
$response = $client->send($msg);
}
?>So there you have it. Loading a CSV file into wordpress with a template, to start up your own affiliate-based eStore. Once again I thank you for joining me on this Code-Enriched version of Contempt Can’t Sleep. I figured keeping this short and sweet would be more beneficial than posting with fluff and other dumb crap to try to impress you.
The reason I recommended phpBay is because of the fact that it’ll allow you to post direct links from PJN (PepperjamNetwork) or EPN (eBay Partner Network) with the new items. New & Used. The WFReview will actually allow people to rate the items, comment on them with star ratings, and post random generated ratings on them to make the site look like a good well traffic’d site. A must have for larger scale op’s and just fun in general! This also is an easier way to automate the CSV to WordPress operation. So once again, those links are in this paragraph if you wanted to try those out.
I hope you enjoyed the read as well as the Contempt experience, and I hope it’s worthy enough to have you pull the trigger on subscribing to the feed!
Jan
I know one thing that I deal with all the time is duplicate content penalties. If you do even basic forms of blackhat you’re heard of automation of blogs, scraping content, RSS feed’s and the like. Everyone with half a brain cell knows that there are duplicate content penalties in Goog’s algorithm that prevent scraper [...]
I know one thing that I deal with all the time is duplicate content penalties. If you do even basic forms of blackhat you’re heard of automation of blogs, scraping content, RSS feed’s and the like. Everyone with half a brain cell knows that there are duplicate content penalties in Goog’s algorithm that prevent scraper sites from gaining too well of ranks. But the real question is, to what severity does Google evaluate your content as “duplicate”?
A while ago (we’re talking about 2 years out) when I was just getting started in Blackhat SEO, Brad101 from WF introduced me to something that I like to call the 30% rule. He taught me that if 30% of the content on the page is unique, that you should pass most of the duplicate content penalties. At first this made a little sense but not enough to try, then I started to dig a little deeper. How exactly do news sites get away with it? Most of news sites is duplicate content anyway. Is it a per-domain uniqueness factor? If so, the 30% rule would make it work great! What if it was a per-page factor (which there’s enough proof already that this is most likely the case) – in which the 30% would work great as well again!
Once again, if duplicate content was so harsh that it was per paragraph or something – then news sites would be penalized all over. A lot of people would read that and say “but usually the backlink back to the author clears penalties” – ta-da! Think about that. Could that possibly be why autoblogs work so well *gasp*?
If you post duplicate content and link back to the author, most of the time it’s a win/win. The author is -usually- happy due to a backlink, you’re happy because you may actually rank with your authority over the original site, and you can do this on mass quantities.
There’s a few tricks and tips you’ll find out as you mess more and more with these. One of the things that I’ve found quite interesting is that links themselves count as content, yet don’t have duplicate content penalties. I’m not obviously 100% sure on that one, but my sites wouldn’t be doing so well otherwise. If you read my EPN experiment I was able to send around 55,000 total users from Google to Ebay Partner Network via my splogs. This was actually click thru’s to EPN, not just to my sites. Probably on my sites alone I pulled a little over 100,000 uniques/month which equates to almost 3500 uniques/day. Not bad for a total setup time of a little under an hour, huh?
Don’t always assume that Google is going to fuck you. You shouldn’t be afraid of the Algorithm, you should be afraid of the manual reviews. This is just my opinion, of course – Google is getting smarter by the day. Have fun, and try to stay ahead of the curve!





(9 votes, average: 3.89 out of 5)


