Archive for the ‘Web’ Category

IM/Chat over HTTP without browser plug-ins

Friday, August 12th, 2005

The past couple of months I’ve been pondering an idea. It isn’t a new one, or anywhere close to groundbreaking, but I don’t think anyone has accomplished anything quite like it before. I want to write an IM/chat system that is as responsive and real-time as native IM/chat programs, and that operates solely over HTTP, with vanilla browsers – no Java applets, no ActiveX plug-ins, just Javascript that all modern browsers support. The advantage of such a system is that it could traverse firewalls and proxies traditionally used to block users from using IM/chat, and that users would never be prompted to install applets or plug-ins that many users distrust (for good reason too).

So, why hasn’t it been done before? When I first had the idea I thought surely there would be at least 10 similar projects already. I found several attempts, but none seemed to fit the bill – some communicated entirely over HTTP but required Java applets, some didn’t use any applets or plug-ins on the client but weren’t responsive or real-time (updates were polled for ever 2 secs or so). Looking at the current field of attempts there seemed to be a couple of challenges that I would have to find a way around.

  • HTTP/1.1 supports keep-alive connections, but they don’t work well for 2-way communication. The client still must initiate every exchange, so the server can’t send messages to the client on demand.
  • A client repeatedly polling a server for messages (even when there are none for it) puts a lot of unnecessary load on the server, and generally results in a poor user experience. The programs I looked at that used this model often felt very laggy and sluggish – they certainly didn’t feel like native applications.

(more…)

Flickr – Yahoo deal

Monday, March 21st, 2005

As pretty much everyone who reads anyones blog knows by now, Yahoo is buying Flickr. I hope this doesn’t change Flickr’s wonderful open philosophy. Their API should be a model for all sites, no matter what service they provide. It is well documented (but not overly verbose), and extremely flexible. Hopefully Yahoo’s $ can help Flickr deal with some of the capacity and stability challenges that have come with their incredible growth. Flickr may also be able to contribute a lot on the usability front to Yahoo’s different sites, some of which haven’t improved in this area for 3-4 years. We’ll just have to see how it all works out.

Bye Bye Comment Spam

Wednesday, January 19th, 2005

Good news for all the bloggers battling comment spam: Google has come up with a plan to reduce the effectiveness of the spam to raise spammer’s PageRank. I doubt that it will stop the spam from coming immediately. But hopefully after some time of not seeing their PageRank rising from all the spam links the spammers will get the point. Who knows how long it will take to get the message out to all the zombie machines they have doing the spamming for them though.

Flickr Gallery 0.7

Saturday, January 8th, 2005

This project is now closed. Please use the much superior FAlbum if you want to integrate Wordpress and Flickr.

This plugin allows users of WordPress (and other clever people who can figure out how to make it work without WP) to display their Flickr photos on their own site. It is advised that users of previous versions of the plugin upgrade to this one. New features in this version:

  • “Friendly” URI generation
  • Link to Flickr slideshow of photosets
  • Support for new Flickr image URLs
  • Security conscious cache file names

Features that were already there include:

  • Flickr photosets as “albums” – complete with descriptions and meta
  • Support for Flickr “notes” feature – just this plugin uses all CSS and Javascript instead of Flash (the plugin’s output looks like this)
  • EXIF data support to display camera settings the photo was snapped with — in addition to the description and meta info from Flickr
  • Valid XHTML output
  • Option to respect photos marked “private”
  • Thumbnail size choices
  • Pagination of albums and photos in albums

Get the latest version in .tar.gz format here or .zip format here.

Ryan has posted a guide for using this plugin with WP 1.5. Unfortunately I still haven’t gotten arround to making it easier to integrate with WP 1.5, but Ryan’s writeup sums it up pretty well.

If you are having issues with the new Flickr authentication API please consider the FAlbum project over at RandomByte. It is a branch of this project, and contains some neat features I simply haven’t had time to implement.

