Secure Google Calendar

A while back I posted that I switched to Google Calendar for managing my schedule, and I showed how I dumped a batch of dates into a calendar to get started: Add a batch of dates to Google Calendar. I've been using it every day now for two months, and it simply blows away every other online calendar I've used. I'm sharing dates and times with sk, keeping track of project milestones, birthdays, and holidays all in one space.

With all of this personal data flying around, I think it's important to use a secure connection when I connect to Google Calendar. Google offers an SSL connection, but they don't encourage it. In fact, even if you change your Google Calendar bookmark URL to https, you'll often be redirected to a plain old http connection. boo, Google! That's why I've found Mark Pilgrim's GMail Secure Greasemonkey script invaluable. It's built to force a secure connection for GMail, but the script itself is so generic that it works for other sites. Here's how to get the script working with Google Calendar:
  1. Install GMail Secure
  2. Choose Tools -> Manage User Scripts... from the Firefox menu
  3. Highlight GMailSecure, and click Add next to Included Pages
  4. Add two entries:

    http://google.com/calendar*
    http://www.google.com/calendar*

  5. Click OK to close
With this script installed, I know my connection with Google Calendar will be secure no matter how I get there. (And as a bonus, my GMail account is secured as well.) Sure, Google knows where I'll be at all times, but at least no one in the middle will.

Better Amazon RSS Feeds

A few years ago I put together a little tool to help assemble RSS feeds of Amazon products called the Amazon RSS Feed-Builder. I've been using feeds generated with this tool for about three years, tracking the latest books, music, and DVDs across series and artists that I like. Because publishers often announce books to Amazon well in advance, I know about new books in the Hacks Series well before O'Reilly announces the books on their own website. Amazon also offers pre-built feeds on their Amazon Syndication page.

These old-style Amazon feeds have worked well at alerting me about new products, but they are fairly limited. I just see the title, the author, and a price in my newsreader. I decided to upgrade my Amazon feeds so each item includes a product image (if available), a product description, and product details. And I figured if I was going to go through the trouble of upgrading my feeds, why not just upgrade the Amazon RSS Feed-Builder? So here's the new thing:

Amazon Feed Generator

