ThingSpeak API Ruby Gem

If you use Ruby to write programs and apps, Daniel Treacy created a Ruby wrapper for the ThingSpeak API. This Gem makes it easier to access the ThingSpeak API inside of your Ruby code.
Install from the command line:
[cce]gem install ‘thingspeak-api'[/cce]
To use, simply include it in your Gemfile:
[cce]gem ‘thingspeak-api'[/cce]

Ruby Interface Code

[cce]require ‘thingspeak’
client = ThingSpeak::Client.new(“YOUR_WRITE_KEY”, “YOUR_READ_KEY”)
# post an update to your channel, returns the identifier of the new post if successful
client.update_channel({field1: “foo”, field2: “bar”}) # => 3[/cce]

Resources

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.