getGoogleDocsConnection     package:RGoogleDocs     R Documentation

_C_o_n_n_e_c_t _t_o _G_o_o_g_l_e _D_o_c_u_m_e_n_t_s _s_e_r_v_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     These functions provide the mechanism with which to  login to
     Google Docs and create a connection which caches the
     authentication so that it can be used in subsequent interactions
     with the Google Docs API within this R session.

     If the login and password are not specified in a call to either
     function, we look for it in the option named 'GoogleDocsPassword'.
     This should be a vector of length 2 giving the login and password,
     or alternatively a  named character vector of length 1 where the
     value is the password and the  name is the login. If the option is
     not set, we look in  the environment variable 
     'GOOGLE_DOCS_PASSWORD'.  If this is set,  its value is used and
     should be in the form  'login=value'.

_U_s_a_g_e:

     getGoogleDocsConnection(..., auth, error = TRUE)
     getGoogleAuth(login, password, service = "writely", appID = "R-GoogleDocs-0.1", error = TRUE)

_A_r_g_u_m_e_n_t_s:

     ...: arguments that are passed on to 'getGoogleAuth' For
          "convenience", one can also pass the authentication token
          returned from explicitly calling 'getGoogleAuth '. 

    auth: the value returned from a call to 'getGoogleAuth'.

   login: the user name/login for the Google account

password: the password for the account corresponding to 'login'

 service: the name of the Google service, i.e. writely, wise

   appID: unused

   error: a logical value indicating whether, if 'TRUE', to raise an
          error (i.e. call to  'stop' or just return 'NULL' if 'error'
          is 'FALSE'.) 

_V_a_l_u_e:

     An object of class either '"GoogleSpreadsheetsConnection"' or
     '"GoogleDocsConnection"' depending on which service was  requested
     - wise or writely, respectively. This object is actually a Curl
     handle and can be used in subsequent HTTP requests.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     <URL:
     http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html>

_S_e_e _A_l_s_o:

     'getGoogleAuth'

_E_x_a_m_p_l_e_s:

     if(exists("GoogleDocsPassword")) {
        con = getGoogleDocsConnection(names(GoogleDocsPassword), GoogleDocsPassword)
        # for all documents
       con = getGoogleDocsConnection("dtemplelang@gmail.com", "my password")
        # for spreadsheets
       con = getGoogleDocsConnection("dtemplelang@gmail.com", "my password", "wise")

        # Getting auth separately.
       auth = getGoogleAuth("dtemplelang@gmail.com", "my password", "wise")
       con = getGoogleDocsConnection(auth)
       con = getGoogleDocsConnection(auth = auth)
     }

