Giter Site home page Giter Site logo

manniru / php-google-spreadsheet-auto-writer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asimlqt/php-google-spreadsheet-client

0.0 2.0 0.0 427 KB

A PHP library for accessing and manipulating Google Spreadsheets

PHP 99.28% JavaScript 0.72%

php-google-spreadsheet-auto-writer's Introduction

Introduction

This is a simple PHP server program for upload data into Google SpreadSheet. Many pepole want to send data from small computer, such as Arduino and hopefully no charge. A few years ago, it was simple. You can just add Google User ID and password. But now, Google allows only OAuth2 authentification.

If you have a small space on your own/rental servers with PHP and MySQL environment, you can become into 'gateway to Google Spread sheet'. This server program allow to use by others.

#Installation Your work as Host are;

  1. Register your Project in Google API console. Each step is described here. (https://developers.google.com/console/help/new/) If you know more detail, read (https://developers.google.com/accounts/docs/OAuth2)

  2. In OAuth area, you may have Client ID, Client Secret, Redirect URL(You must specify).And you can specify Agrremtn screen contents.

  3. Create database table. Database location, database name is up to you. Table definition is as follows; CREATE TABLE IF NOT EXISTS glusers ( id int(11) NOT NULL AUTO_INCREMENT, google_user_id varchar(50) DEFAULT NULL, google_email varchar(255) DEFAULT NULL, google_name varchar(255) DEFAULT NULL, google_access_token varchar(255) DEFAULT NULL, google_refresh_token varchar(255) DEFAULT NULL, google_expires_in smallint DEFAULT NULL, active_file_name varchar(255) DEFAULT NULL, created datetime DEFAULT NULL, used datetime DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY google_user_id (google_user_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

  4. Download this package. (I don't support composer.)

  5. Adjust 'config.php' constant values. LANG - 'en' or 'jp' DSN - Database environment like, 'mysql:dbname=xxxxx;host=localhost' DB_USER - database user id. DB_PASSWORD - database user password. CLIENT-ID - you got it at step2. CLIENT_SECRET - you got it at step2. CALL_BACK - you got it at steop2. SITE_URL - URL where you put these PHP programs.

  6. Upload all PHP files on your server space.

  7. try to access http://yourURL/gloggger/index.php

  8. You can specify Google Spreadsheet name. Default is 'glogger_test'

  9. Make sure $_GET['sheet'] default value in record.php.

Preparation

You must make a spreadsheet. It must has two column name on the line 1. One is 'time' (case sensitive), the other one is basically 'data'. And FREEZE FIRST ROW as column name. To freeze;

  1. Goto the View menu.
  2. point Freeze Rows.
  3. Select one of the options. 'freeze 1 row'

By above action, Google spread sheet recognize first column as column name.

Client Usage

Once you register your Google account on the table by server setup programs, you can use 'record.php'

Basic format is; http://[yourURL]/glogger/record.php?email=[your registered mail address]&data=[nnnn]

Parameter email and data are required.

options: column= can change column name from data to other name as you like. sheet= can change sheet name. (Please give me good idea to change this default value. English and Japanese are diffrent.)

Enjoy !

php-google-spreadsheet-auto-writer's People

Contributors

asimlqt avatar ttakao avatar miku avatar mightymax avatar ufomelkor avatar notprathap avatar sgtpooki avatar tautelis avatar

Watchers

MUHAMMAD MANNIR AHMAD avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.