Google Docs download en masse - google-docs

These days I keep most of my development notes and documentations in Google Docs. There are time that I'd like to download everything. How is this possible on a Mac and Linux computers, without doing each one individually? Google used to have the ability to download all spreadsheets. However, I can no longer find this functionality.
I would like to have the documents in Open Office or HTML format. Thanks.

If you install google gears into your browser: http://gears.google.com/
You can use the built-in offline functionality inside of google docs
If you really want to roll up your sleeves, use the gdata API
http://code.google.com/p/gdatacopier/

I looked into Joe's answer. gdatacopier is a useful tool to bulk download documents. Here's one example that I use to download all my spreadsheets from a named folder.
gdoc-cp.py -e csv -g spreadsheets -o /tmp -u me#gmail.com -p password -f "MyFolder"
There are several examples in the documentation. One limitation is that it does not seem to work for hosted domains. All email addresses must be foo#gmail.com.
Bulk uploads seem quite doable too. Getting this example to work was straight forward.
http://www.webmonkey.com/tutorial/Create_Automated_Backups_in_Google_Docs_Using_the_GData_API

GDocBackup http://gs.fhtino.it/gdocbackup
C#, Open Source, runs on Win + Net and Linux + Mono (not tested on Mac + Mono, sorry).

You can do this easily with the Google Drive API. I have a blog post featuring a short Python script that exports a Google Sheet as CSV. You can take that example, and make these changes to make it work for you:
Source MIMEtype goes from Sheets to Docs -- for all G Suite/Google Apps (import) MIMEtypes, see this page
Destination MIMEtype changes from CSV to whatever you want that's supported (Open Office & HTML included) -- for all export MIMEtypes, see this page
If you prefer to use something other than Python, use that example as pseudocode, then create your solution in any language supported by the Google APIs Client Libraries. Sample code in other languages can also be found on this page.
Once you're done, stick it in some cron job to run it regularly without you having to think about it -- you may have to add timestamping to the exported filenames to prevent overwrites. Hope this helps!

Related

Is it possible to prevent modifications to the title of a Google Doc yet allow the contents of the Google Doc to be edited

