HTTP resource watcher
I've got most of the features of my HTTP resource watching code I was working on for GWeather done. The main benefits over the existing gnome-vfs based code are:
- Simpler API. Just connect to the
updatedsignal on the resource object, and you get notified when the resource changes.
deflatecontent encodings, to reduce bandwidth usage.
- Keeps track of
Etagvalue for the resource so that it can do conditional
GETs of the resource for simple client side caching.
- Supports the
Expiresheader. If the update interval is set at 30 minutes but the web server says that the it won't be updated for an hour, then use the longer timeout til the next check.
- If a permanent redirect is received, then the new URI is used for future checks.
- If a
410 Goneresponse is received, then future checks are not queued (they can be restarted with a
I've also got some code to watch the HTTP proxy settings in GConf, but that seems to trigger a hang in libsoup (bug 309867).
While I wrote the code for use in GWeather, it could be quite useful for other tasks that require watching an HTTP resource such as:
- HTTP calendar backend of
- A stock ticker applet like
- Possibly an RSS reader.
The code is available in my Bazaar archive:
baz get http://email@example.com/http-resource--devel--0
Grahame Bowland -
Will Davyd let you commit it? It sounds pretty neat. It's a bit of a shame gnome-vfs is so gross :P