The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Redirection hell in an aggregator

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Redirection hell in an aggregator Posted: Jul 13, 2006 2:15 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Redirection hell in an aggregator
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Gordon Weakliem points to Charles Miller, who has run into the infamous hotel 301 problem - Charles says:

On a recent trip to the USA, Scott stayed in a hotel with a ‘net connection. The connection was one of those with an arbitrary web-based registration that made sure you’d agreed to their ass-covering terms of service. Until you had agreed, the hotel’s proxy would redirect any HTTP connection to the registration page… using the 301 status code.

Within a few seconds of plugging in the ethernet cable, all of Scott’s RSS subscriptions had been silently replaced with the hotel’s registration page URL. All the original feed URLs were lost.

Considering this, Gordon writes:

Lots of aggregator developers have been burned by the hotel proxy problem. The problem is that as a developer who read the spec, you tend to think that other developers did the same. The interesting thing is what to do with the 301. So you ask the user if they want to accept the redirect. Does the user even understand what that means? Let's see, "Some server is saying that the resource at http://example.com/rss.xml has moved to dumbhotelproxy.com. Do you want to change your subscription?" Considering the amount of effort people are putting into making it easy to subscribe to an RSS feed (because the users don't know what to do with XML, or the orange XML button), I have no idea how to pose that question such that the user might actually do the right thing.

I ran across this one myself over 2 years ago with BottomFeeder (thank goodness I back up feeds at startup!). I stay in hotels that have 12 or 24 hour subscriptions often enough that I wanted a permanent solution to this problem, so I came up with one:

  1. When I see a redirect, I cache the old address
  2. If I see more than a handful (default: 3) of redirects to the same place, I stop the update loop and restore the old urls

Here's the code I use to make that call:

 
 

httpRedirectEvent: anUrl
	"we got a redirect - check to see if we have more than one this
cycle that went the same place.  If so, assume that we have a proxy
of some sort, and revert it all back"

       self redirects add: anUrl.
	(self redirects occurrencesOf: anUrl) > self tooManyRedirects
	       ifTrue: [self resetOriginalsAndStopUpdates: anUrl.
	                       self redirects: OrderedCollection new].


Each redirect generates an event, which ends up in that method. You can see how it works, and it's saved me from this problem more than once. Now, how easy do other frameworks make it for you to do this sort of thing? I have no idea. It was a few minutes work to solve it in Smalltalk though

Technorati Tags: , , ,

Read: Redirection hell in an aggregator

Topic: When will newspapers see the long tail? Previous Topic   Next Topic Topic: Smalltalk Meeting in LA

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use