My Problem
I want to be able to migrate my Google Docs to a regular website while maintaining the links I had created between my Google Docs. Frequently I link one Google Doc to another Google Doc. As a result, I have created something that is similar to a wiki. For example let’s suppose I had created two Google Docs: Google Doc #1 and Google Doc #2.
Subsequently let’s suppose I had created a link (a hyperlink) in Google Doc #1 to Google Doc #2. Of course that's an extremely simple example. Let’s make it more complex. Imagine I had created a couple of thousand Google Docs with many links (hyperlinks) between them.
Of course backing up those Google Docs would be trivial either by using Google Takeout or rsync. However, what would happen if I wanted to move those Google Docs to a regular website? Then the myriad hyperlinks I had created would fail to point to the documents on my regular website.
That is, on my regular website, if I were to click on the link on the page which contained the contents which had been contained in Google Doc #1 (https://my_regular_website.com/google_doc_001) then instead of opening a link on my regular website to the page which contained the contents which had been contained in Google Doc #2 (https://my_regular_website.com/google_doc_002) , the link would point to the original Google Doc #2 (https://drive.google.com/drive/folders/google_doc_002)
My Technical Question
I read that, “You can use the 'contentRestrictions.readOnly' field on a `file' resource to lock a file and prevent modifications to the title, uploading a new revision, and addition of comments.” Source: Protect file content from modification
However, I would like to prevent modifications to the title file yet allow the contents of the file to be edited. For example, I might name a file something like, “1cn2OX4U67mY925GzG80hRBYjpqq2conSi9xgYikgwIM” which is the unique portion of a Google Docs URL.
That way, on my regular website, by using a simple regex, I could “relink” documents that pointed to https://docs.google.com/document/d/1cn2OX4U67mY925GzG80hRBYjpqq2conSi9xgYikgwIM
Final Thoughts
I like using Google Docs as, dare I say it, a word processor. Sometimes I use Google Docs to write essays. Sometimes I use Google Docs to create documentation. Sometimes I use Google Docs to collaborate with others (instead of emailing). Furthermore, I often use Google Docs’ outline format, styles, and voice typing.
Sure, I suppose I could use an actual wiki. But although I’ve tried many different wikis over the years, I never enjoyed using them. I found them to be clunky and overly simplistic. Furthermore, I didn’t enjoy installing them and needing to back them up. At this point In time, I don't want to have to install and maintain any software on a VPS (virtual private server).
I checked the documentation you are referring to and what you are trying to achieve is not possible, making a document read only will prevent a new revision of the file to be created.
For instance that won't allow you to change comments, content and title. At this time it is not possible to prevent some modifications, just all or none.
Regards.

Making Google extension which can save to google drive

I looked thru the internet and didn't found a solution how to make this:
I want to make google extension which will use Google API or something to connect the extension to Google drive and create/update files there( i will need mostly plain text documents to store there arrays). i will need it only for personal use, so any hacks are also acceptable.
Have anyone done anything like this before? i just need the starting point.
I have made an example that is available on Github. It is available here. It transforms the some emails from GMails into PDFs stored in Drive.
You can reuse it, you simply need to copy the Drive part and not the GMail API part. The steps you'll need to follow are :
Use the Chrome identity API to retrieve an access token for the Drive API
Use the Drive API javascript client to upload your text files. The tricky part is to upload it properly, use the examples on the github project to see what the request should look like.

2 people working on 1 HTML file simultaneously

My freind and I want to setup a collaborative project where we both work on a HTML file (and do PHP) at the same time (bit like Google Docs share feature). I want to be able to work with him to teach him certain things in PHP and HTML while I also code at the same time. Any suggestions? I have a VPS I thought we could use for it so nothings really going to get in our way. Maybe something like GIT or something?
Sounds like what you need is a real-time collaborative text editor. Here's an extensive list from wikipedia.
I use Google Docs personally but Microsoft has added this type of functionality into Office and there are a slew of desktop and online tools on that link. I had looked into Etherpad before but i don't remember enough to suggest one or the other. All of the links are on the wikipedia article so I won't repeat here.

Google Documents: Is it possible to replace a shared file?

I would like to have students send me some Stata (.do) code by sharing it with me on Google Docs.
Is it possible to replace the shared with an updated version?
I don't see any option to do that in the File menu, just renaming and editing the file description.
Google Docs works well to share and correct papers, but I'm finding it difficult to share and correct anything else. Thanks for any help!
You can upload multiple versions of the same file. All the versions will be available for review later. To upload a new version, Just click on manage revisions (from where you are in your image) and a dialog will appear. Click on "upload new revision" and navigate to your updated file.
I believe gmail now let's you attach/share updated files to email via Google Drive, and it always keeps the most up-to-date version available. So you can simply update your .do file on your desktop, keep the updated version on your Google Drive, and your students should get them.
http://gmailblog.blogspot.com/2012/11/gmail-and-drive-new-way-to-send-files.html
You can also consider Google Code (http://code.google.com; if you have a gmail account, you also have the Code account, or at least you can transparently create one from the main Google account), and work with your code using the standard code sharing, development and maintenance tools like Mercurial and its various interfaces. I have developed Stata code pretty much professionally, trust me that this is a much better tool than Google Docs (and any other real programmer here on SO would confirm that).

How to extract data from Google Calendar and show in plain text

I would like to extract the data and event name from a google calendar then show it as plain text. When ever the calendar is updated I would like the text to reflect this. It will be a part of a web site that I am working on.
What would be a good way to go about this?
The GData apis are what you're looking for. There are APIs for .NET, PHP, and Java at least (having used all, they are all fine)[1]. I have used the Zend Framework's implementation [2] to great success making a timeclock application totaling the hours the members in our organization recorded on their Google calendars, and the .NET framework is just as good. For a website, this is the way to go.
There is also a nifty command line tool, though I have not has as much success with it (Both *nix and Windows command line, though of course you'll have much more processing power in *nix ;))
[1] http://code.google.com/apis/gdata/docs/client-libraries.html
[2] http://framework.zend.com/manual/en/zend.gdata.html
[3] http://code.google.com/p/googlecl/
[Edit]
The project I mentioned for building a timeclock is available at http://code.google.com/p/gcaltimeclock/
The files you are probably most interested in are http://code.google.com/p/gcaltimeclock/source/browse/application/controllers/calendars.php and http://code.google.com/p/gcaltimeclock/source/browse/application/views/calendars/timesheets.php

Resources