Archive for the 'Web 2.0' Category

Rails, OAuth and GameTweet

Yesterday I launched a little tool for twitter using Ruby on Rails, Capistrano (with Deprec), and OAuth called GameTweet. This is the first Rails application I’ve deployed since I started playing with the stack a few weeks ago. The idea for GameTweet came one night when I was thinking about the old TD clan website before the site went down. There used to be a feature for anyone who wanted to be text messaged when a game was about to start where a user could put in their phone number and carrier and any member of the site could send out a mass text to those on the list notifying them when they were going to play. Fast forward a few years into the future and we have Twitter, which works with most phones and can notify users when a message is posted.

The idea was simple: Use Twitter to notify my friends when and where I was playing a game, specifically a PC game.

I remembered that Twitter was implementing a new authentication method which might just work for something like this, as basic authentication always seemed dirty to me. Why would anyone in their right mind hand out their username and password? A quick Google for “Twitter OAuth in Ruby on Rails” and I hit the Twitter OAuth examples. It didn’t take much to fashion the quick and dirty example into a working system. Actually, I’d estimate I was in the single digit hour range as for work involved. It was simple, which seriously scared me. Capistrano and Deprec really made the process extremely painless. More on that later.

OAuth came easy. All I had to do was follow along in the step by step example from Twitter’s wiki and then register my application with Twitter’s OAuth Client page. Perhaps the hardest part was debugging and testing, as the current Twitter system doesn’t appear to have a test sandbox.

So GameTweet was born. Just login to Twitter via OAuth and then type the IP:Port combination of the server you’re playing on, then the name of the game, and hit “Tweet!”. GameTweet then uses OAuth to update your status with all that information as well as a tinyurl to the GameTracker server status page using the tinify_urls plugin.

Capistrano, the Ruby based task automator, is perhaps the single most amazing piece of scripting I’ve seen in awhile. Coupled with the deployment recipes from Deprec, I was able to manage everything from code checkout, releases, deployment and even the Apache configuration all from one “cap deploy”. I managed to get an installation of SMF2 (a php based forum) deploying with Capistrano as well. Really, it is a joy to work with. After making a quick change to GameTweet I just had to run an “svn commit” and “cap deploy” and everything is up on the server with the latest code, database schema, and Passenger restarted the application.

That said, GameTweet has absolutely no test harness. I’m still learning the ropes with Ruby and Rails, but I do plan on eventually implementing a full test bed. OAuth is perhaps not the best thing to start with, but GameTweet was a tool I wanted to use for myself so I built it. Fast.

If you have an idea for GameTweet, want to talk shop, criticize my horrible Ruby on Rails code, or just talk pop me an email using the contact form or send me a tweet.

ASP.NET Pandora, iTunes Mashup

What is it?

Last week I had some down time and manage to crank out a relatively basic mashup of the iTunes Libary XML file and Pandora’s favourites feed. Essentially my code reads in the iTunes XML file and converts it into a readable form using XSLT then grabs the Pandora feed and compares the two using XPath.

The application is written in VB.NET on the ASP.NET platform. Yes, I know, VB is the poor ugly stepchild language but we use it at work and it was far easier to pick up and go. C# is on the docket for the next project, I promise. That said, I’m hoping to get some Ruby and Python up here too. I just need to get a ticket in with my Linux hosting provider.

Why did you write it?

I wanted to write this application for awhile but I never had the time or the motivation. Thankfully boredom breeds innovation for me. I had started the code months ago and abandoned it after getting stuck on the WebRequest to Pandora. I managed to dig up the code last week and had a few eureka moments which lead to release worthy code.

The reason behind the construction of this application is that I use Pandora every single day. I practically need their radio service to work. One thing that I do when I’m listening is bookmark the songs I like, and mod them up with the thumbs up button. It’s intuitive and quick to do which is great. However, when you’re ready to plop down a bunch of money on new music how do you know which songs to buy? I always forget to update my favourites list to remove the songs I’ve bought, and I’m too lazy to search my iTunes every time I want to buy a song. Sure, iTunes sometimes prevents you from buying the same song twice, but having been bitten by that bug before I’d rather have a third part verify that for me.

Improvements, Ideas, Concerns

The application is very rudimentary and will be sitting on a very restricted shared hosting environment. The code is definitely not rocket science, but it works for the most basic use case. That said, it doesn’t handle advanced searches or merge results for remixes and the like. It isn’t using a special algorithm for matching. It just does a direct XPath contains on the artist and song title. If it doesn’t match, the application will falsely mark it as if it doesn’t exist in your library. Likewise, single quotes are currently not handled correctly because I was lazy and XPath parameterization looked like a pain. This is just a proof of concept.

iTunes XML files can get pretty big. I think my library file was almost 6mb, which is rather large for a web upload. I might look into letting users upload a zip file and decompress it on the fly. Not sure how you’d go about that though. My guess is this application will thrash the server with IO under load.

One of my coworkers/friends suggested implementing affiliate IDs for the various music stores and injecting those into the application in order to generate revenue. If I ever wanted to turn this into a real product that might be a way to monetize, but rest assured that isn’t implemented at the moment. If anyone wants to see this as an actual product, feel free to drop me a line.

Where is it?

