Monitor your affiliate stats through Twitter

Are you intrigued? Follow this little tutorial and you will soon be getting SMS from Twitter, with your latest Adsense or Peakclick stats (more coming soon!), for FREE. All you need to do is run this little PHP script I made.

Step 1. Create a new Twitter account for your server
Choose a long unique name so nobody types in your account name by accident.
twitter free sms #1

Step 2. Invite your regular Twitter account
If you didn't have a Twitter account until 'Step 1', make another account now. Go to the invite friends page and type in the e-mail adress of your regular account. Your regular account will get invited to be your server account's friend. (important!)
twitter free sms #2

Step 3. Change the privacy settings of the server account
Now that you have created an account for your server, log into the account and go to "Settings -> Account". On that page, scroll down and until you see the checkbox "Protect my updates", check it. As your server account's updates will contain your affiliate stats, you only want to allow friends to see them (your only friend will be your regular account).
twitter free sms #3

Step 4. Activate mobile notification on regular account
Log into your regular Twitter account (not the server account created in 'Step 1') and go to "Settings > Phone & IM" and activate the "Mobile Phone" notification.

Step 5. Install the php script
Almost there! Now you have to upload the Twitter class and any of the modules on your server (Adsense and Peakclick available, more to come). Don't forget to rename the files to '.php'. After you get that done, you need to change the user/pass settings in each file. The twitter.class.php needs your the user/pass for the server account in 'Step 1'. The Adsense and Peakclick modules also need the user/pass combos for Adsense and Peakclick.

Permalink to this Snippet
Permalink to this Snippet
Permalink to this Snippet
download them all in a tarball

Step 6. Set the cronjobs
Go to your shell/Cpanel/whatever and install a cronjob. I am not going to explain how cronjobs work here, as it's rudimentary and you can get that info easily elsewhere.
So here's just a small example that executes the script every hour on the 58th minute:

58 * * * * /var/www/twitter.class.php

...or every 20 minutes:

*/20 * * * * /var/www/twitter.class.php

OPTIONAL: Step 7. Make your own module
I plan on releasing more modules soon but there's nothing to stop you for making your own. You need to know how to login to a site and run a simple regex, or if you are brave enough, look in the existing source, open a new tab with php.net and start hacking. If you make a cool module let me know and I will publish it. However, don't start asking me how to make XYZ module.

- Have a nice day.

Activity

6 total comments, leave your comment or trackback.
  1. Don’t you risk to loose your primary/regular Twitter account by abusing the system?
    I would go so far, as to create two fake accounts and use them for this purpose.

  2. why should you lose your account? imagine you have 50 friends and 20 updates an hour.. you would get 20 sms’s per hour.
    … and for the germans here again: !IT’S FREE!
    !!!you don’t pay for the sms you receive!!!

  3. Great idea!
    If you are using iGoogle, you should also try this:

    http://trix.pl/2007/05/24/get-your-peakclick-earnings-on-igoogle-homepage/

    It’s a widget showing your current PeakClick’s Stats on iGoogle HomePage.

  4. very nice idea!
    i test it now…
    thx

  5. Hadeed
    Jul 19th 2007

    Wow thats fuckin amazing. This is one of the most creative blogs ive read. Thanks

  1. May 13th 2007

Leave a Reply


Search

The archives run deep. Feel free to search older content using topic keywords.