jsoma/tabletop — pull request #49 by andymason (2014-04-30 12:58:54+00:00)
Title: Fix extracting extracting sheets IDs longer than three characters

Currently the logic for extracting the sheet ID assumes IDs are always three characters in length, this is not true for the newer spreadsheets.

```javascript
var sheet_id = data.feed.entry[i].link[linkIdx].href.substr( data.feed.entry[i].link[linkIdx].href.length - 3, 3);
```
Fetching sheets with longer sheet ID results in "Cannot read property 'title' of undefined" in Tabletop.Model.

Example of a [new spreadsheet](https://spreadsheets.google.com/feeds/worksheets/1r4cMcDZfZlZZIvZz4_613v6G7xQ0OZX0WqbrWMFx8r8/public/basic) with sheets IDs longer than three characters.

```json
{
"link": [
{ ... },
{ ... },
{ ... },
{ ... },
{
"rel": "self",
"type": "application/atom+xml",
"href": "https://spreadsheets.google.com/feeds/worksheets/1r4cMcDZfZlZZIvZz4_613v6G7xQ0OZX0WqbrWMFx8r8/public/basic/ox9j01n"
}
]
}
```

This change will extract the last portion of the last link href no matter what the length.