teh interwebz
RSS icon Home icon
  • Web Development Rapper

    Posted on June 13th, 2009 Josh Highland No comments
    YouTube Preview Image

    The best part is that everything this guy raps about is 100% correct.

  • Controlling Twitter SMS notifications through code

    Posted on June 1st, 2009 Josh Highland No comments

    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”.

  • How to embed YouTube Videos in HD format

    Posted on March 24th, 2009 Josh Highland 1 comment

    youtubehd-vertical

    YouTube.com is now offering two video formats on their site, standard and high def (HD), but they only allow an option for you to embed the standard version. This tutorial is going to show you how to get maximum quality and take advantage of the HD videos that you embed in your blog posts or social networking profiles.

    Step 1: Copy this code and paste it to wherever you intend to embed the video:

    <object width="425" height="344">
    <param value="http://www.youtube.com/v/YOURVIDEOCODEHERE&ap=%2526fmt%3D22" name="movie" />
    <param value="window" name="wmode" />
    <param value="true" name="allowFullScreen" />
    <embed width="425" height="344" wmode="window" allowfullscreen="true" type="application/x-shockwave-flash" src="http://www.youtube.com/v/YOURVIDEOCODEHERE&ap=%2526fmt%3D22"></embed>
    </object>

    Step 2: Grab the direct link to your video. In case you’ve never done this before, it can be found to the right of the video player on YouTube or from your browser’s address bar.

    gaburl

    Step 3: copy the alphanumeric URL varialbe at the end of the link you grabbed in step 2.

    urlvars

    Step 4: The finishing touch involves making a simple change to embed’s URL source code to direct it to the HD version. To do this, you simply need to paste what you copied in step 3 into the part between /v/ and the & symbol in the embed code. I’ve labeled this “YOURVIDEOCODEHERE” in the embed code in Step 1.

    Normal quality:

    
    

    HD Quality:

    
    
  • JQuery 1.3 domination through deprecation

    Posted on February 19th, 2009 Josh Highland No comments

    jquery 1.3

    On a project I maintain, we recently rolled up to JQuery 1.3.1 from JQuery 1.2.6. Upon doing so, several things instantly broke.

    I started seeing errors on lines like this:

    if($('input[@name=username]').val() != "")

    I decided to check the JQuery 1.3 relase notes to see what had changed.

    The first bullet point answered my problem:

    The ‘@’ in [@attr] has been removed. Deprecated since 1.2 this old syntax no longer works. Simply remove the @ to upgrade.

    As it turns out, the @ style selector was depricated and wasn’t suggested for use when JQuery 1.2 was released, but it was still supported. At 1.3 the @ style selector was removed all together, and as a result broke our code!

    Following the upgrade instruction I removed the @ symbol from the selectors, and the code started running again.

    The result:

    if($('input[name=username]').val() != "")

    A simple and effective upgrade, and a reason to closely pay attention to release notes

  • The Machine is Us/ing Us

    Posted on January 5th, 2009 Josh Highland 1 comment

    I saw  this video on @KurtyD’s blog, http://daradics.com. He said that the video had a transformational effect on him. I’m going to have to agree.

    YouTube Preview Image