Displaying Twitter Updates on a Web Page

I recently began using Twitter, a microblogging service for posting short, chat-like blog entries and reading what other users of the service are doing. The site has severe reliability problems, but it's still an entertaining way to get real-time updates from bloggers I read along with others I know who've been sucked into Twitter's maw.

I wrote some code to display my most recent Twitter update on my weblog, Workbench, in a sidebar at upper right. This afternoon, I've released the Twitter-RSS-to-HTML PHP script under an open source license. The script requires MagpieRSS for PHP, an open source PHP library that can parse RSS and Atom feeds.

MagpieRSS caches feed data, so at times when Twitter is glacially slow or can't be accessed, this script won't hurt the performance of your server.

The first release of the script only works with a Twitter user's RSS feed, which can be found in the "RSS" link at the bottom of a user's Twitter page. The only tough part about writing the script was creating regular expressions to turn URLs into hyperlinks and "@" references into links to Twitter user pages:

// turn URLs into hyperlinks
$tweet = preg_replace("/(http:\/\/)(.*?)\/([\w\.\/\&\=\?\-\,\:\;\#\_\~\%\+]*)/", "<a href=\"\\0\">Link</a>", $tweet);
// link to users in replies
$tweet = preg_replace("(@([a-zA-Z0-9]+))", "<a href=\"http://www.twitter.com/\\1\">\\0</a>", $tweet);

If you're reading this and wondering why anyone should bother with Twitter, I recommend reading the updates by Jay Rosen, a former university journalism chair who uses the service to share a running dialogue on the media. He punches above his weight in this 140-character-or-less medium.

Voting Ends for This Year's Hugo Awards

Hugo Award from the 2007 WorldCon in Japan, derived from photo by Cory DoctorowToday's the last day to vote on the 2008 Hugo Awards, which will be given out at the World Science Fiction Convention next month in Denver. I joined the convention as a supporting member last fall to vote for the first time on the awards, which began in 1955 and have become the most coveted prize in science fiction.

In April, the Hugo nominees were announced. All of the nominees in several categories can be read for free online, including short stories, novellas, novelettes and fanzines. Four of the five best novel nominees were privately shared with voters as ebooks.

I won't disclose my votes until after the ceremony (if at all). I skipped most categories because I hadn't read enough of the nominees, but I did read all of the Best Short Story choices. Three of the five are terrific stories that were hard to rank from first to third. The other two not so much; I ranked them lower than "No Award."

The nominees, in alphabetical order:

If you'd like to vote in the next Hugos, become an attending or supporting member of the WorldCon convention for Montreal in 2009. I got carried away and have already joined Australia in 2010 and Seattle in 2011, though they could still get beaten out by another site.

Credit: The photo of a 2007 Hugo Award statue was derived from a photo taken by Cory Doctorow and is available under a Creative Commons license.

How to Deal With Obnoxious Blog Comments

Photo of Matt Asay by Ilya Schurov of Computerra WeeklyMatt Asay, an executive who writes CNET's Open Road open source blog, got so mad at commenters on his site yesterday that he began hunting them down:

... most people are not jerks. They just become losers when cloaked in anonymity. They say things they'd never say if confronted with the people they flame on discussion boards, in comments sections, etc. They're probably nice people "in real life." It's just on the web that they let it all hang out, to the detriment of the web and intelligent discussion.

Take the comments to one of my recent posts. The first is led off by "h3h" who apparently has no sense of humor (completely missing my point in the post), but can't leave it at that, then going on to lob ad hominems into his "argument."

"H3h" turns out to be Brad Fults. Judging from his Flickr feed and Twitter feed, he's probably an OK guy. He happens to be wrong in the way he chose to comment on this blog, but he's probably a well-intentioned person, normally.

Asay doesn't seem to understand the concept of anonymity. Fults' comments on CNET include a link to his web site, which contains his name and is presumably how Asay found it.

Anyone who reads Workbench knows that I get my fair share of anonymous abuse, particularly from people who read my Target story and let me know I'm a bad parent. That never gets old.

If you publish on the web and accept user comments, you're going to be a punching bag for a steady procession of dillweeds. Your choices are to stop taking comments, pick them off one by one like Asay, or just keep telling yourself you're a beautiful snowflake and soldier through it.

Credit: The photo of Matt Asay was taken by Ilya Schurov of Computerra Weekly and is available under a Creative Commons license.

Tropical Storm Bertha Forms in East Atlantic

Tropical Storm Bertha formed in the Atlantic today at a record-setting location that suggests an active hurricane season, meteorologist Jeff Masters blogs:

Today's formation of Bertha at 25 degrees West longitude is the farthest east a tropical storm has ever formed in the Atlantic so early in the season. It is also the farthest east a tropical storm has formed in the month of July. Reliable records of Eastern Atlantic storms go back to 1967, the beginning of the geostationary satellite era.

Is the formation of Bertha a harbinger of an active hurricane season?

