Saturday, December 13, 2008

Migrated from WordPress to Blogger. Good Lord.

When I created this blog, it wasn't possible to host your blog under your own domain name using Blogger like you can today. That was a big turnoff for me, so I decided to host my own blog using WordPress. I also liked the idea of being able to do whatever I wanted to my blog since the source code was living on my server.

As it turned out, having total control was never that interesting to me. As I noted when I started the blog, I didn't want it maintaining it to feel like a job, so I never made many changes to the PHP. I made a few tweaks to one of the default templates instead of trying to create my own, and I may have installed a plugin or two, but I didn't really touch those very much either.

Now consider the downsides of hosting your own blogging software:
  • You have to be aware of security vulnerabilities that arise in the software and update the system yourself when they happen. (My WordPress blog was hacked and spam links were inserted into my posts.)
  • You have to stay on top of the world of comment spam (which my WordPress blog suffered from) and patch your system accordingly (if patches are available) if you want to keep it out of your blog.
  • Your readers have to create separate accounts (as opposed to their Google Accounts, which I expect most of my readers to have) if they want to comment on your blog.
  • Your WordPress username/password is just one more thing you need to remember.
A friend pointed out the spam in my blog, and I knew that my version of WordPress was outdated, so I decided that I would finally tackle the migration. This turned out to be about as much fun as I expected it would be:
  • The migration required me to upgrade WordPress (just what I was trying to avoid!) because my existing version of WordPress (1.5?) didn't have the export feature that the Internets recommended I use.
  • I tried to upgrade WordPress on bolinfest.com, but that turned out to be impossible because bolinfest.com doesn't have PHP 4.3 (it has 4.2.2), and from past experience, I know that trying to upgrade PHP on Redhat 9 (yep, that's what bolinfest.com currently runs on -- clearly I have another migration in my future) is its own disaster, so I didn't even try.
  • I ended up doing a mysqldump of my Wordpress database and installed a new version of WordPress on a separate (more modern) server. (This required updating the siteurl and home options in the wp_options table to match the new server; otherwise, I couldn't load upgrade.php which runs the upgrade process.)
The one thing that shocked me while I was doing all the Googling to solve this problem were the number of people who are trying to migrate from Blogger to WordPress rather than the other way around. Sure, Blogger has its share of things that annoy me (I have to manually edit the height of the Compose box in Firebug to make it a reasonable size, and the HTML it generates for my post is completely unlike anything I would write had I done it by hand, making it hard to clean up), but WordPress has most of the same problems and requires so much extra maintenance!

What is wrong with you people?

Sunday, March 2, 2008

Fixed up iGoogleBar

It turns out the iGoogleBar needed a one-line fix to address what I can only assume was a recent change in Gmail. I updated the code in the Chickenfoot script wiki as well. Version 0.5.2 is now the latest version, so go to Tools -> Add-ons in Firefox to see if you have the latest version -- hit the Find Updates button if you don't!

Monday, February 4, 2008

iGoogleBar: Just because I haven't released a Firefox extension in awhile

iGoogleBar is my latest Firefox extension that adds Google Apps favicons to the Google Apps Bar, using them as triggers for the Apps' respective iGoogle Gadgets. As a courtesy to some of my colleagues, I included their projects in the bar so they’re easier to get to (or just preview) from Gmail and Calendar.

I built this extension using Chickenfoot, which hit version 1.0 recently. Part of that release included improvements to the extension-packaging tool, which made it much easier for me to convert my iGoogleBar prototype into a full-fledged Firefox extension!

The iGoogleBar page acknowledges that there are some missing features from the extension, so I put the source code in the Chickenfoot Scripts Wiki. That means, if you’d like to see a new feature added, please go and update the Wiki instead of just nagging me :) If I like your patch, then I’ll make a new release. And if I don’t like your patch, then you can at least install your modified version of iGoogleBar as a trigger in Chickenfoot.

Will this method of software development actually work? Probably not, but it should be fun to try!

