New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hubot-googledrive-search

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubot-googledrive-search

Google drive search for hubot!

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Search your google drive with hubot! Authentication handeled by hubot-google-auth.

Installation

  • In your project repo run:
    npm install hubot-googledrive-search --save
  • Then add the follwing to your external-scripts.json:
    [
      'hubot-googledrive-search'
    ]

Configuration

This script requires you to generate oauth2 credentials for the drive account that you want hubot to be able to access. Currently this scipt is configured to give hubot access to all of drive (the specific scope used is: 'https://www.googleapis.com/auth/drive').

  1. Generate a client secret.json file by following step 1 here
  2. Set these required environemnt variables (found in your client secret.json file):
    • HUBOT_DRIVE_CLIENT_ID**="your_client_id"
    • HUBOT_DRIVE_CLIENT_SECRET**="your_client_secret"
    • HUBOT_DRIVE_REDIRECT_URL**="the_first_uri_in_the_list"
  3. Load the script and attempt to interact with hubot. You will have to authorize the app to get your inital token and refresh token. The script will then store the refresh token in the hubot brain for future use, so this process should only need to be done once. Here's a sample initial interaction:
user>> @hubot drive search title= My Cool File
hubot>> Authorize this app by visiting: https://google.com/some_thing_with_your_client_info
        Then use @hubot drive set code <code>
user>> @hubot drive set code 123412351235
hubot>> Hubot drive code successfully set!
user>> @hubot search title= Cool File
hubot>> 1.) This is a Cool File
		https://google.drive/1234h123h4123h
        2.) Some Cool File
        https://google.drive/qwer1353451asfds

Features

This script can be used to search your drive in a variety of ways:

  1. Use a google query string to search drive. Find information on query strings here: https://developers.google.com/drive/v2/web/search-parameters
user>> @hubot drive search query= fullText contains 'important' and trashed = true
  1. Use either a title and/or a contains parameter. Equivalent query string shown below each example.
user>> @hubot drive search title= My Cool File
#equivalent to:
user>> @hubot drive search query= title contains 'My Cool File'

user>> @hubot drive search contains= This is the coolest file ever
#equivalent to:
user>> @hubot drive search query= fullText contains 'This is the coolest file ever'

user>> @hubot drive search title= My Cool File contains= This is the coolest file ever
#equivalent to:
user>> @hubot drive search query= title contains 'My Cool File' and fullText contains 'This is the coolest file ever'

Notes

Since hubot needs to use the redis brain to store the drive tokens and expiration time make sure that the following keys don't conflict with any other keys being used in the brain:

'HUBOT_DRIVE_GOOGLE_AUTH_TOKEN'
'HUBOT_DRIVE_GOOGLE_AUTH_REFRESH_TOKEN'
'HUBOT_DRIVE_GOOGLE_AUTH_EXPIRE_TIME'

Keywords

FAQs

Package last updated on 16 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc