GithubHelp home page GithubHelp logo

ducksboard's Introduction

Ducksboard API Ruby wrapper

Configuration

API Key can be set in the environment

export DUCKSBOARD_API_KEY='YOURKEY'

or in an initializer

Ducksboard.api_key = 'YOURKEY'

Box

widget = Ducksboard::Box.new(1234) # Widget numeric id
widget.value = 10
widget.save

Counter

widget = Ducksboard::Counter.new(1234)
widget.value = 10
widget.save

Image

widget = Ducksboard::Image.new(1235)
widget.source = "https://dashboard.ducksboard.com/static/accounts/img/logo_small.png"
# or
widget.source = "~/Pictures/logo.png"
widget.caption = "Ducksboard logo!"
widget.timestamp = 1310649204
widget.save

Gauge

widget = Ducksboard::Gauge.new(1235)
widget.value = 0.93
widget.save

Graph

# remember that the graph widgets need atleast 2 points before it displays anything
widget = Ducksboard::Graph.new(1236)
widget.timestamp = Time.now.to_i
widget.value = 198
widget.save

Pin

widget = Ducksboard::Pin.new(1234)
widget.value = 10
widget.save

Timeline

widget = Ducksboard::Timeline.new(1237)
widget.title = "A Title"
widget.image = "http://url.to.io/some_image.gif"
# or
widget.image = :edited
# any of the following as a string or symbol: orange, red, green, created, edited or deleted
widget.content = "text content"
widget.link = "http://google.com"

Leaderboard

widget1 = Ducksboard::Leaderboard.new(56803)
widget1.linha = [{"name" => 'Titulo 1', "values" => [12,13,14]}, 
                 {"name" => 'Titulo 2', "values" => [12,13,142]},
                 ]
widget1.save

Pull API

# You can use the HTTP Pull API to retrieve historical data from any widget.
# It will be returned in a map as per the API (http://dev.ducksboard.com/apidoc/pull-api-http)

widget = Ducksboard::Gauge.new(1235)
data = widget.since(300)['data']
# or
data = widget.last_values(15)
# or
data = widget.timespan(:daily, "Europe/London")

ducksboard's People

Contributors

jhsu avatar jshiell avatar aryrabelo avatar pelletier avatar chrisvariety avatar

Watchers

Michael Madison avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.