Introduction: I recently bought a new NAS to store my media. I did this because I'll be buying a laptop soon and I'd rather not carry around a USB drive to hold onto my music and videos. Through tinkering I discovered that I can connect to various cloud services to either backup those services or backup directories of my NAS to them - services such as Google Drive. I do all of my document editing on Google Drive. I don't have any document editing suites installed on my system because Google Docs has been amazing and versatile. Until, well, now.

My NAS, a Synology DS415play, has a "Package Center" and I've downloaded their "SheetsStation" and "Text Editor." Problem is, Sheet Station does not support a local Document directory and I have to import the .xls files into the application separately. Thus, changes made on the NAS won't be synced to Google Drive. Additionally, the NAS does not support proprietary Google Drive documents. Which isn't a huge problem, I'd rather use an application to connect to the NAS much like iTunes accesses my music and videos on the NAS.

When I search for editing Google Docs offline the only results I get are using Chrome to edit documents and ensuring "Available Offline" is checked. That's a solution but it's only one computer. Again not the biggest of problems since internet shouldn't be out for very long, in the rare case that it is out. What I want though, is to connect and edit the Google Doc files locally on my NAS rather than a browser cache and there doesn't seem to be an app that can do it.

I've tried opening them with other apps. Both .gdocs and .gsheets open to a URL, below. So I presume I'm not even backing up my Google Drive files. I think it might be beneficial to somehow convert all the .gdoc and .gsheet files to .xls or something and use an open source suite to edit them on the NAS and either continue to sync them to Google Drive or move them to Dropbox.

Code:
{"url": "https://docs.google.com/document/d/####/edit?usp=drivesdk"}


Question: Where do I start? I don't want to go through and download each document one by one as an Office suite file on Google Docs, I have too many documents for that. Is there a place to search or APIs? I'll be developing exclusively on OS X. Are APIs typically platform independent? Would it be easier to find any applicable APIs then learn the language they were developed in or should I pick a language and search for APIs in that language? I don't want to go out and reinvent the office suite or make more work for myself than required. I apologize in advance, I'll likely need a lot of handholding through all this.

I have an idea of what languages I want to start with, Swift being one of them but I don't want to limit myself with such a young language. I have other projects for my NAS in the future and I think it would be ideal to learn a language that is easy to transfer what I've learned to my NAS so I can work towards making those ambitions a reality.
APIs are generally platform-independent. You'll want whatever language/runtime you're using to support HTTP(S) requests. However, Google prefers that you use their libraries for authentication, and thus a supported language is needed.

Google Drive has a REST API you can use. For instance, here is the export method. All you have to do is supply the Excel/Word MIME type based on whether it's a Sheets file or a Docs file. (This is Google's list of supported MIME types.)
That's a great start, as it seems Google will actually convert the document for me so I won't have to reinvent that process either. I just need to get a list of documents in my drive. Determine if they are MS Word, MS Excel, Google Doc or, Google Sheet then proceed to download the MS files and use the appropriate MIME type to download the Google files.

It seems I'll be able to do that with a PHP script, perhaps. Something I'm more familiar with than any other language I was thinking I'd have to use.
You could also start by selecting all of your Google Drive files and folders, right clicking, and selecting "Download." This will download a zip containing all of your drive files, with Google formats converted to Office formats.
Or that Razz

jonbush wrote:
You could also start by selecting all of your Google Drive files and folders, right clicking, and selecting "Download." This will download a zip containing all of your drive files, with
Google formats converted to Office formats.
TIL. I'll get back to you when Google finishes zipping up 6,201 documents.

Update: 16 errors so far. But they are all for maps I have created.
Update 2: 4,645 erros. Mostly photos and movies that were too big to be zipped up. I had no idea I had selected those and would have deleted them anyways. In the end, 2.15GB were downloaded and ended up deleting an additional 1,387 items that were made up of photos and videos small enough to be zipped up. Bringing the final size count to 8.6MB. Every file is, appropriately, either a .docx, .xlsx or, .pptx. Thanks! No work had to be done.