I know some people might be wondering where the interface for adding notes to photos is. For a while I worked at incorporating something like FotoBuzz or FotoNoter into the plugin, but in the end decided it was too hackish because both of those solutions are meant to actually store the notes in the JPEG. To store the notes in Flickr we just have to pass them to an API method. So, if anyone is a Flash guru (I’m not) with a little extra time maybe we could work together to create an interface that doesn’t feel so hackish, both from a usability standpoint and from an integration with this plugin standpoint. (more…)

Flickr enriches their API even further

Monday, December 6th, 2004

FlickrFlickr has enhanced their already rich API even more by adding methods for creating, editing, and deleting “notes”. I’ve been waiting for this so that I can integrate notes features better into my Flickr Gallery WP plugin.

The preliminary plan is to try to use FotoBuzz as an optional interface for adding notes to your Flickr photos through my plugin. This will require a bit of work because I will have to re-write the open source back-end (released under the LGPL) of FotoBuzz to store notes on Flickr instead of embedding them in the image files. To do this I have to figure out how to talk to the front-end of FotoBuzz, which is just going to take some experimentation because the Flash (yuck) GUI part of FotoBuzz is closed source (but still free to distribute because it is released under the CC Attribution-NonCommercial-NoDerivs 2.0 license) and undocumented.

Hopefully I will get some time in the next few days to work on this a little. I’m pretty excited about it.

Other features I’ll hopefully be adding to the plugin in the next few days:

  • Ability to create human-readable (or at least more friendly) URIs with the help of mod_rewrite and .htaccess files
  • Options to show the CC license photos are released under
  • Options to choose which visibility level to display (public, friends, family)
  • Probably a couple more bug fixes (as my rag-tag band of testers find bugs)

(more…)

FotoBuzz

Tuesday, November 30th, 2004

FotoBuzz is a nifty Flash and PHP/Python widget for adding annotations to your photos. One of the few Flash things I have seen that could actually be useful (Flash is way overdone lately). Also, the user interface is a bit nicer than Flickr’s similar feature “notes”. Could be a nifty add-on to my Flickr Gallery WP plugin when the Flickr API starts to support adding notes. Cal Henderson of Flickr says the following regarding notes features being in the API:

oops – it’s not actually. api methods to deal with notes are half done. i need to port them across from the old api at some point soon. i definately plan to.

