Coder Social home page Coder Social logo

apps-script-gist-to-gdrive's Introduction

Gist to GDrive for Google Apps Script

Download/Backup your gists to a GDrive folder.

Setup

Prepare your Script

First create a new Google Apps Script. Get your Script ID in File > Project properties. You will need this for the OAuth.

Set the rootFolderPath variable to the target folder name where you want to download your gists. Optionally add a parent or two to prevent duplicate findings.

In Resources > Libraries... search for the library:
1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF
and click on Select.

OAuth

Get a Github ClientID and -Secret from: https://github.com/settings/applications/new
Your callback url is: https://script.google.com/macros/d/{SCRIPT-ID}/usercallback
(Here you need the Script ID from the previous step).
Add your clientID and clientSecret into your script (replace the ...).

Run

Run the run function and open the logs (Cmd|Ctrl + Enter) after getting an error message. In the logs open the OAuth url in a new tab. If everything was successful run the script again and keep an eye on the logs.

If you run your script again the script just updates the previously downloaded gists if they have changed. This way the script does take much less time and if you get a timeout error you can just run the script again to continue.

New: Removes old (removed or renamed) gist folders.

Add triggers (cron jobs)

Click on Resources > Current project's triggers to add the run function as a Time-driven trigger. You could execute it once or twice a day to stay updated (depends on your gist activity).

apps-script-gist-to-gdrive's People

Contributors

firepanther avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Forkers

hramose

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.