google

  • Yet another site you can ping when you update your blog. This one's for Google's Blog Search. Ping!
    filed under: google, weblogs, webservices
  • Nice tutorial that shows how you can saturate the colors in a photo by switching to Lab Color mode and messing with the channels. [via nelson]
    filed under: flickr, photography, hacks
  • search for code in specific languages (except VB?) from across the web.
    filed under: development, google
  • lectures from UC Berkeley classes online. [via Searchblog]
    filed under: education, google, presentations
  • a story about the dark side of ubiquitous computing by Bruce Sterling. "If 'religion is the opiate of the people', then immersive multiplayer 3D virtual worlds are hard-core Afghani heroin."
    filed under: future, google, privacy, writing
  • "But simply by enhancing my ability to google, this guide -- now in a meaty third edition -- is worth the price. It's the Missing Manual to Google." - Kevin Kelly
    filed under: books, google, hacks
  • Jason's vacation photos from Austria are great.
    filed under: photography
  • This is a colorful headline from The Money Times. They could have had a trifecta by working in the phrase "thin blue line".
    filed under: greatheadlines
  • Climatologist James Lovelock: "Our global furnace is out of control. By 2020, 2025, you will be able to sail a sailboat to the North Pole. The Amazon will become a desert, and the forests of Siberia will burn and release more methane..."
    filed under: environment, cosmic
  • Google's Flickr competitor (via nelson)
    filed under: google, photography
I'm going to start pulling my del.icio.us links in as a post like the cool kids do. Here are the links from yesterday to kick things off...

My Road to Google Hacks

I'm happy to announce that the new edition of Google Hacks has been released into the wild. I started working on Google Hacks, 3rd Edition earlier this year and now it's finally hitting the shelves. I had the fun task of contributing a slew of brand new hacks to the book, updating existing hacks, and tweaking the structure of the book to bring it up to date. Rael and Tara had already put together two editions of Google Hacks that were fantastic, and I'm glad to be in their company by bringing the book up to date.

Working on Google Hacks has brought me full circle on my personal Hacks Series adventure. In April, 2002—shortly after Google announced their Search API—I put together Google Smackdown to try out the API. I didn't think of the Smackdown as a hack per se, but a few months later I got an email from Tara asking if I'd like to contribute the code to a book about Google. I added some comments to my code, passed it on to her, and that was my first contribution to the Hacks Series. It turns out the Smackdown is a hack, and I'd been hacking applications together for quite a while.

Since then I've contributed three books to the series, one with co-author Jim Bumgardner (Flickr Hacks). In the process I even came up with my own method for writing hacks for the series: How I Write a Hack. The chance to work on Google Hacks brought me back to my first contribution, and if I remember correctly, the first book in the series.

The second edition of Google Hacks came out toward the end of 2004, and nothing's really been happening at Google since then. ;) There was a lot to cover, and this new edition tackles hacking Google Maps, covers working with blogs and Blogger in more detail, and covers tinkering with a host of other new Google applications such as Google Video Search, Google Talk, Google Reader, Google Personlized Search, Google Analytics, and on and on. I also added information throughout about protecting your privacy, and I hope it helps readers understand the trade-off we all make between convenience and sharing personal information with a large company. I found there's an art to keeping up with news about Google, so I included an Appendix of sources you can tune into to stay on top of Google's moves. And of course the book still provides a complete reference to squeezing the most out of Google's Search Syntax, Gmail, tuning your site for Google, their Search API, their desktop tools, and a bunch of fun tricks and games (like the Smackdown) that people have built to customize Google or generally mess around. shew!

I received my copy of the book a couple days ago:

Google Hacks, 3rd Edition

And it's satisfying to see the end result. You should be able to get your copy at bookstores everywhere now. To preview some of the new stuff, check out O'Reilly's page for the book: Google Hacks, 3rd Edition. You'll find a Table of Contents there, and five sample hacks. Happy Google Hacking!

Update: Here's O'Reilly's press release about the book: The World According to Google.

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.

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 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!
« Older posts  /  Newer posts »