<commit_before># **Tabletop.js** (gives spreadsheets legs)

**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies! If you've ever wanted to get JSON from a Google Spreadsheet without jumping through a thousand hoops, welcome home.

Tabletop.js easily integrates Google Spreadsheets with Backbone.js, Handlebars, and anything else that is hip and cool. It will also help you make new friends and play jazz piano.

### Like how easy?

    function init() {
      Tabletop.init( { key: '<KEY>',
                       callback: function(data, tabletop) { console.log(data) },
                       simpleSheet: true } )
    }

Will give you

    [ { name: "Carrot", category: "Vegetable", healthiness: "Adequate" }, 
      { name: "<NAME>", category: "Meat", healthiness: "Questionable" }, 
      { name: "Bubblegum", category: "Candy", healthiness: "Super High"} ]

Yes, that easy.

## Okay, wait, we've got a big problem. But a solution, too.

**Google broke Tabletop**. Kind of.

If you're signed in to Google and your session expires, Google now requires you to sign in to view published spreadsheets. Practically speaking, **this means Tabletop will fail for anyone who hasn't signed into Gmail for a while**. [More details here](http://productforums.google.com/forum/#!category-topic/docs/documents/0pneogfgzN0).

If you don't ever sign into Google, you're fine. If you're signed in, you're fine. It's only expired sessions that run into this issue, which is why it took so long for us to figure out what the deal was.

This *will break* existing apps.

Google knows it's an issue, but it isn't high priority, so they **don't have a fix planned until September 30th**. That's a long time to have a broken app, 'eh?

I highly highly recommend you use [Flatware](https://github.com/jsoma/flatware) or [table-service](https://github.com/martinburch/table-service) (or your own proxying solution) in the meantime. Proxies don't run into this bug since they never sign into a Google account, and they'll probably make your app faster, too.

I tried to make Flatware pretty easy to set up, but if you'd like a hand feel free to drop me a line at [<EMAIL>](mailto:<EMAIL>).

To ease the pain I've set up a public instance of Flatware at [http://flatware.herokuapp.com](http://flatware.herokuapp.com), although you're going to have to manually click `Sync all spreadsheets` when you want your updates to go out. If you plan on using it, you'll want to set `proxy: 'https://s3.amazonaws.com/flatware-live'` when initializing Tabletop. I'd also appreciate it if you dropped me an [email](mailto:<EMAIL>) or a [tweet](http://twitter.com/dangerscarf) giving me a heads up.

## Notes

## Getting Started

You might have seen some instructions on [http://builtbybalance.com/Tabletop/](http://builtbybalance.com/Tabletop/), but please ignore them, because they're *super super out of date*. Probably don't *break* anything, but they sure ain't current (not my domain, can't take them down). These docs here are the most up-to-date, so treat them as the gospel truth!<commit_msg>update README to reflect CORS fixes<commit_after># **Tabletop.js** (gives spreadsheets legs)

**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies! If you've ever wanted to get JSON from a Google Spreadsheet without jumping through a thousand hoops, welcome home.

Tabletop.js easily integrates Google Spreadsheets with Backbone.js, Handlebars, and anything else that is hip and cool. It will also help you make new friends and play jazz piano.

### Like how easy?

    function init() {
      Tabletop.init( { key: '<KEY>',
                       callback: function(data, tabletop) { console.log(data) },
                       simpleSheet: true } )
    }

Will give you

    [ { name: "Carrot", category: "Vegetable", healthiness: "Adequate" }, 
      { name: "<NAME>", category: "Meat", healthiness: "Questionable" }, 
      { name: "Bubblegum", category: "Candy", healthiness: "Super High"} ]

Yes, that easy.

## Okay, wait, we've got a big problem. But a solution, too.

**Google broke Tabletop**. Kind of.

If you're signed in to Google and your session expires, Google now requires you [to sign in to view published spreadsheets](http://productforums.google.com/forum/#!category-topic/docs/documents/0pneogfgzN0). While we've worked around the problem in recent versions of Tabletop (CORS to the rescue), old versions will experience this problem.

[Most browsers support CORS](http://caniuse.com/cors) so you will *probably* be okay. Google's sat on this for over a year so I doubt it's getting fixed. If you're still running into issues I recommend trying [Flatware](https://github.com/jsoma/flatware) or [table-service](https://github.com/martinburch/table-service) (or your own proxying solution) in the meantime. Proxies don't run into this bug since they never sign into a Google account, and they'll probably make your app faster, too.

## Notes

## Getting Started

You might have seen some instructions on [http://builtbybalance.com/Tabletop/](http://builtbybalance.com/Tabletop/), but please ignore them, because they're *super super out of date*. Probably don't *break* anything, but they sure ain't current (not my domain, can't take them down). These docs here are the most up-to-date, so treat them as the gospel truth!
{'fraction_non_alphanumeric': 0.09898804047838086, 'fraction_numerical': 0.0012879484820607176, 'mean_word_length': 4.056744186046512, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4765902', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1480, 'n_words': 706}