It's hot off the assembly line today, and I'm sure there are bugs to be worked out. (It's also powered by orange gradients.) If you want to give it a shot, feel free to try it out and post any comments/problems on this post. As an example, here are the latest books in a Polar Exploration Feed. I subscribe to this feed, and I'm notified whenever new books about polar exploration show up in Amazon's catalog.

This uses the latest version of Amazon Web Services, with a custom stylesheet and Amazon's server-side XSLT service. And I want to say thanks to Alan Taylor for his recent article subtitled, AMZN-XSLT-JSON-AJAX (AXJA?). His stylesheet is a perfect example of consuming the new, more-complex AWS responses with XSL.

Polar Exploration

A mini-obsession of mine right now is polar exploration. (Not actual polar exploration, just reading about it.) When we were in New Zealand last February, sk and I went to the Canterbury Museum in Christchurch where they have a permanent exhibit about Antarctic exploration. The most fascinating part was seeing artifacts from early expeditions by Ernest Shackleton and Robert Scott. (Seeing their gear in person makes their survival stories even more compelling.) When I got back, I picked up Caroline Alexander's excellent account of Shackleton's failed Endurance expedition (aptly titled The Endurance), which includes hundreds of photos by Frank Hurley—the meticulous and talented expedition photographer. I've been reading the book very slowly, taking time to study the incredible photographs. The book text uses diary entries from several members of the crew, and often reads like weblogs. The crew complain about each other, praise each other, and paint a very personal picture of what they were going through.

And speaking of polar blogs, I recently tuned into Ben Saunders' blog. He's currently training in Greenland for an expedition in October to retrace Robert Scott's 1912 South Pole attempt. He's literally following in the footsteps of the early polar explorers, and posting photos and diary entries along the way thanks to a digital camera and satellite phone. Saunders recently posted about how he's able to blog from the middle of nowhere: Arctic Geeks.

ORblogs Turns Three

I run a site that pulls together blogs and posts by people in Oregon called ORblogs. The idea started as this post on this site: Oregon Weblogs, after I met Michael Buffington and Nick Finck for the first time at SXSW in Austin that month. I found out they both lived about 45 minutes away and I thought there should be some way for local bloggers to find each other.

I set up ORblogs.com with a simple link list of the Oregon bloggers I could find. Then a few months later (three years ago today) I moved from a simple list of links to a database-driven site that gathers posts and information about the blogs. And I moved from actively finding weblogs, to making the site a voluntary, participatory space. In fact, if you go to the blog detail page for this site—onfocus at ORblogs—you'll see that the date my weblog was added is June 3, 2003. A quick SQL query tells me there are 58 weblogs that are still active and were added that day. There are currently 1,055 active weblogs in the directory.

I've been able to virtually get to know a number of my fellow Oregonians by reading the site daily for three years, and I think it's helped me get to know my city and state better than I would have otherwise. I've even met a few bloggers in person, and I'm not sure that would have happened without the site. I also appreciate the fact that I see diverse viewpoints from people across the state. I don't always agree with everything I see flowing through ORblogs, but I think it's healthy to read outside of my normal ideological bubble once in a while.

So I just wanted to mark the milestone with a post. I always have grand plans for ORblogs, a whole stack of ideas I'd like to implement that would help connect Oregon bloggers and their ideas together. (I've been talking with people about an ORblogs get-together forever, that'd be a fun way to connect with other bloggers too.) But the site is a side-project, and I'm not making any money from it. Hopefully someday I'll figure out how to turn the intangible value I feel from participating at the site into tangible value so I can focus more time at ORblogs—a classic personal Web dilemma.

I'd also like to take this post to say thanks to all of the Oregon bloggers who have chosen to participate at ORblogs, who bother pinging the site, and who are teaching me more about Oregon every day. The site wouldn't exist without the Oregon blogosphere collectively nodding in ORblogs' direction.

Add Borders to Flickr Images

Flickr's recent move from beta to gamma introduced a slew of changes to the look and feel of the site. Most of the changes seemed to be centered around navigation, and finding ways to give quick access to all of Flickr's features. All well and good.

However, there was one fundamental design change in the upgrade that affects every image you view on Flickr—they removed photo borders. Flickr used to display a 1-pixel wide gray border around every photo, both on photo detail pages, and on photostream pages. This border was important because it separated the photograph from the background. The effect is subtle most of the time, but has a big impact with certain photos. Here's an example:

Flickr without borders

This photo of mine on Flickr has white at the edges, and without the border the photo bleeds into the background. Obviously you can imagine where the photo ends and page begins by drawing a mental line from the colored parts of the photo through the white parts of the photo. But the gray border used to do that work for you, and in the process made the site feel more solid.

Luckily, because I use Firefox, I can change the look of Flickr with a few lines of CSS. I put the gray border back on both image detail pages and photostream pages, and I'm already more productive thanks to eliminating the mental strain of imagining borders around photos. If you'd like to give your brain a little less work while browsing Flickr, here's how it's done:
  1. Locate your Firefox profile folder.
  2. Open the chrome folder and open the file userContent.css in a text editor like Notepad. (You might have to create the file if it doesn't exist yet.)
  3. Add the following bit of CSS to the file: @-moz-document domain(flickr.com) { .reflect { border:solid #999 1px !important; } .Photo img { border:solid #999 1px !important; } }
  4. Save userContent.css and restart Firefox.
That's all there is to it. Once the custom styles are in place, you'll see a Flickr with borders again:

Flickr with borders

I think light gray (#999) is the best color for the border, but you can make it lighter or darker by adjusting the value lighter (#ccc) or darker (#666). You might also experiment with padding and background colors if you want to mimic the white/gray borders I often use for photos here.

If you're not already obsessing over details like this, try tuning in to photo borders at other sites and in photo applications. Of course you're not supposed to notice the border (or lack thereof). But like any physical frame, pixel borders can enhance or detract from your photographs.

Update: After living with this for a day or two, I decided to go with a lighter gray border, #ccc. Just change #999 to #ccc in the CSS above if you'd like to do the same.

don't call this an update

I've been light on posts lately, but I'm still alive. Last weekend my folks were in town and we went over to Bend for a few days. We happened to catch the annual Pole Pedal Paddle where contestants punish themselves with a few intense hours of skiing (both kinds), biking, kayaking, and running.

ppp kayaker

I found a great first person account of the event at someone's blog: Pole Pedal Paddle.

ppp canoe

What I liked about PPP is that it turned largely solitary activities like kayaking, skiing, and running into a communal event. You wouldn't always want to kayak with hundreds of other people, but once a year it builds community. As I watched I thought about communal events in the virtual world, but couldn't come up with too many. In the early blogging days there was A Day Without Weblogs (now Link & Think) every year. But maybe weblogs are communal enough already so an annual group activity isn't necessary.

The scenic highlight of the Bend trip was Tumalo Falls:

tumalo falls

Unfortunately, the Cascade Lakes highway is still covered with snow—which we found out the hard way. But the road to Tumalo Falls had just opened, and the falls is probably at its peak this time of year. There's a short path that lets you walk up to and look over the falls.

We saw plenty of these little guys at the Lava Lands Visitor Center:

little buddy

I also saw the Da Vinci Code while I was in Bend. The movie is being universally panned, but I actually enjoyed it. (Maybe because I haven't read the book.) I think I enjoyed it because the hero of the story is a history professor. At one point in the film they're rushing through a city being chased by bad guys and Tom Hanks actually says, "I need to get to a library, quick!" Not your typical action hero line. We need more movies where knowledge is a more useful tool to the hero than a gun.

Computer Outlook Interview

oh hey, I'm going to be on the radio in a few minutes talking about Yahoo! Hacks. Tune into Computer Outlook if you want to listen in.

PB Vows 'No More Headlinese'

Try a search for the word "vows" at any news aggregator: Google, Yahoo. Everyone is vowing to do stuff across all news categories from entertainment to politics to technology to sports. I like a good vow as much as anyone else, but I vow not to use the term in my own post titles. Except this post, which is alternately titled: PB Breaks Vow on Headlinese.

Update: Jason noticed a lot of urging going on as well. And you can't help but notice the eyeing everyone is apparently doing.

Update 2: PB Eyes Wiki Headlinese, Urges 'Vows' Addition.

Finding Lost URLs

A week or so ago, a page by Professor Solomon called The Twelve Principles made the link rounds. The prof lays out a 12-step plan for finding any lost object. Most of the principles are mental tricks to get you back to the place you lost a physical object: your keys, your glasses, your cellphone, etc.

Unfortunately, the principles don't translate well to digital objects like URLs. You didn't stick that URL for the Xbox hacking How-To in your junk drawer, and it's not likely to be stuck in the "Eureka Zone" under your keyboard. But I lose URLs all the time. I remember something I saw on the web a couple weeks ago and I can't figure out how to get there again.

I don't have anything close to a 12-principle system for finding lost URLs, but I thought it'd be fun to examine my haphazard ways of re-finding web things. These are probably obvious, but I thought collecting them together would help me start a system for finding those lost pages, blog posts, and other digital artifacts that I'd like to see again.

1. Google - As you already know, Google is great at finding things, and I can usually get back to old URLs by remembering keywords for the document. Even if I don't find exactly what I was after, I can sometimes find good substitute information on the same subject. Unfortunately, a query like "SQL Remove Duplicates" will bring up thousands of documents, and if I'm looking for a specific bit of code I found once for removing duplicate records in a database the search has to go to the next stage.

2. Browse Browser History - Ctrl-H in the browser will bring up your surfing history and it can be a lifesaver if I know I visited the URL within the last week or two. It's especially helpful if I can remember the approximate time I was visiting the page I want to find, and I sort the history by date. But because browser histories only show the domain and page title, it's not very useful if I simply remember the subject of the page. I don't think of pages in terms of the domains they're hosted on, I think in terms of the page's content. (Searching your browser cache with something like Google Desktop might be better because you can search the full text of your browsing history, but I haven't started using this regularly.)

3. Revisit Web Haunts - Chances are good that I probably found the link I'm looking for at one of the sites I read regularly. Since I follow hundreds of sites with the news reader Bloglines, this can be a big search. Unfortunately the "Search My Subscriptions" feature at Bloglines isn't working for me, so generally I'll try to narrow down which site would have had the URL and then go back in time for each site individually using the "Display items within the last x" feature. Then Ctrl-F can help me find specific keywords within past posts. Google can also come in handy here. If I know I spotted a link about SQL on O'Reilly Radar, I can use the site: keyword like this: site:radar.oreilly.com SQL.

4. Search People - del.icio.us just rolled out a feature called your network that lets you track other del.icio.us members. There's no search yet, but you can browse back in time to see what people you know bookmarked at del.icio.us. I think this'll be handy, and I have gone back into specific people's del.icio.us archives looking for a URL. Having them all in one place is good for browsing, and saves time if I can't remember exactly who posted the link I'm looking for.

del.icio.us leads into my primary strategy for finding lost URLs: make links more findable before they're lost. Here's how I do it.

1. Use Web-based Bookmarks - I use del.icio.us (my bookmarks), but there are a bunch of web bookmark systems out there. When I come across a URL I know I'm going to want to get back to at some point, I'll click the del.icio.us bookmarklet and tag it. Searching my del.icio.us bookmarks is easy, but like your browser history, you're only searching titles, tags, and notes, not the full text of the site you bookmarked. Yahoo's My Web, and Google's Personalized Search both do better on the searching front—which leads to...

2. Turn on Search History - Privacy implications aside, I've found Google's Personalized Search handy for finding lost URLs even though I have mixed feelings about it. Once enabled, Google will remember every query you make and every search result you clicked on. You can then search just those sites that you clicked on in the past. Of course, that means everything you've searched for and every site you've clicked on is stored in a digital archive somewhere. I go back and forth, but privacy usually trumps findability for me so I might remove this option from my toolbox soon.

I should echo Professor Solomon's 13th principle: sometimes you can't find what you're after and you have to give up. The Web is ephemeral and pages come and go all the time. Even though it's maddening not to be able to get back to a document I know I've seen, that's life. What strategies am I missing?

Add Camera Images to Flickr

When I'm browsing photos on Flickr, I use the More Properties link quite a bit. That's the link that takes you to the Exif data associated with a photo if it's available. Embedded Exif data is how Flickr knows what type of camera took a particular photo, what the shutter speed was, aperture setting, and a bunch of other technical details about the state of the camera at the time the photo was taken. The more properties link is to the right of a photo on Flickr, and looks like this when it's there:

More properties link

The first thing I look at on the More Properties page is the camera model. But unless I know a particular camera model number already, it doesn't tell me much. "Ahh yes, the EX-Z750," I tell myself. Of course I have no idea what that model number means. So if I really want to know what type of camera the photographer used, I have to copy the model number, go to Amazon or Google, paste it in, and sort through the results. I knew there had to be a better way.

So I wrote a (relatively) quick Greasemonkey script that does the work of looking up the camera model for me. It even inserts a picture of that particular model on the Flickr "More properties" page. Here's what it looks like in action.

More properties page before:

More properties before

More properties page after:

More properties with camera image

And you can click the camera image to view more info about the camera at Amazon. Bonus for me: if you buy the camera through that link, I'll get a little kickback through Amazon's Associates Program.

Here's how it works. The script grabs the camera model from the Flickr page, contacts the Amazon API looking for that model in the Camera & Photo category, then grabs the image of the first result. Then the script inserts the image and a link to the product page into the page at Flickr.

It's not perfect. Sometimes Amazon doesn't carry that particular camera but has accessories that include a description with the model number. So you'll see a flash or remote shutter release instead of a camera. And sometimes the first result from Amazon isn't the correct model number—especially with older cameras. I'll keep tinkering with it to see if I can get more accurate results from Amazon.

If there's no match at all on Amazon, the script makes the model number a link to Google search results for that phrase.

The script just gives me a quick look at the type of camera that took the photo. I've been surprised to see cameras that look like video cameras taking nice still photos. Anyway, it was fun to put together and I learned a bit more about JavaScript.

If you already have Firefox with Greasemonkey installed, you can install this script for youself here: Flickr Camera Images

Thanks to the author of Monkey Match for a solid Amazon E4X parsing example, and of course Dive Into Greasemonkey. For more fun hacking around with with these applications check out Flickr Hacks and Amazon Hacks. (disclaimer: as you probably know I worked on both of these books.)

Add a batch of dates to Google Calendar

I've always used several calendars to plan out my life. Until recently, I used a paper desk calendar to track work-related events like project milestones. I used an insanely hacked-up version of PHP Calendar to track daily appointments and travel plans. And I used a paper calendar hanging in the kitchen to track family events like birthdays and anniversaries. And to be honest, with all of the calendars I still wasn't very organized. The distinction between types of events and the calendars weren't as clear-cut as I'm describing them, and I'd often have a work project milestone on my kitchen calendar, or a birthday in PHP Calendar, not in their "proper" locations.

What I like about Google Calendar is the ability to lay several calendars on top of each other. So I can keep the family birthdays separate from the project milestones, but I can still show them all on one calendar if I need to. And with a click, I can remove the dates that aren't relevant for what I'm working on at the moment. The calendar list looks like this:

calendar controls

I decided to make Google Calendar my One Calendar To Rule Them All, and the switch has been very easy. The Ajaxy interface makes adding events insanely intuitive—click a day to add an event on that day. And I love the ability to click and drag several days to add weeklong events like conferences. The other big advantage to going digital is the ability to share calendars with other people. I can't easily send all of the data on my paper calendars to friends and family without Xerox and Fedex involved.

The one issue I ran into during the conversion was with family events. I had over 50 birthdays and anniversaries I wanted to add to a calendar, and the thought of clicking Create Event and adding data for each one, or worse—hunting and pecking to find a particular day to click—wasn't appealing. So I thought I'd share my method for dumping a bunch of dates into Google Calendar. You just need a little time to get your dates together, some Perl, and a Google Calendar account.

Import/Export

The Google Calendar doesn't have an API (yet), but it does have a hacker's little friend called import/export. Google accepts two types of calendar formats for import: iCalendar and Outlook's Comma Separated Values (CSV) export. So if you already have calendar data in Outlook or iCal you can simply import/export at will. (Yahoo! Calendar also exports to the Outlook CSV format, so switching is fairly painless.) But I didn't know the first thing about either of these formats, I simply had a list of dates I wanted to dump.

Gathering Dates

I had a head start because I already had a list of family birthdays and anniversaries in a text file. I massaged the list a little to get it into a data-friendly format, and ended up with a file full of dates that looked like this:
4/18/1942,Uncle Bob's Birthday
4/28/1944,Aunt Sally's Birthday
7/23/1978,Lindsay and Tobias' Anniversary
8/10/1989,Cousin Maeby's Birthday
...
(obviously not real data.)

If you're building a list of dates from scratch you can use Excel. Just put dates in the first column in mm/dd/yyyy format, descriptions in the second. When you're done, save the file in CSV format, ignoring all the warnings about compatibility.

I called the file family_dates.csv. Yes, this is a comma-separated value list too, but not the format Google Calendar is expecting. Plus you don't want to add an event on April 18th, 1942. You want to add a full day event for April 18th, each year going forward. This is where I turned to Perl to massage the data.

The Code

This simple Perl script: calendar_csv.pl transformed the simple CSV list of dates and titles into the Outlook CSV format that Google likes to see. As you run the script it converts the year of the event into the current year, and adds an event for the next several years.

You'll need to customize the script a bit before you run it. Change $datefile to the name of your simple CSV file, in my case family_dates.csv. You can change $importfile to your preferred name of the output file, the default is import.csv. And you can set the number of years into the future that you'd like the date to appear by adjusting the value of $yearsahead, the default is 5. (If your events should only be added in the current year, set this to 1.)

Keep in mind that the larger the amount of data in your calendar, the longer it will take Google to load that calendar when you fire up Google Calendar. I originally set the $yearsahead value to 10, but with over 500 events, the calendar was noticably slowing the Google Calendar startup.

In addition to Perl, you'll need the standard Date::Calc module.

And if you're not in the US and would prefer dd/mm/yyyy format, simply change this bit: my ($month, $day) = to this: my ($day, $month) =. Instant internationalization!

Once everything is set, run the script from a command prompt, like this:

perl calendar_csv.pl

A new file called import.csv will magically appear with your dates formatted as Outlook CSV events. With the file in hand you can head over to Google Calendar.

Importing Data

Over at Google Calendar, click Manage Calendars under your calendar listing on the left site. Choose Create new calendar, and give your calendar a name and any other details. Click Create Calendar, and you'll see the new calendar in your list. Now click Settings in the upper right corner of the page, and choose the Import Calendar tab. Click Browse..., choose import.csv from your local files, set the calendar to your new calendar, and click Import.

That's all there is to it. You'll get a quick report about the number of events Google was able to import. Go back to your main view, and you should see your imported dates on the calendar, in the color of your newly created calendar. With one import, my view of April went from this:

calendar pre import

To this view with family birthdays the rust color:

calendar post import

(The details have been removed to protect the innocent.)

And once you have your calendar in Google, you can invite others to view and even help maintain the dates. Where I think this batch importing will be useful is for very large data sets. Imagine a teacher who wants to track the birthdays of students. It wouldn't be too hard to add the dates by hand. But a principal who wants to track the birthdays of everyone in a school will have an easier time putting together a spreadsheet than entering the days by hand. And even for my 50+ dates, writing a Perl script was preferable to entering the dates by hand.

So far I'm enjoying Google Calendar, and I haven't found any major problems beyond the limited importing ability. But now I really don't have an excuse for not sending out birthday cards.

Update (4/20): Google just released their Google Calendar API. I'll bet there are scores of hackers rushing to build bulk-import tools. Using the Calendar API would be a more stable way to import dates quickly. And wow! Hello, lifehackers!

Bloglines Update

Great news, Bloglines addressed the "onfocus/nofocus" problem and the Greasemonkey script I wrote isn't needed anymore. I got an email from Paul at Bloglines letting me know that, "Our anti-XSS code was being too aggresive and attempting to filter attribute values, in addition to attribute keys." Thanks, Paul! I'm very happy they took time out to address the problem because I think it's a great service and I didn't want to move to another reader. If you installed the Greasemonkey script, you can get rid of it. I deleted it from my server.
« Older posts  /  Newer posts »