Archive for the ‘Site Update’ Category
youtubing
The API for developers offered by YouTube interested me. I had no experience with that kind of programming, but I decided to give it a whirl. At first there’s not much documentation on how to actually implement methods that use the API, but persistence and a lot of googling, and I was able to utilize it right away. The tricky part: finding a way to import the XML document and parse it for my own use. The XML document returned by the YouTube API depends on the method sent, but it basically returns information that is stored on YouTube such as my profile information, my video information, or even my favorite video information.
At first I tried to do it with Javascript, but I found that a security measure prevents me from importing XML docs from remote servers. That lead me to PHP; ah, my beloved PHP. Once I figured out how to parse the XML doc, I just had to find a way of utilizing the information. The next step: creating a PHP class. This has nothing to do directly with the API, but I hadn’t created a class or done any OOP in PHP before. A couple hours and voila: a random favorite YouTube movie bar on the right and a YouTube section that will automatically update when I add/remove movies on my YouTube profile. Basically, this saves me the trouble of maintaining that section at all if I do any modifications on my YouTube lists. Hazzah!