That's exactly what I wanted.
As an aside, GitHub must be using a sort of content stream to send you the zip file before it's even done compressing. This can be noticed because it does not provide a file size when downloading a zipball.
It actually didn't start the download until after Google checked all the files I wanted to include.
Yeah, so it must be that Google is actually compressing and temporarily storing the zip file before it offers the download to you. I'm surprised how GitHub does it differently.
Why are you doing all of this work to fix a purely theoretical issue.
allynfolksjr wrote:
Why are you doing all of this work to fix a purely theoretical issue.


Okay. I'll bite.

For one, this isn't theoretical; this has a rather practical application going forward. A lot of us take the internet for granted. Rightfully so, it's always on and available to us - whether it's from our ISP, our mobile phone carrier, the library, etc. I welcome "The Cloud" into a lot of aspects of my life as I have for years. From backing up the photos on my phone to storing my documents.

I'm also at the stage in my life where I'm ready to move. I have lived in a rather urban city in the San Francisco Bay Area (SFBA) for my entire life. The same city. 26 years. We've moved 3 times but it was always to a new neighborhood; all three of the residences I grew up in are in an 8 mile drive. That's not 8 miles to each residence, that's 8 miles total if I were to visit all 3 residences right now.

Don't get me wrong, I enjoy the benefits of living where I do but I don't love where I am. I've come to find who I am over the years and living in an urban environment isn't it. Now, there's probably many urban places where I can afford to live outside of the SFBA, and I'm eyeballing a few, but ultimately I want to have some space. Maybe a few acres to plant a few vegetables, to landscape the area. My initial ideal was that I'd find a house with acreage, maybe 20 or more, and double it as a photography area. Inviting clients over for outdoor portraits. I started realizing that the internet is rather shoddy in rural areas and wanted to relieve myself of the reliance I once placed on the internet.

Ultimately, my desire to live in a rural area diminished. It's still there but I came to terms that the nearest grocery store could be a 30 minute drive away. The nearest movie theater could be in the same town or further. Then comes the social wall. I'm not a socialite and don't mind being by myself but if I ever make plans for a movie night no one would want to drive as far. Maybe some friends I make after I move live within 20 miles of me but I suspect most would be in a city rather than a town. Frankly, why would they come to me if they can go somewhere 10 minutes away. So, I started looking more into cities I can afford to live in.

But my desire to become slightly independent of the internet held. It's not like it came from no where, I've always been a person who believed in the tangibility of stuff - that stack has certainly grown since I took it a year ago, it's even missing a few movies because it was getting a bit high to support itself. Additionally, it was easier for me to give up tangible CD purchases in favor of digital music purchases than movies; I only have the giant digital movie collection I do because of the digital copies.

I wanted a personal cloud where I can still manage to access any documents I may need in case the cloud is inaccessible. Whether that's Google Docs ceasing to exist or my internet going out for an extended period. My NAS keeps a synchronous backup so any changes in one location results in the file in the other location(s) to be updated; If I edit a file on Google, it'll be updated on my NAS and if I use an app to edit a file on my NAS it'll then be updated on Google. I'm not giving my middle finger to the cloud but rather supplementing the cloud with my own.

The key point is that I'm switching my operations to a laptop soon. I can't have my music and digital video collection on a USB external hard drive. It would be rather ironic to have a laptop and a giant, wall powered USB HDD. Originally, the NAS was purely my media machine. But as I discovered the backup services it became my documents location too. With the NAS it'll be easy to jump from Desktop to Laptop as I'm almost transitioned to my personal cloud.

Getting my music and video library is as simple as pointing the app to the network share. I do have a Spotify subscription and prefer listening on Spotify but again, I prefer local files over streaming - I even download Spotify Playlists before listening to them.

Editing my photo library is just as simple. They're located on another NAS and some key library files (such as the "database") cannot be stored on a network drive but that's a quick 1.5MB transfer over to the new computer. I enjoy my personal cloud and I will always look at ways for expanding it. I'm not sure what's left after Music, Videos and, Documents though.

Now, when I move. I'll be able to survive without internet for a short while. I'll have the documents I need and a place to save new documents. When I do get internet, the changed and new files will be uploaded and all will be good. That's not the sole reason but it's a small peace of mind to think about.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement