Google Spreadsheet API

edited April 2014 in Library Questions

I've been trying to get a sketch running with the Google spreadsheet API for the past couple of days. Found a couple of great articles that really helped but have hit one slightly killer roadblock, writing to the spreadsheet.

I can read in about 20 different ways but whichever command/technique/method I try and use to send information i get an exception. Has anyone tried to do this sort of stuff recently?

A few sites/links that sorted me out this far...

https://developers.google.com/google-apps/spreadsheets/ - Google's home for the API

http://makezine.com/2010/12/10/save-sensor-data-to-google-spreadsh/ - couldn't get the writing part of this to work but could reuse the setup to read

http://blog.blprnt.com/blog/blprnt/open-science-h1n1-processing-and-the-google-spreadsheet-api - Blog article about data collection, works like a charm but doesn't include write functions. Added the code below to the end of SpreadsheetManager class

    void setCellValue(int col, int row, String data) {

    URL cellFeedUrl = worksheetEntry.getCellFeedUrl();

    try{
    CellFeed cellFeed = myService.getFeed(cellFeedUrl, CellFeed.class);
    CellEntry input = new CellEntry(col,row,data);
    println(input.getCell().getRow());
    input.changeInputValueLocal(data);
    println(cellFeed);
    input.update();
    //OR
    //myService.insert(cellFeedUrl, input);
    }catch(Exception e){
     println("Data couldn't be added"); 
    }
    };

Answers

Sign In or Register to comment.