Weather on Your PHP-based Website

If you live in an area that receives both days of freezing sub-zero temperatures and days featuring sweltering heat indexes over the course of a year (like Minnesota), it is important to know what the weather is like before you step out the door in the morning. Because weather is an important factor when people plan their day, and because it helps paint a picture of the experience in a specific place to people hundreds or thousands of miles away, I sometimes like to include current weather conditions on websites I develop.

To put weather on your website, you have to grab weather data from some source. Unfortunately, this is easier said than done. I have spent a fair amount of time looking for a lightweight script that grabs accurate weather data and works with PHP-based websites.

I used this add-on for SimplePie to grab Yahoo! Weather for a long time. SimplePie is an awesome RSS parser, that grabs RSS feeds, caches them, and allows you to include them on your website. It worked well, but the add-on pulled a lot of extra weather information that I didn’t need, such as sunrise and sunset. In most cases, I like to provide just a bit of weather data in the corner of a page, and give people a link if they want to see more. In addition, Yahoo! gets it’s data from The Weather Channel, so there could be a bit of a time lag before the data is updated. I really wanted to use weather data from the National Weather Service, who conducts official measurements all over the Unites States each hour.

A (not current) example of weather you could put on your website using my script.

I recently found a script that the University of Central Florida developed to pull NOAA weather data on GitHub. It’s lightweight, has it’s own built-in cache, and requires no other scripts to operate. I liked the plugin, but wanted to make some changes. The script was open source, so I made a number of programmatic changes and added to the documentation.

See the script, Current NOAA Weather Grabber, on GitHub.

If you are looking to include current weather conditions on your PHP-based website, give it a try. I think you’ll enjoy how easy to use, lightweight, and accurate this weather script is.

Check it out, and let me know if you have any questions, comments, or suggestions.

HDHomeRun offers high-quality TV on your computer once it’s setup

I recently bought Silicon Dust’s HDHomeRun. This nifty little device has two television tuners in it and streams the live content over a computer network, allowing one to watch live television programming on their computer.  It’s awesome. The fact that the unit features two tuners means that two computers on the network can stream shows at the same time. The device I got cost around $100. A cable version is also available.

Overall, I am very happy with the HDHomeRun. The device is small, yet very powerful. It can stream full 1080i programming from a rooftop antenna, which looks great. The picture quality rivals a television.

HDHomeRun on a Mac

That being said, I did encounter some difficulty setting up the HDHomeRun on a Mac. When I went to pick it up at MicroCenter, I saw a Mac logo, so I figured setup would be a snap. I was surprised the find that there were not any kind of directions for Mac setup in the box or on the company’s website. The box featured a small pamphlet explaining how to connect the device to the network, but no instructions for setting up the computer end of things. An 80mm mini CD was provided, but these discs do not fit into Mac slot loading drives. The company’s website did provide a software download for Macs, but again no instructions. There are more instructions available from on the manufacturer’s website for Windows machines.

Before we get to far, I will note that there are programs that work with the HDHomeRun besides the official program. Namely, for Mac, I found that EyeTV 3 from Elgato is a great solution. I ended up purchasing this program, as it is much easier to use and has everything you could possibly need in one interface. If you will watch a great deal of television on your computer, this sub-$100 program is certainly worth the cost. If you are an infrequent television watcher, the official software might suit your needs.

Setting Up the HDHomeRun Software

HDHomeRunI setup the HDHomeRun software before purchasing EyeTV 3. Because there is not a lot of documentation on the program available, I want to show others how to use it. First, I grabbed a copy of the installer file and installed it. After a bit of reading on various forums, I found the software (pictured on the right) allows one to select a channel, and then open it in VLC. So, I downloaded VLC. I launched the HDHomeRun program and found it would not display channels available for viewing, despite recognizing the tuner device. After more reading online, I found the HDHomeRun needed to scan for channels before I could watch TV.

Scanning for Channels

