Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/gatsby-source-gdrive-tree
A gatsby source plugin that downloads the contents of a google drive folder recursivly with document and spreadsheet contents extracted.
https://github.com/binocarlos/gatsby-source-gdrive-tree
Last synced: 10 days ago
JSON representation
A gatsby source plugin that downloads the contents of a google drive folder recursivly with document and spreadsheet contents extracted.
- Host: GitHub
- URL: https://github.com/binocarlos/gatsby-source-gdrive-tree
- Owner: binocarlos
- Created: 2018-06-30T16:40:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-14T04:06:23.000Z (over 5 years ago)
- Last Synced: 2024-10-04T12:34:50.044Z (about 2 months ago)
- Language: JavaScript
- Size: 45.9 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gatsby-source-gdrive-tree
A gatsby source plugin that downloads the contents of a google drive folder recursivly with document and spreadsheet contents extracted.
## install
```bash
npm install --save gatsby-source-gdrive-tree
```## usage
You need to have created a service account token with google and downloaded the `.json` file for it.
Also - you need to have given read access to a folder on google drive to that service account and have the id of the folder ready.
Then - you configure the plugin using the `gatsby-config.js` file as shown:
```javascript
module.exports = {
siteMetadata: {
title: 'My Example Google Drive Downloader',
},
plugins: [
{
resolve: 'gatsby-source-gdrive-tree',
options: {
folderId: process.env.GOOGLE_DRIVE_FOLDER_ID,
serviceAccountToken: require(process.env.GOOGLE_DRIVE_SERVICE_TOKEN_FILE)
}
},
],
}
```This will create the following types you can query using graphql:
```
googleDriveDocument(
kind: googleDriveDocumentKindQueryString_2
name: googleDriveDocumentNameQueryString_2
mimeType: googleDriveDocumentMimeTypeQueryString_2
contents: googleDriveDocumentContentsInputObject_2
googleDriveId: googleDriveDocumentGoogleDriveIdQueryString_2
id: googleDriveDocumentIdQueryString_2
internal: googleDriveDocumentInternalInputObject_2
): GoogleDriveDocumentgoogleDriveSpreadSheet(
kind: googleDriveSpreadSheetKindQueryString_2
name: googleDriveSpreadSheetNameQueryString_2
mimeType: googleDriveSpreadSheetMimeTypeQueryString_2
contents: googleDriveSpreadSheetContentsInputObject_2
googleDriveId: googleDriveSpreadSheetGoogleDriveIdQueryString_2
id: googleDriveSpreadSheetIdQueryString_2
internal: googleDriveSpreadSheetInternalInputObject_2
): GoogleDriveSpreadSheetgoogleDriveFolder(
kind: googleDriveFolderKindQueryString_2
name: googleDriveFolderNameQueryString_2
mimeType: googleDriveFolderMimeTypeQueryString_2
googleDriveId: googleDriveFolderGoogleDriveIdQueryString_2
id: googleDriveFolderIdQueryString_2
internal: googleDriveFolderInternalInputObject_2
): GoogleDriveFolderallGoogleDriveDocument(
skip: Int
limit: Int
sort: googleDriveDocumentConnectionSort
filter: filterGoogleDriveDocument
): GoogleDriveDocumentConnectionallGoogleDriveSpreadSheet(
skip: Int
limit: Int
sort: googleDriveSpreadSheetConnectionSort
filter: filterGoogleDriveSpreadSheet
): GoogleDriveSpreadSheetConnectionallGoogleDriveFolder(
skip: Int
limit: Int
sort: googleDriveFolderConnectionSort
filter: filterGoogleDriveFolder
): GoogleDriveFolderConnection
```