Interestingly, FotoBuzz stores the notes actually in the image file. Not exactly what I would want it to do for easy integration with Flickr, so I’d have to modify it a bit (the PHP/Python parts where the code would need to be changed are released under the LGPL — but the Flash part is under the CC Attribution-NonCommercial-NoDerivs 2.0 license so I can’t [and don't want to] touch it). The changes shouldn’t be too hard to do, so I’m really just waiting on Flickr to allow posting notes through the API. It would be neat to have users be able to add notes to your photos through the Flickr Gallery plugin instead of having to follow the link to Flickr to do so (which nobody ever does).

Flickr Gallery 0.6

Tuesday, November 30th, 2004

This project is now closed. Please use the much superior FAlbum if you want to integrate Wordpress and Flickr.

Update (1/8/2005) – A new version is available here with some of the features requested in this post’s comments and also some bug fixes.

Flickr’s recent outage uncovered a bit of a security hole in my Flickr Gallery plugin. When Flickr goes down, or for some other reason your server can’t execute the API calls against their server, the remote fopen() calls were blowing up. The fopen() calls were throwing warnings (unless you have warnings turned off in PHP – which you should) that showed the entire URI of the API call it attempted to make, including the user’s email and password. Obviously this is undesirable. So, I’ve manually surpressed errors and warnings on any statement that could contain a password so we don’t get passwords spit out in the output stream anymore and caused it to fail back to the cache if that happens.

Also, Stewart (a Flickr developer) made a good point about EXIF data not needed to be refreshed in the cache because the EXIF data won’t be changing, so I’ve made that caching permanent. Stewart also had some concerns about how often we were refreshing the API call cache, so I’ve extended that from 10 mins to 1 hr by default. Unfortunately that’s not quite as drastic as Stewart would like us to be, but I think it is fair because the caching the plugin does is pretty efficient from their perspective (no matter how many users hit your gallery pages, the plugin will only hit the Flickr API once per hour for each API call).

So, this should probably just be a minor number release (security and bug fixes), but I’m making it a major number release because I’ve also added a few features like:

  • Pagination of albums and photos in albums
  • Slightly better navigation through gallery

Get the newest version in .tar.gz format here or .zip format here. Follow the installation instructions in the README.txt. Or follow the installation instructions here, except now the line you put in your gallery.php file is (to support paging):
<?php flickr_show_photos($_GET['album'], $_GET['photo'],
$_GET['page']); ?>

System Requirements:
PHP 4.1 or greater – with allow_url_fopen enabled (to make remote API/REST calls and download images)
Wordpress isn’t actually required because this doesn’t use any of WP’s plugin hooks

Of course this code comes with no guarantee. If you need support I’ll be glad to help (within reason) — just shoot me an email. If you want to suggest future features or just tell me that you are using my plugin I’d appreciate that feedback too.

Copyright (c) 2004
Released under the GPL license

Flickr Gallery 0.5

Tuesday, November 23rd, 2004

This project is now closed. Please use the much superior FAlbum if you want to integrate Wordpress and Flickr.

Update (1/8/2005) – A new version is available here with some of the features requested in this post’s comments and also some bug fixes.

This is an update to my Flickr gallery plugin with a couple new features and some bug fixes. Some of the salient features include:

  • Flickr photosets as “albums” – complete with descriptions and meta
  • Support for Flickr “notes” feature – just this plugin uses all CSS and Javascript instead of Flash (the plugin’s output looks like this)
  • EXIF data support to display camera settings the photo was snapped with — in addition to the description and meta info from Flickr
  • Valid XHTML output
  • * new * Option to respect photos marked “private”
  • * new * Thumbnail size choices

You can download it in .tar.gz format here or .zip format here.

An example installation can be found here. Read on for installation instructions. (more…)

Flickr Gallery 0.4

Saturday, November 20th, 2004

This project is now closed. Please use the much superior FAlbum if you want to integrate Wordpress and Flickr.

Update (1/8/2005) – A new version is available here with some of the features requested in this post’s comments and also some bug fixes.

I’ve been working on a Wordpress plugin that integrates some of Flickr’s great photo sharing services. This plugin allows you to display your Flickr photos and photosets on your site like a photo gallery using Flickr’s API. Some of the salient features include:

  • Flickr photosets as “albums” – complete with descriptions and meta
  • Support for Flickr “notes” feature – just this plugin uses all CSS and Javascript instead of Flash (the plugin’s output looks like this)
  • EXIF data support to display camera settings the photo was snapped with — in addition to the description and meta info from Flickr
  • Valid XHTML output

You can download it in .tar.gz format here or .zip format here.

An example installation can be found here. Read on for installation instructions. (more…)

Flickr performance problems

Thursday, November 11th, 2004

FlickrI’ve noticed that Flickr has been having performance problems of late (mostly while I was developing a Flickr photo gallery plugin for WP). They mention them in FlickrBlog here. You can see their traffic graph for one of the problematic days there too. Flickr’s growing popularity is certainly stressing their systems. Also it appears that there was some sort of attack that contributed to the problem. So the problems appear to be due to network design decisions that couldn’t quite scale to meet Flickr’s new popularity, and malicious activity probably also due largely to their new popularity. Looks like it’s hard to be popular.

The Flickr engineers were able to respond reasonably fast and the issues seem to be mostly resolved by now. As popular as Flickr has become of late, I wonder what their bandwidth bill looks like.