Archives for August, 2005

Show Netflix Movies using PHP 5

Posted on August 30th, 2005 @ 12:02 PM EST

I wrote the following PHP script for use on the Netflix page that I recently added to my site. The script parses the RSS feeds that are available for my Movie Queue and Previously Viewed Movies using the URLs that Netflix provides for my account. It uses PHP 5’s new SimpleXML extension which really simplifies parsing XML documents by quickly extracting data. In order to accomplish the same results under PHP 4 a lot of code would have been needed.

<?php

// define feed urls
$queue_feed = 'http://rss.netflix.com/QueueRSS?id=ENTER_YOUR_ID_HERE'; // url to queue feed
$recent_activity_feed = 'http://rss.netflix.com/TrackingRSS?id=ENTER_YOUR_ID_HERE'; // url to the most recent rental activity feed

// function that parses the xml and converts it to a nice ordered list
function show_movies($file) {
        
$xml = simplexml_load_file($file);

        echo
"<ol>\n";
        foreach (
$xml->channel->item as $item) {
            
$link = $item->link;
            
$title = $item->title;
            
$title = preg_replace("[[0-9]+- |Shipped: |Received: ]", '', $title);
            echo
"  <li><a href=\"$link\" title=\"$title\">$title</a></li>\n";
        }
        echo
"</ol>\n\n";
}

echo
"<h2 title=\"Movie Queue\">Movie Queue</h2>\n";
show_movies($queue_feed);

echo
"<h2 title=\"Previously Viewed Movies\">Previously Viewed Movies</h2>\n";
show_movies($recent_activity_feed);

?>

In order to use the script your server will need to be running PHP 5. Just replace “ENTER_YOUR_ID_HERE” with your id number and you’re ready to go. You can get the id by logging into your Netflix account then clicking on the RSS link at the bottom of the page. The number can be found under the Personalized Feeds section and it starts after the = sign in the URL.

NHL Rule Changes

Posted on August 30th, 2005 @ 10:35 AM EST

NHL - Coming 10.05

Hockey season begins in another five weeks and it can’t get here soon enough. It’s the only sport that I regularly watch on TV and I’ve really been missing it the past year. There are several new rules that have been adopted by the NHL in the upcoming 2005-2006 season. Some of them will help increase the speed of play, making the game more exciting, and some will take away aspects of the game that I like.

Here are some videos provided by the National Hockey League and EA Sports that describe the new rules:

What I Like

Four feet will be added to each of the zones between the goal and blue lines. This extra room will help give the players more space to skate around in their offensive zones, which will speed up the action and give them more scoring chances, especially during power-plays.

To allow more continuous play, there’s a new Tag-Up rule, which allows a player to dump a puck into an offensive zone if his teammate is already in the zone as long as he returns to the blue line before touching the puck. The red (center) line will be ignored when making passes so a player can pass the puck from his defensive zone all the way up to their offensive blue line which previously would have been stopped due to a Two-Line Pass. Players can make much longer passes now which should increase the number of breakaways thus creating more chances for a one-on-one against the goalie.

In the event of a tie at the end of a game after five minutes of overtime, there will be a shootout as opposed to the game ending in a tie. Each team will be able to select three players and the team with the most goals after the six shots will be the winner. If the score remains tied after the six shots, the shootout will proceed to sudden death.

What I Don’t Like

One thing that I am really frustrated about is the Instigator Rule. One of my favorite things about watching hockey are the fights. Every couple of years or so a rule is changed to try and decrease the amount of fighting. One of the biggest things that draws a large number of people to hockey are the fights. Why the NHL keeps trying to remove it from the game is beyond me. If things keep up the way they’ve been going, NHL hockey will be a non-contact sport in another 15 years. It was fun to watch a game where a team was getting their ass kicked then to see the other team come out throwing punches in the last few minutes. This new rule is a bit harsh and will probably put an end to any fighting at the end of a game whatsoever. If a player instigates a fight in the final five minutes of a game, he will receive a game misconduct and an automatic one-game suspension and the length of the suspension will double after each additional incident. On top of that, the player’s coach will be fined $10,000 which will also double after each incident.

There is a new zone that has been added to the ice called the Goaltender Trap Zone. It’s a 28’ area behind the goal that is shaped like a trapezoid. Goaltenders who play the puck outside of this zone behind the goal line (in the corners) will now be penalized for delay of game, resulting in a two-minute penalty. I think goalies should have freedom to go wherever they want on the ice, especially within a few feet of the net that they have to protect.

Moved to Maryland

Posted on August 28th, 2005 @ 9:36 PM EST

Looking Down Main Street Towards the Chesapeake Bay

After living in the Carolinas for eleven years, I’ve moved back to my hometown of Annapolis, Maryland. For the past couple of years, my wife and I debated on whether or not we should stay in Wilmington or move up here after she graduated from college. She finished up school last month and we came up with a lot more reasons on why we should move instead of staying where we were.

We’re really going to miss living at the beach, but there’s a lot more things to do here since we’re also close to Washington D.C. and Baltimore. During September, we’re planning on going to the Maryland Renaissance Festival, seeing the Bacon Brothers play at Ram’s Head Tavern and we’ve got tickets to an Orioles game at Camden Yards. Another thing we’re looking forward to is being able to relax more during the holidays since we won’t always have to drive to Alabama or Maryland to visit family.