Remember scanning your digital TV for channels? Yes, I needed to do this on the HDHomeRun. This is not as simple as it sounds, however, as the HDHomeRun Mac program does not (to the best of my knowledge) currently have a way to scan for channels. Luckily, command-line utilities are included with the software downloads. A development guide from the manufacturer explains how to use them. Command-line utilities are not for the faint of heart – they can screw up your computer if you mistype in Terminal. That being said, I was able to tune my tuners by running the following commands:

hdhomerun_config scan /tuner0 tuner0.txt
hdhomerun_config scan /tuner1 tuner1.txt

All of the sudden, with these two commands, the device worked! The command also outputted a list of channels to my current directory, which was helpful, especially as the program does not map virtual channels. Some of my channels were not on the channels where I would normally view them, as they are actually broadcast on one channel, and then remapped to the channel you usually find them on.

Many stations have moved from the VHF frequency (channels 2-13) to the UHF frequency (channels 14-51) in recent years. Many of these stations were originally VHF stations, with a number in that range (2-13) that they don’t want to give up, but they want to provide signals to the city requiring shorter antennas, afforded by UHF. This is one major reason stations broadcast on one channel and remap to another.

Using the HDHomeRun

Once you have this software setup, simply select the show you want to watch, and a VLC window will appear.  Click the link that appears in VLC, and your show should appear.

Additional Notes

I should note that this device’s ability to send high-quality streams can put a strain on your network and computer. In my experience, this device works best on a wired network or a very high quality wireless n network.

Again, I am very happy with the HDHomeRun. The small device provides a high quality television signal anywhere on the user’s network. While it took a bit of work to get setup and didn’t come with detailed instructions, HDHomeRun’s ability to send high-quality television signals to a computer make it a great product.

The Gustavian Weekly named a 2011 ACP Online Pacemaker Winner

The Gustavian Weekly was named a 2011 Associated Collegiate Press Online Pacemaker Winner at ACP’s National College Media convention in Orlando, Florida this weekend.

The Associated Collegiate Press is the oldest and largest college newspaper membership organization. It critiques and judges print and web publications, holds educational conventions, provides educational resources to its members, and more. The Pacemaker is the premier award they distribute, with categories for newspapers, newspaper websites (the category we received an award in), magazines, and yearbooks.  Only a few publications are selected for the prestigious award each year.

The Weekly’s website, along with those of other entrants, was judged last February and March.  Sites were put into categories based on the enrollment at the college they serve. Categories are: 5,000 or fewer (our category), 5,001-10,000, 10,001-20,000, and more than 20,000.  The sites were then judged based on design, ease of navigation, writing and editing, graphics and interactivity.  Many months later, it’s exciting to see The Weekly on the list, and to have a list of links to other college newspaper websites who are doing big things.

It was an honor to serve as The Weekly’s web editor last year and the year before. I am deeply appreciative of the hard work of all of The Weekly’s writers, editors, and other staffers, who helped make the publication what it is.

Weekly website is refreshed

This morning The Weekly launched an updated design. A few weeks ago we decided that it was time to update the color scheme and improve the site’s feel. This is probably the biggest design change we have made since September 2009.

Utilizing the code from our most recent design, I worked with our Editor-in-Chief to develop a new color palate. I also worked to better organize the stories on the front page and remove some of the boxes.

I hope you like the new design. Feel free to let us know what you think.

“Wordpress” to “WordPress” filter

I recently upgraded my blog software to the release candidate version of WordPress 3.0. I am very happy with how it performs, and am excited that WordPress and WordPress MU have merged. This will make the development process much easier, especially for those of us with WordPress MU sites.

There is one new “feature” that I don’t like, however. A new filter in version 3.0 will automatically change all instances of “Wordpress” (note the small “p”) in posts, titles, or comments to “WordPress”. While the later is technically the correct way to refer to the software, I do not like it when software changes the meaning of user’s words without their consent. How can one provide examples of misspellings? How can a blog owner ensure that the integrity of commenter’s remarks are left intact?

I wrote a short plugin (actually, it is just three lines of code) to turn this filter off. You can download it from the WordPress plugin repository.

If you have any questions or comments, feel free to leave them below.