Archive for the '.NET' Category

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.

Where have I been?

An excellent question. Where have I been?

In the past 12 months I have gotten married, switched jobs, adopted a kitten and moved back to the big city. You could say I’ve been in quite a few places doing any number of things. To explain though, I left WeatherFlow to return to Orlando to be closer to friends and family. Working there was perhaps the best decision I had made as I was able to learn quite a few technologies in a short amount of time, meet some very bright and driven people, as well as work on some amazing projects. If it wasn’t for WeatherFlow I wouldn’t be where I am today.

Where is that, you ask?

Well, I’m currently working for one of the largest defense contractors in the world. I work for the division which creates internal HR Applications for the company. Definitely a change from my usual 6-12 developers in a room and rapid application development. I picked up some legacy ColdFusion code and helped the team hit a couple releases before I was reassigned. From there I joined a small VB.NET/ASP.NET development team working on some internal applications which were eventually shelved, or made it into Phase II.

During the colder months I took on a stretch assignment to help another team which had been working with a 3rd party software vendor. Essentially, I have been testing and deploying the application for our internal team and managing the correspondence with the vendor. I’ve been learning our software engineering process, IIS configuration, account provisioning, writing SOI’s, hosting meetings and trying my hand at application deployment and environment configuration. Really, it has been a great learning experience thus far and I am looking forward to this new fiscal year.

Where do I go from here?

I am hoping to post more code on this blog, as well as start a few new projects on the side. I have a small Pandora/iTunes mashup written in VB.NET/ASP.NET 3.5 which needs a home. Hopefully I can find some hosting shortly and get that one up and running.

This year my goals are lofty:

  • Learn ASP.NET MVC with C# & jQuery
  • Learn Python & Django
  • Learn Ruby on Rails
  • Get Certified, whether its an MCPD or MCTS just do it.
  • Write something useful.
  • Become a better technologist and developer.

As always, I want to keep current and stay on top of the industry changes, and filter out the hype from the reality. Agile this, rails that are great things to investigate but what is the business case? What is the need? Hopefully this year I can find the time to publish some articles recounting those very things from my own point of view.

I hope that brings everyone up to date. I am still here, and hopefully I’ll be posting more in the weeks to come.

My First ASP.NET App

Background

It is (about) day 2 of using ASP.NET and Visual Studio 2003 and I’ve finally managed to deploy an application to the new webserver. Basically all it does is read the iTunes text file output (File –> Export Song List… –> Text File) and outputs a DataGrid component with the artist, album, and song title with nice pagination. The nice thing is that the DataGrid handles the pagination and pretty much any operations with the data. I have to say, I really wrote this in about 2 hours in the wee hours of the night so if it breaks, let me know.

iTunes TXT v0.01

Why ASP.NET is unique…

There are so many people that have told me that ASP.NET and .NET in general is pretty much a waste of my time, but see, there are so many others who are using it and loving it. Here are a few reasons I personally see promise in the language(s).

  • .NET keeps the code out of the interface using ‘Code Behind’ allowing your layout people to work on layout, and your coders to work on… code.
  • .NET uses more than one language, but those languages can be used in both desktop and web based development. What this means is, an employer only has to hire one person and they could easily jump from web to desktop in hours instead of weeks.
  • I can’t say just how much .NET WebForms really act like desktop applications. You can actually write subroutines that run on the webpage based on user actions. This is really unique, as at my work we usually have to shoehorn it by creating a new page or using a ton of javascript. .NET tries to take care of it for you and does a darn good job.
  • Choices: You get a choice of VB.NET, J#, and C#. They all work pretty much the same with the .NET framework, but it really gives programmers the choice to specialize or just pick their favourite to work in. Personally, I like C# because it reminds me of Java and C mashed together, but these choices give developers with different backgrounds the ability to work together.
  • Postbacks: .NET has a built in way of handling postbacks, you know, when there is an error or if you want to process data on the same page it is displayed, .NET can handle it for you.
  • Source code safety: ASP.NET builds. It actually has to complie, which for some of us LAMP developers sounds like a royal pain, but really it keeps your source safe. Think about it, if you lose a client, or a client demands FTP access, they cannot access your source (at least not easily). It’s really a beautiful thing.

Hello World, for good measure…

I of course had to write a classic ‘Hello World’ in C# (desktop!) for good measure. It has a little more than a standard hello world, but I think it just shows how carried away I can get at 2am.

Hello World C#

Well, that’s it for now. More when I finally write something useful!