Probably. According the the Hurricane FAQ, "as shown in (Goldenberg 2000), if one looks only at the June-July Atlantic tropical storms and hurricanes occurring south of 22 degrees N and east of 77 degrees W (the eastern portion of the Main Development Region [MDR] for Atlantic hurricanes), there is a strong association with activity for the remainder of the year."

Current models forecast a path for Bertha that will curve north and miss the U.S., but there's not a lot of confidence in that prediction yet.

Buscarlos Sonidos Magicos de Ecuador

Liking this song exposes me to "you know how I know you're gay?" ridicule, but every time I hear "Ecuador" by Sash I crank the knob up to 11 and reinsert "Escuchame!" back into my vocabulary.

Setting Up Westell Modems with Linksys WRT54G Routers

I connect to my high-speed DSL Internet service using a Westell WireSpeed modem that's hooked up to a Linksys WRT54G router. Last week a power outage hosed the settings on the modem and router, which knocked me offline until I figured out the proper configuration. I was so desperate at one point that I called my ISP's outsourced tech support, speaking for 15 minutes to a pleasant wage slave in Bangalore or another distant port o' call center who could not have been less helpful.

Linksys WRT54G wireless Internet routerFor the help of others in my predicament, and myself in the future when I forget how to do this again, I'm documenting how to configure a Westell modem to work with a WRT54G router.

First, connect a computer directly to the Westell modem using an Ethernet cable and see if you can browse the web. If you can, this confirms that your Internet connection is fine and your modem/router configuration is the most likely cause of the problem.

While the modem is connected, load the address http://192.168.1.254 in your browser, which opens a web application in the modem that enables it to be configured. Choose Expert Mode from the main menu, which adds options to the menu, then choose the Configure Connection option.

Westell modems are set up by default to act as their own router. This is ungood if you have another router, because they conflict with each other and neither works properly. When you are connecting the modem to a router, the modem must be set to "Bridged Ethernet" mode to disable its routing capabilities. This option can be selected in the Protocol drop-down box. After setting the modem to Bridged Ethernet, click Save and Restart Connection.

Next, disconnect the computer from the modem and turn the router and computer off, which for the router requires pulling the cord out of the back. Once this is done, plug the modem into the router with an Ethernet cable while the router's power is still off. Wait 10 Mississippis, then turn the router and computer back on in that order.

Load the address http://192.168.1.1 in your browser to open the router's web configuration application. This application requires a username and password. If you've never set one up, leave the username blank and use the default password "admin". The Basic Setup form is displayed. Choose the Internet Connection Type PPPoE (Point-to-Point Protocol over Ethernet), then click Save Settings.

To see if it works, choose the Status tab to display information about your connection. If Login Status is "Connected", the router's connecting to the Internet successfully through the modem. If not, click the Connect button.

(At this point you're done, but if you haven't set up router and wireless password, anyone can change your configuration and use your wireless Internet connection. Click the Administration tab to set a router username and password. Click the Wireless tab and the Wireless Security link to restrict wireless access.)

Broadband Reports has more information on configuring Westell modems and Linksys routers.

Life on the Streets of St. Augustine

A blog in St. Augustine, Art in the Market, is published by street artists who are tired of being driven away from the city's Old Town district by police. Ten years ago, the thousands of tourists who walked up and down St. George Street in Old Town would see a motley assortment of musicians, artists and street performers. One of our favorites was Sterling the Silver Man, a guy covered in glittery spray paint who combined robotic movements with the occasional water gun sneak attack on passers-by. My kids loved it.

Street musician performing on St. George Street in St. Augustine. Photo taken by Bill FrazzettoIn the late '90s, shopkeepers on the street decided that these folks were bad for business, so they got the St. Augustine city council to pass ordinances that make it illegal for them to work on the street. This sucked most of the charm right out of the place, so we visit much less often.

Today on Art in the Market, they tell a story of another side of street life in the nation's oldest city -- the death of John Lynch, a homeless alcoholic who was a fixture in the area:

When tourists or residents complained about the "bums" in the Plaza it was many times in reference to John Lynch. Whatever sent Mr. Lynch on the road to broken down alcoholism, we'll never know. He was usually in an extremely foul mood. Life had battered him apparently and he escaped into the bottle. He had over 32 citations and a number of incarcerations from" open container" violations to aggravated battery(drunken disputes). ...

If he had been dry for awhile (jail time) his appearance changed to a tall, distinguished, white haired 63 year old gent who could be mistaken for the head of the Rotary. This change lasted until he got a hold on another bottle.

I'd be lying if I said panhandlers and homeless people in this part of Florida are a welcome sight. Some of them are young, able-bodied and fairly intimidating, and I think the last time I gave one money was years ago in Fort Worth, Texas, when a guy wouldn't let me pass on a deserted street. But I appreciate the fact that a local blogger's telling stories that would otherwise go untold.

Credit: The photo of a street musician on St. George Street was taken by Bill Frazzetto and is available under a Creative Commons license.