It will be hosted on my new domain at once the kinks are worked out. GoDaddy’s Windows hosting is far from perfect, but it gets the job done. Unfortunately, it appears they are trying to proxy my WebRequest and XSLT discovery outgoing sockets which is throwing an error. I have a ticket in to find out what I can do to fix that.

If you are interested in seeing the code I’ll gladly post it. Right now it isn’t up to much and still needs some cleaning up so I’ll leave it off for now.

Mike Potter, Adobe – Thanks Guys!

So, I was checking my mail today and a mysterious package arrived from Amazon. Now, it could have been anything but to my complete shock and awe, it was from Mike Potter at Adobe. Here are some blurry photos from my phone:

WrappedCardBook

I had added the cookbook to my Amazon wish list shortly after Flex 3 was released, as I wanted to dive in and learn everything I could about the newest version of Flex. I really appreciate the gift, and to all of the Adobe team, thank you. You guys have delivered a great product, and you really know how to reach out and touch the community.

BrightKite

If anyone wants a brightkite invite, just let me know. I have 3 left, so the first 3 to comment will get the invites.

Updated: MyBlogLog Plugin v0.5.1

The MyBlogLog WordPress plugin is receiving a very belated face lift and a few bug fixes (thanks to those who reported them). Now, as a disclaimer, this code is relatively untested and was dug out of a very old archive from my days at cloudspace (the company who initially partnered to create MyBlogLog), so use it at your own risk. If you find any bugs, just drop me an email using the contact form and I will try to help in any way I can. This release has been activated on at least 2 WordPress 2.3.3 installs, so yes, it works with 2.3.3!

Check the project page to download the latest plugin file.

Oh, and still no readme.txt. ;)

MyBlogLog Plugin Update – In demand?

Well, it’s been over a year since I released my WordPress MyBlogLog plugin, and I’m still getting emails about it. Honestly, I’m very surprised that this thing still works. If you’re using the plugin now, or want to, let me know! I think it is time for a big code overhaul, and perhaps some new features but there is no sense in developing this plugin if there’s no demand. If you’ve got an idea, post it up and I’ll do my best to get it out there in the wild with the next release. I did notice the guys over at MyBlogLog have been hard at work improving the JavaScript and their own feature set as well which means I should probably update the plugin pretty soon. Also, I am aware of the missing readme file! Please, I know about it, and I’ve posted about it. I promise, next release, you all will get an extensive readme!

Anyways, it amazes me how far MyBlogLog has come since the day I registered and alpha tested it. Really, you have no idea how simple the idea was at the time. Todd, Eric, Steve, John and the rest of the crew over there at Cloudspace and Yahoo, my hats off to you guys.

The Month in Review

Well, its been awhile since I’ve had a chance to post. A lot has been happening with my work and college. All leading up to the probably graduation in May 2007, so I’ve been unable to post as often as I would have liked.

So what’s been going on? Well let’s see…

  • The web speculates that MyBlogLog is in acquisition talks…
  • Apple updated, well, everything in their line yet again
  • I have left my position with FuJ Tech, and will continue to work on freelance projects
  • I recently learned that MediaTemple’s Grid service is actually not a grid. So much for that idea. ;)
  • Sony’s PS3 has about as many issues as the Xbox360 had at launch, but with almost double the initial pricetag
  • The Nintendo Wii is selling like crazy, as predicted, and I for one will be buying one once I raise some funds.
  • Windows Vista is practically out, and Acer is saying not to bother with the ‘Basic’ version.

Did I miss anything? Oh well, check the Digg section or my ma.gnolia for daily link updates and news stories.

Zune, iPod and MySpace: A Short Study

Well, most gadget aficionados, myself included, are awaiting the release of many new products in the coming months. From the newest product from Nintendo, the Wii, to the Sony Mylo, and Microsoft’s Zune there are a myriad of new toys to be had. The target market for most of these devices lands smack in the middle between highschool kids, and college students. Call it a coincidence, or just fate, but this happens to be the same target audience which MySpace has succumbed to. The horribly crafted pages of MySpace.com lend themselves to the artsy hands of anyone with a small amount of knowledge of the web. By making the web this easy to influence, MySpace has created what some call a cult of personality much like Apple did with the iPod, but without the Jobs. The independent souls of MySpace can go from zero to hero in a matter of keystrokes. Digg helps nicely with this effect.

More on the history, and philosophy after the jump.
Continue reading ‘Zune, iPod and MySpace: A Short Study’

Cross Post from MyBlogLog

I just had to cross post this. If for no other reason than to show off, gloat, or otherwise inflate my ego. That or just to prove how incredibly crazy the web really is. Small world, huh?

MyBlogLog Fun Friday Stats

MySpace – What is our Internet coming to?

I saw this amazing link on Digg today and thought I needed to make my stance on MySpace heard. MySpace.com is quite honestly the most rebellious and anarchistic social networking site I have ever seen. Users can pretty much do whatever they want to their profile, post what they want, and befriend who they want. All in all, this sounds like a wonderful Utopia of social goodness and web based interaction. The problem with all this freedom is that at some point that animated GIF background, your flash based video and music player (which autostarts no doubt) will make your content illegible and probably annoy any potential viewer. On top of the usual suspects, there is illiteracy. The article actually graphs the millions of grammatical and spelling errors that MySpace is chock full of and I must say, it is very, very scary.

Anyways, enough ranting. Enjoy the link.