Friday, December 14, 2007

Get all your Tweets in Google Reader

I noticed that when I visit my Twitter page, I see some tweets on twitter.com that do not show up when I look at my Twitter feed in Google Reader. I checked to make sure that the missing tweets were in Twitter's feed by loading it in my browser, and they were, but only when I was logged in to Twitter.

The "missing" tweets belonged to my friends who make their tweets protected, which is why I can only see them when I'm authenticated by Twitter. Like most things on the web, authentication is simply the matter of providing the appropriate cookie with an HTTP request, so I decided to write a little script to get my authenitcated Twitter feed. To do that, first I needed to get my Twitter cookie, which you can get by entering this in the address bar when logged in on any twitter.com URL:
javascript:void(document.body.innerHTML = document.cookie.match(/auth_token=(.*);/)[1])

That should replace the text of the page with your Twitter cookie, making it easy to copy and paste in the script below:
wget --quiet --cookies=off --header "Cookie: auth_token=COOKIE" TWITTER_FEED_URL -O SECRET_OUTPUT_FILE

  • COOKIE should be the Twitter cookie that you just copied
  • TWITTER_FEED_URL should be the URL to your Twitter RSS feed
  • SECRET_OUTPUT_FILE should be a file on your Linux machine that is served publicly, but has a long, unguessable URL that people can't stumble upon and use to read your friends' secret tweets! Using /usr/bin/uuidgen may be a good way to come up with a filename (though remember to add an .xml suffix to the filename to ensure your browser serves the URL with the correct MIME type). This URL is what you will add to Google Reader.

Now that you have your one-liner, you'll want to put it in a cronjob so you will periodically update your local file with the contents of your full Twitter feed. I just made a shell script with the command above (remember to chmod 700 your shell script and to chmod 640 your output file!), followed by this command to ping Google Blog Search so that Google will know about your updated feed:
curl --silent http://blogsearch.google.com/ping?name=bolinfest+and+friends&url=YOUR_SECRET_URL > /dev/null

Once your file is written, add YOUR_SECRET_URL to Google Reader, and you're all set!

Saturday, September 1, 2007

There's a lot to hack on these days...

Because I haven't posted in awhile, you might think that I haven't been hacking, but I assure you that is not the case! Between the Facebook Platform and the iPhone, there are many new opportunities to explore lately. Nevertheless, my most recent (published) work is still related to my favorite product!

Last week, I posted about the introduction of Calendar Gadgets on the Google Code Blog. Although most people are probably most excited about the new horoscope and sudoku calendars, my biggest contribution is my updated xkcd calendar:

xkcd with full tooltip

Normally, if you looked at Friday's xkcd comic in Firefox and moused over it, you would see Could be worse. The last guy in that situation fell for one of the transient trumpeting a... because Firefox 2 clips the title attribute of the image at 80 characters. After great debate on the subject, the 80-character limit is going to be fixed in Firefox 3, but until then, I created a Google Gadget that displays an image with its full tooltip (you can optionally hyperlink your image as well) that I use to host the content of the xkcd calendar. (This was inspired by Mihai Parparita who fixed this for Google Reader.)

Also, since school is back in session, Mike Lambert and I updated mitcalendars.com with links to all of the Fall 2007 MIT course schedules hosted on wikicalendars.com. Sadly, wikicalendars.com has not taken off as we had hoped (it does get a lot of spam, though!), but if we ever have time to make it as easy to add events to wikicalendars.com as it is to add events to Google Calendar, then I think we'll do a lot better.

Oh! And unfortunately I missed Google Developer Day this year because I was too busy working on the Google Calendar gallery, so I didn't have a chance to comment on mapplets, which are really cool! With a few PHP includes, I was able to turn CalMap into a mapplet. I'm sure you can do the same with your own Maps mashups, so give it a try!

Monday, May 28, 2007

Facebook Platform: First impressions

