A Twitter Service for Twitter Downtime

If you haven’t seen or heard about the Twitter effect then listen up. People are addicted to Twitter and will do anything for tweets! As you all know twitter has not had the greatest uptime in the past month or so.  However, this hasn’t stopped people from leaving.  People are still signing up for twitter accounts everyday.  Now there is a new service called Twiddict which allows you to keep tweeting when the twitter service is down.  Once twitter comes back online Twiddict will send your tweets over to twitter.  This just goes to show you the dedication of the twitter followers.  People are making services for a service that is never available.  That’s Crazy!  I have said it before.  All twitter needs is a few big tech gurus such as Robert Scoble , Kevin Rose , Leo Laporte , and Jason Calacanis to move to another service and twitter will be dead.  The followership that these people have is a huge!

As for today we will have to see how twitter reacts to WWDC .  Stay tuned.

Getting Ready for Google App Engine

Funkatron.com has a really good article on a Google App Engine from a PHP developer’s perspective.  Very well written and love the sense of humor.  I think the best line in the article is

Otherwise, Python is a good fit for me philosophy-wise, because it’s totally the anti-Perl, lacking goofy magic characters and 1000 ways of doing the same thing. I can’t stand languages where “~^s” means “find all numbers that start with the letter ‘s’, add them, multiply them by 75, and then post the result to Twitter”. I’m not freakin’ R2D2 here.

I personaly haven’t tried out Google App Engine but will here in the near future.  I have to freshen up Python skills.  I definatly belive in what funkatron says about learning more than one coding language.

Plus, getting hung up on one language is a sure way to be a boring dude who gets caught up in lame religious language wars.

CodeIgniter Logging Library

CodeIgniter (CI) has a very good logging class but there is one thing in the class that I am not to thrilled with, The way it writes the logs. CI logging has 5 levels;

0 = Disables logging, Error logging TURNED OFF
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages

In the configuration file if you set the level at 3 you will get info messages (messages in the logs that you create) and everything that is less than 3. So you will get info, debug, and error messages. This will fill up your log files quite rapidly. On a project I am working on now one of the requirements is to log usage in log files. So I had to modify the logging class to log only Info messages and not everything less than what you set the threshold to. This was quite easy. I am not sure how many people want to do this but here is how you would go about modifying it in your code.

The file to edit is located in CI -> system -> libraries -> Log.php

On line 87 or around line 87 (give or take a line or two) you should find this line of code

if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))

Replace it with

if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] != $this->_threshold))

That’s It! You should now only get the Info Messages or what ever your threshold is set to in your config file. That configuration file is located in CI -> system -> application -> config -> config.php

Look for the section with the heading of “Error Logging Threshold”

As always if you have any question leave a comment.