Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

farmbot-resource

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

farmbot-resource

  • 1.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Farmbot Resource

Adapter gem for Farmbot Web App API. Currently used in Raspberry Pi controller to support scheduling operations.

Available Resources

  • Sequences
  • Schedules
  • Plants

Need more than what's available? Raise an issue and we can add your resource to the list (PRs are also welcome).

Usage

First, you will need an API token.

token = FbResource::Client.get_token(email: 't@g.com',
                                     password: 'shhh...',
                                     # OPTIONAL: Defaults to "my.farmbot.io"
                                     # if not specified.
                                     url: "http://localhost:3000")
# Returns really long JSON Web Token...
# => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....'

Once you have an API token, you can create a 'client'.

client = FbResource::Client.new do |config|
  config.token = token
end

Client objects can access API resources such as schedules and sequences.

# Simple use case: get all schedules
# Returns array of hashes
schedules = client.schedules.all

# Another use case: cache busting with fetch()
# Results are always cached until fetch() is called
sequences = client.sequences.fetch.all

Encryption

The Farmbot web app issues an RSA public key. If you need to sign stuff, the key is accessible via client.public_key

See example.rb for a runnable sample.

FAQs

Package last updated on 08 Sep 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