sunlightlabs/Capitol-Words — Issue #26: Speech URLs are weird and unpredictable
Author: klondike
Created: 2011-10-14 20:28:56+00:00
State: open

It's difficult to go from this API result:
https://gist.github.com/1288224

To its corresponding URL:
http://capitolwords.org/date/2011/09/21/H6330-6-a-celebration-of-hispanic-heritage-month

Four things are weird about this URL -

1) The first part of the final item in the URL, "H6330-6", is only discoverable via the API by applying a regex to the origin_url. The "pages" field is "H6330-H6331", and the "order" field is 1.

2) It doesn't matter what the final part of the final item (the slug) is:
http://capitolwords.org/date/2011/09/21/H6330-6-aksjdhfaskjdhfakjsdhf

3) But if the slug is removed from the URL, it goes to something entirely different:
http://capitolwords.org/date/2011/09/21/H6330-6

4) If you change the first part of it slightly, to be "H6330-1", this leads to the same item as "H6330-6":
http://capitolwords.org/date/2011/09/21/H6330-1

5) But if you add a slug to the end of that, it raises a 500 via an IndexError:
http://capitolwords.org/date/2011/09/21/H6330-1-askjdfhs