Controlling Twitter SMS notifications through code

twitter sms

It’s not secret my current favorite tech toys are my iPhone and Twitter.

I follow several hundred people of interest, and regularly use TwitterFon Pro, TweetDeck and Twitter.com to keep up with them all. For an elite group of people I follow on twitter I choose to have their updates pushed to me via SMS (text message) to my phone.

Sometimes I’m in area where I dont have reliable service to my phone (most of the meeting rooms at my work for some reason), and Twitter will try to send me an SMS message telling me that one of my good friends just made a tweet. If Twitter cant deliver that tweet for some reason, like the phone doesnt have service, Twitter simply stops sending message to your phone. There has been many times where i have thought to myself “damn Twitter is quiet today”, then I log onto Twitter.com and see a “is you device have trouble?” error. If i don’t go check the website, I have no idea that Twitter turned off SMS updates to my phone. Twitter is cool but they aren’t cool enough to send you an email saying “Hey your phone is screwed up, we are going to stop sending you SMS message until you fix it”. Atleast then the poor bastards like me who are addicted to twitter would know what we have to do.

Because I am such a Twitter addict, I have come up with a plan to end my frustrations with this problem. The solution? Use some evil “robots” to do my bidding. I have blogged about them before, I am talking about Cron and Curl. okokok, so they aren’t evil robots they are software running on my computer.

Twitter has an awesome API (Application Programming Interface) that allows you to do all sorts of sweet things using REST based http requests, including turning on and off SMS notifications to your phone.

cURL is an application that allows you to connect to web addresses from a command line.

cron is an application that allows you run application at scheduled intervals.

Can you guess where this is all going? Here is mathematical representation for you
((Twitter API + cURL) * cron(30 minutes)) = Happy Josh Highland

I have cron run the following command every 30 minutes (replace username and password with your own of course)

/usr/bin/curl -u user:password -d device=sms http://twitter.com/account/update_delivery_device.xml

I will never need to log onto twitter to turn on my SMS notifications ever again. In the event that Twitter disables notifications to my phone, every 30 minutes my evil robots enable MS messages to my phone. At most I will have 30 minutes of down time. I can live with that.

This is a perfect example of what one of my Computer Science professors told me… “If you have to do it more then 2 times write a script to do it for you”.

Info on the new iPhone has leaked

iphonemb717

I have been keeping my ears open for rumors about the new iPhone. Earlier this week, the above image was leaked onto a mac rumors website from a chinese source.

The image above shows a new iPhone model number “MB717LL” with 32GB of Storage. If the poster’s claims are to be believed, the new iPhone will contain the following features:

  • 600MHz CPU Speed (up from 400MHz)
  • 256MB RAM (up from 128MB)
  • Digital Compass and FM
  • 3.2 megapixel camera with auto focus
  • 32GB size
  • No major changes in battery, screen and external casing.

There is no way of telling if this information is correct, but the leaked photos and  information on the unibody MacBook and MacBook Pro also came from the same Chinese website, to they have some merit in my mind.

It’s no suprise that the screen and the physical shape of the device hasnt changed, if it did, us iPhone application developers would be screwed. I think its going to be nice to have a better camera and an FM tuner.

If this is all true, its not a major leap ahead, but I will still be inline to get one. I am guessing that the device will be announced and possibly released at the WWDC (Apple Worldwide Developers Conference) in June.

I got a mac

mac_mini

As part of my 2009 new years resolutions, I’m going to write an iPhone application and launch it this year. I realized that the first quarter of the year is almost over and I haven’t made any progress on this. The biggest hurdle was the development platform. I’ve tried to install Mac OS X onto my PC several times but it never worked right, so I decided to bite the bullet and get the ball rolling, I spend my hard earned american cash dollars and bought a mac.

I weighted out all my options and decided that the lowest barrier to entry would be the mac mini. I’m not looking to completely switch to mac (yet), I’m planning on keeping my PC going strong and using the mac mini as a development platform.

I was really impressed with the packaging of the mac mini, and the form factor of the actual machine, it’s well…. mini.

macminiruler

It’s going to take a bit if time for me to get the full swing of OS X. I’ve been using windows and ubuntu for so long now that I have an expectation for application behavior, and OS X is throwing some curve balls at me  that I need to get used to. The good thing is that most of my friends, and google are helping me cope and deal with it.

I think it would help if I actually got an apply keyboard to go with it. instead of using my PC keyboard. Too bad that apple doesnt make an ergonomic keyboard like the one I use.

I’m going keep this blog updated with my switching experiance as I slowly easy into the fan boy soaked world that is Apple. iPhone app development, here I come!

