brandontreb.com Tips And Resources For Software Consultants

Programming

99% of students that were in my CS degree program

99% of students that were in my CS degree program

Image taken from abtrusegoose

$13 Dollar Discount On Programming Books From Manning Publishing

manning-logo

The publishing that I’m writing the book for is having a huge Friday the 13th sale. They are offering a $13 discount on all of their books. For those of you who don’t know, Manning publishes all of the “In Action” books.

All you have to do is go to the site and enter the coupon code:

fri13

when checking out and you will get the discount. Although my book iPhone In Action 2nd Edition hasn’t been released yet, Manning has some other killer programming books for sale.

So be sure to check it out!

Money You Might Be Missing Out On – LinkShare API Integration

logo

As you may know, I am the developer of the site FreshApps.com. One thing we had been doing to make some extra money is to use Linkshare to be an affiliate for Apple.

If you don’t know, Linkshare is a service that allows you to become an affiliate of thousands of companies. You simply select one of the companies products, get the linkshare link, and put the link on your site. Now, every time someone clicks that link and makes a purchase, you will get a percentage of the revenue.

The Problem

The only problem was, we have thousands of apps and converting the links manually seemed like such a daunting process. So, as you can imagine we converted around 10 links and never looked at it again.

Well, earlier today, the designer of the site JJ Mancini, asked me to check and see if linkshare had an API. I checked it out and sure enough, they did and it was no more complex than interfacing with a URL shortening service. So, I wrote the script and within minutes, all of our downloads links were converted into something that can now make us some revenue.

The Solution

Now that I have created the script, I figured I would pretty it up and share it with you. Keep in mind, the script is stupid easy, so if I am insulting your intelligence by showing it, I apologize.

<?php
    /* linkshare.php */
 
    // Your linkshare API token
    $token = "89705XXXXd11ab28ae548bXXXX4ad6475279faXXXX65da0ec8ed77XXXXeb067";
    // Apples Merchant ID
    $mid   = "13508";
 
    $linkShareLinks = array();  
 
    // I assume links in an array of links to the app store
    foreach($links as $link) {
        $linkShareURL = "http://feed.linksynergy.com/createcustomlink.shtml?".
            "token=$token&mid=$mid&murl=$link&mt=8&buylink=yes";
        $linkShareReturn = file_get_contents($linkShareURL);
 
        if(stristr($linkShareReturn, "click.linksynergy.com")) {
            array_push($linkShareLinks,$linkShareReturn);
        } 
    }
 
    print_r($linkShareLinks);
?>

And that’s it! The variable $linkShareLinks will now contain all of the App Store links converted to your account’s linkshare url. If you have any site with that contains ads for apps in the app store (review site, developer blog, etc…), you would be crazy not to integrate with linkshare.

Give it a try, and feel free to ask questions in the comments section.

Object-oriented programming is an exceptionally bad idea which could only have originated in California.

Edsger Dijkstra

Was Jesus A Real Person? Great Article On Digg Today

The culture of Digg is generally very liberal (to say the least). That is why I was very surprised to find one of the top stories of the day entitled ”Was Jesus A Real Person?”. Obviously, the comments section of the article was full of people arguing about the matter.

I found the article to be quite well written and made a stellar case for the existence of Jesus. So whether you are a believer or not, you should check it out. Take a look for yourself and let me know what you think.

Article Link