Facebook recently announced that it has dramatically expanded its API to allow deep integration into facebook.com, aptly naming the project Facebook Platform. The potential integration points for a Facebook Application look very appealing, but developing for the Platform itself still seems a bit rough around the edges.

To start, I just wanted to put my own IFRAME inside Facebook. (As you may have noticed, I like sticking IFRAMEs where they don't belong.) I didn't feel like watching any of the videos to learn about the platform because I preferred to do textual searches. Unfortunately, the search box on http://www.facebook.com/developers/ searches Facebook profiles, not developer docs, so I'm not sure whether this is possible on Facebook. (Using site:developers.facebook.com on Google seems to work, though.)

On the Platform Wiki, I found a link to an external tutorial on creating apps with canvas pages which seemed promising, but it also addressed authentication issues and required me to download some PHP code, neither of which I was particularly interested in (this seemed like overkill just to embed an IFRAME), so I moved on.

I tried to start configuring my application directly, so I added the Developer Application like Facebook told me to, created a new Facebook app, and started editing its settings. You'll likely discover that the textboxes for URLs are way too small, but you can fix that with one line of Chickenfoot:
for each (var t in find('textbox')) t.element.size = 80;

Now that that was out of the way, I tried to wrap my head around the difference between a URL for my web site and a Facebook canvas URL. Apparently, you get some namespace under http://apps.facebook.com/example.com/ which maps to real URLs on your own domain, such as http://example.com/facebook/. The developer has to keep track of this mapping himself, so when asked for something such as the Side Nav URL, you need to supply the apps.facebook URL instead of the one from your own domain. Why isn't this mapping done automatically? Why can't I use the URLs that I already know instead of the ones that Facebook invented for me?

There's also something strange about the role of your Callback URL (or is it "Url?"). I tried to use the authentication overview link to learn about it, but that page (http://mit.facebook.com/developers/documentation.php?doc=auth) gave me a 404.

issues in editapp.php in Facebook

Fortunately, there is some information on the wiki about the callback page -- it seems that is serves both as your login handler as well as your home page, which I suppose works out all right if you're authenticating users' Facebook tokens, but if you just want to show a static page, there isn't much point.

Finally, Facebook appears to be finicky about using explicit URLs (perhaps it's a security thing?), so using http://example.com/facebook/ as your Side Nav URL is automatically converted to http://example.com/facebook/index.html even if your Apache DirectoryIndex directive points to something else. For a site who probably has its DirectoryIndex set to index.php, I find this a bit surprising.

As you can imagine, I spent quite a bit of time playing around with the Edit page, as I imagine most new developers do. It would be really nice if the Save button were an Apply button instead that applied the changes without reloading the page since there's a good chance that the URL that you just entered was the wrong one, so you're going to have to return to the Edit page again, anyway.

In the coming weeks, I'm sure we'll see a number of these issues get cleaned up (as well as adding *cough* search *cough* to the Application Directory) -- you never really know what bugs your API has until developers start using it. I trust that the Facebook developers were working very hard to get the platform ready for F8, but their job is certainly not done -- no rest for the weary, kids!

Thursday, May 3, 2007

Your Page Here (an iGoogle gadget)

Some of you have probably seen the experiment on google.com that brings Google apps closer to the home page. But if you find that they still aren't close enough for you, then I have a new gadget for iGoogle (which is a much better name than Google Personalized Homepage) that might help you out. My gadget is called Your Page Here because it lets you use any page you like as the content for one of your iGoogle tabs:

Your Page Here screenshot


Note that if you add this gadget to a tab, it eclipses all of the other gadgets on the page, so you probably want to create a new tab for Your Page Here before installing it. Once you have it on your page, the settings are pretty simple:

Your Page Here settings screenshot


All you have to do is enter a URL and you're ready to go. Come on! Try it for yourself: Add to Google

And if Calendar isn't your thing, then I recommend trying out Google Reader (http://reader.google.com/) with Your Page Here.

Thanks to Chris McAndrew for suggesting this hack to iGoogle.