Code Monkey home page Code Monkey logo

pulldrive's Introduction

#PullDrive

When using multiple spreadsheets in Google Drive, the =IMPORTRANGE() can pull in data from different spreadsheets from across the Google Drive Network. However, it only supports up to 50 requests.

The insoiration for PullDrive came from an accountant that needed Annaul Data from 3 stores for all 52 weeks. So =IMPORTRANGE() was not going to work.

###How PullDrive Works

Using the pulldrive.php file, you will need

  • The Google Drive Spreadsheet URL
  • A directory folder to save everything in

###Set Up

The set up takes about 5/10 minutes at the moment but I am looking to make an easy to use config file in future versions.

  1. Unpack the repository into a folder on your server
  2. Follow the guide on how to publish your spreadsheet as a .csv
  3. Take this document ID (URL) and add that fopen section of the pulldrive file.
  4. Each line in the file should look like: file_put_contents("FILE-NAME.csv", fopen("THE GOOGLE DRIVE URL", 'r'));
  5. Add the file name you used to the previous set into the following code: $zip->addFile("FILE-NAME.csv");
  6. Name your file in the $filename = "FILE-NAME.zip";
  7. That's it.

NOTE: If you call a file in the $zip->addFile section that is not called in in the file_put_contents section the zip will not work. If you don't use it, lose it!

###Usage

Head to the index.php file on your server. This will pull the data from Google Drive, save it on your server and give you the option to download from the browser.

This is usually quick but load times will vary depending on the size of your Google Spreadsheet.

Issues: I have found that on Excel for Mac, if you link to a cell and then update the csv, it sometimes reports an invalid file format. To fix this, just open the Workbook and the csv and Excel will update the links for you with no issue.

###The Clear-down

If you keep running PullDrive, it will keep adding new csvs into the zip folder. Not great so instead, make sure you use the Clear-down function to remove old csv's and zip's and keep the PullDrive data fresh.

#####Changelog

  • v1: Initial Commit
  • v1.1: Update to index.php
  • v1.2: Clear.php redesigned, directory organisation for php files

####Questions?

This is still in development but any questions, find me on Twitter @kwaimind or on my website Daniel Reed.

pulldrive's People

Contributors

kwaimind avatar

Watchers

 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.