iPhone 2.1 SMS Reminder Annoyances

There was a new feature introduced with the iPhone 2.1 firmware update that is driving me crazy and making me curse apple an my iPhone daily. I am talking about the SMS multi reminder.

The SMS multi reminder is designed to notify you with an alert if you have an unread SMS (text) message. Sounds good in theory, but trust me, it horrible in practice.

When you receive a new SMS message to your iPhone, the first few lines are displayed in what I can best describe as a pop up box. Often if the message is short, “hey I’m running late”, you see the entire message. This is where the trouble lies. If you get an SMS message and you don’t unlock the phone, open the SMS app, then open the specific SMS thread, the iPhone thinks you haven’t gotten the message, so it will remind you 5 minutes later, and 10 minutes later that you have an unread message, for a total of 3 alerts in 10 minutes for a message you might have already seen.

Example of why this is annoying:
I’m sitting here working on my blog, “PING!”, ah I have a new SMS message on my iPhone, the screen is lit up and the preview box is showing. “From TWITTER: xFLORIDAx – I look like a shaved ape”. Ok, no response needed, I set my phone down. 5 minutes later “PING!” ah! I must have a new SMS message… strange my screen isnt lit up, turn on the screen. no new SMS messages, weird. 5 minutes after that, “PING!”…. so in 10 minutes, I have been alerted 3 times for a message I have already read. ANNOYING! I don’t want to unlock my phone for every little message that is sent to me.

I understand how this could be useful for someone who gets 1-5 text message a day… I average over 200 a day. Most messages come from twitter and don’t require a response. I would disable the multi reminder if I could, but apple doesn’t allow you to change the setting for it. It’s just on, like it or not. The only way to prevent the SMS multi reminder is to disable text notifications all together, and I’m not going to do that. I like getting one and only one notification when I get a new message.

If im in a meeting, should my pocket buzz 6 times in 20 minutes to let me know I have 2 text messages? GTFO! I should only be notified two times.

I really hope that Apple allows people to turn the SMS multi reminder on and off in the next update. I can’t imagine it’s to hard to do.

Catch Me Ridin Nerdy with my iPhone

C-Low is one of the best dice based street gambling games there is. I have been know to play some mean C-Low in my time, in ghetto situations (random fact: I am in a gang)

Here is how you play:
Gather your homie in a circle, everyone places a set betting amount on the floor. Dollar bills work great.

Everyone rolls one die to determine the rolling order. The higest rolling player goes first, then second highest, etc.

The point of the game is to roll 3 dice until you get a matching pair of three of a kind, what ever happens first. You keep rolling until you get double or triples.

If you roll doubles, your score is value of the dice opposite the pair. Triples (“trips”) beat any doubles. The highest trips win.

Special dice combinations:
1-2-3: “crap out”. auto lose. You are out of the game, your money is gone.
4-5-6: known as “c-low“. Auto win. The game stops, you win all the money. Other players lose their turns.

Game Play Example (5 players)

Player one:
roll 1: 1-4-3 = no matches, roll again
roll 2: 3-5-2 = no matches, roll again
roll 3: 6-6-2 = MATCHING PAIR (6), FINAL SCORE = 2

Player two:
roll 1: 3-3-3 = TRIPPLE 3’s (“trip3”), final score = 333

player three:
roll 1: 5-6-1 = no match, roll again
roll 2: 1-2-3 = SPECIAL DICE COMBO! crap out. Out of the game, no more rolls

player four:
roll 1: 4-5-6 = SPECIAL DICE COMBO! C-LOW! AUTO WIN! no other player is allowed to roll, you take the $$$

player five:
does not get to roll, player four got a c-low.

its that easy!

Wait! What if 2 players recieve the same score? (4 and 4) or (222 and 222)

This condition is called a “push”. The players with matching high scores stay in the game, all other players must double their initial bet. If the buy in was $1 for the first round, the buy in for round 2 = $2 (the losing players now have $3 on the floor, the winners of the first round only have $1 on the floor). The game starts again, giving all players another chance to play.

Why am I posting rules on how to play street gambeling dice games on a mainly tech related blog? Simple, I no longer have to carry dice around to hustle suckas with! Say What? damn straight, with MotionX Dice, a free app for the iPhone, I have a sweet pair of dice to play c-low (or yahtzee) with when ever I want. All you have to do is change the setting to 3 dice, and shake the iPhone.

If playing illegal dice games on your iPhone doesn’t make you feel thug enough, you can always pour one out for the homies with another free iPhone app.

click here to see mor pictures from my 28th birthday party