Get latest tweet without API key in pure PHP

Update: There were several serious shortcomings in the code below that have been resolved (Twitter #failwhale, control characters in Tweets, greedy regex).

I’ve been working on a backend for a website and needed a way to show the latest Twitter update. There is plenty of code floating around that does this, but I couldn’t find anything simple that preserved formatting, like hyperlinks to @replies, e-mail addresses, URLs, etc. Anything that did was either very bulky (lots of source files) or required a Twitter API key…so I wrote my own, self-contained in a single function call.
Continue reading

Starting an Android Service at Device Boot

I haven’t been messing around with the Android SDK for too long but I’ve already found some things that I think are worth sharing. Android has a concept of Services, or a process that can sit in the background and run a task without needing to interact with the user. There’s plenty of reasons why a Service might not need to be running all the time (say an alarm clock app with no alarms scheduled), but for the most part, Services need to be started at boot. Here’s how, tested from Android 1.5 to 2.2, since no other example I could find on the Internet was complete for this ever-changing SDK.
Continue reading

Using iAds While Maintaining Backwards Compatibility

iAds are going to be all over apps in the AppStore in just a few short weeks as developers try to make some money from the average iPhone user. The only problem is that you won’t make any money unless the user is running iOS 4.0. Versions of the iOS prior to this don’t have the iAd framework and therefore can’t display ads. So what’s a developer who wants a few clams to do?
Continue reading


UPDATE: Well, glad I spent the time preparing this…Apple decided to post it on their site…

Happy iPad release day! Now that the iPad NDA has been been lifted, there are a lot of topics I’d like to write about. iPhone OS 3.2 brings about several new features including a new UIViewController called UISplitViewController. This allows you to, in landscape orientation, have two UIViewContollers side-by-side. On device rotation to portrait orientation, the left-most UIViewController (the “rootViewController”) disappears from view and is replaced by a UIBarButtonItem in the right-most UIViewController (the “detailViewController”). Continue reading

Application cannot be executed. The file is infected.

One of the worst things about being a “tech guy” to non-technical people is that you are constantly bombarded with questions or favors and you feel obliged to give in a large amount of the time.  It’s even worse when the knowledge of your “skill” is spread to friends and neighbors of your friends whom you don’t even know.  Most of the time, especially recently (being unemployed), I don’t so much mind helping out but people definitely take advantage. Continue reading

Graduation Day!

Well, now it’s Christmas Eve, but yesterday at 10AM I participated in the graduation ceremonies at UMBC.  Not sure how ready I am to leave that place.  On one hand, it will be nice to not have homework or projects for a bit and I can let my stress level lower dramatically.  On the other hand, now I have to drive at least two hours to see anyone I know.  With working full-time in the future, this is going to be a huge pain.  I’ve been accepted into the Masters program at UMBC and so hopefully that gives me an excuse to be on campus, but I’m also not sure that’s what I really want.

There’s really just too much going through my head right now.  I need to settle down and let it all sink in.  I need the time to do that now.

I never thought I would see this day.