Code Monkey home page Code Monkey logo

chartbeat's Introduction

chartbeat

A Ruby wrapper for the Chartbeat API

Install

gem install chartbeat

Usage

c = Chartbeat.new :apikey => 'yourkey', :host => 'yourdomain.com'    

real-time calls and options

c.pages            :path => '/'
c.pathsummary      :keys => 'n', :types => 'n'
c.recent           :limit => 2, :path => '/'
c.quickstats       :path => '/'
c.toppages         :limit => 10

historical calls and options

c.alerts           :since => 1276980619
c.snapshots        :timestamp => 1276980619
c.stats
c.data_series      #not working right now
c.day_data_series  :timestamp => 1276980619, :type => 'paths'

other calls and options

c.histogram        :keys => 'n', :breaks => 'n', :path => '/'
c.summary          :keys => 'n', :types => 'n', :path => '/'

Deprecated methods

c.summize #use quickstats instead

Notes

  • Chartbeat is currently returning blank arrays for alerts and an error for data_series at this time. I'll put out an update with tests for these calls when this is fixed.

  • For calls requiring timestamp, this gem defaults to 24 hours ago.

Copyright

Copyright (c) 2010 Al Shaw. See LICENSE for details.

chartbeat's People

Contributors

ashaw avatar

Stargazers

Luiz Fonseca avatar Boris Boroda avatar Thomas Klemm avatar Aaron Williams avatar  avatar Piotr Murach avatar Travis Hines avatar Joel N avatar Alan Garcia avatar Dan avatar Andy Holman avatar Scott Arnold avatar Alli avatar Dan Barrett avatar  avatar  avatar Jeff Larson avatar Matt Langer avatar Justin Ouellette avatar Jeff Long avatar Mike Rumble avatar Wes Maldonado avatar

Watchers

James Cloos avatar

chartbeat's Issues

TypeError using ruby 2.1

playing around with this, looks like there's an issue

โ˜ irb
r2.1.0 :001 > require 'chartbeat'
=> true
2.1.0 :002 > c = Chartbeat.new :apikey => 'xxxxxxxxxxxxxxxx', :host => 'domain.com.au'
=> #<Chartbeat:0x000000013fde68 @apikey="xxxxxxxxxxxxxxxx", @host="domain.com.au">

2.1.0 :008 > c.class
=> Chartbeat
2.1.0 :009 > c.pages
TypeError: no implicit conversion of Symbol into Integer
from /home/preflightsiren/.rvm/gems/ruby-2.1.0/gems/chartbeat-0.2.2/lib/chartbeat.rb:31:in []' from /home/preflightsiren/.rvm/gems/ruby-2.1.0/gems/chartbeat-0.2.2/lib/chartbeat.rb:31:inblock in method_missing'
from /home/preflightsiren/.rvm/gems/ruby-2.1.0/gems/chartbeat-0.2.2/lib/chartbeat.rb:30:in each' from /home/preflightsiren/.rvm/gems/ruby-2.1.0/gems/chartbeat-0.2.2/lib/chartbeat.rb:30:inmethod_missing'
from (irb):9
from /home/preflightsiren/.rvm/rubies/ruby-2.1.0/bin/irb:11:in `

'

This is broken

RestClient::Unauthorized: RestClient::Unauthorized

Maybe you need to use api.chartbeat.com instead of chartbeat.com/api?

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.