Project

flurry

0.0
No release in over 3 years
Low commit activity in last 3 years
Flurry provides easy access to Flurry Analytics Reporting API with a friendly API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.0
~> 13.0
~> 3.0
~> 3.5, >= 3.5.1

Runtime

~> 0.13.7
 Project Readme

Flurry

Gem Version Build Status Reviewed by Hound

Flurry provides easy access to Flurry Analytics Reporting API

Keep track of changes in Changelog

Installation

Add this line to your application's Gemfile:

gem 'flurry'

And then execute:

$ bundle

Or install it yourself as:

$ gem install flurry

Usage

To start using the gem provide an api token through Flurry#configure. The results are displayed in UTC time zone and JSON format (as defined in Flurry), this can be changed by setting the respective configuration:

Flurry.configure do |config|
  config.token = ENV['FLURRY_API_TOKEN']

  # Optional configuration
  config.time_zone = 'Europe/Madrid'
  config.format = :csv
  config.timeout = 30 # Timeout for opening connection and reading data
end

Once an API token has been set, requesting data is really easy

require 'flurry'

# Gets todays the number of sessions from appUsage table grouped by day (default)
Flurry.from(:app_usage).select(:sessions).between(Date.today).fetch # Flurry::Response

# Same as above but grouping by hour
Flurry.from(:app_usage, :hour).select(:sessions).between(Date.today).fetch

# Use the sort method to sort the query results. Defaults to descending
Flurry.from(:app_usage).select(:sessions).sort(sessions: :asc).between(Date.today).fetch

# Gets the results from last week, also returning the app id, and the platform name (showing accepts an array as the key values)
Flurry.from(:app_usage).select(:sessions).showing(app: :id, platform: :name).between(Date.today - 7, Date.today).fetch

# To get only the metrics that match a condition: (gt, lt, eq)
Flurry.from(:app_usage).select(:sessions).having(sessions: { gt: 10, lt: 100 }).between(Date.today).fetch

# Change default configuration per request
Flurry.from(:app_usage).format(:csv).time_zone('Europe/Madrid')

TODO

  • Sort by metrics (select)
  • Filter by dimension (showing)
  • Havings
  • Response format
  • Custom response class
  • Add documentation

Contributing

  1. Fork the project https://github.com/rbague/flurry/fork
  2. Get an api token and set it to FLURRY_TOKEN environment variable
  3. Run bundle and bundle exec rake
  4. Make your feature or bug fix
  5. Add tests for it. This is important so that it does not break in a future version.
  6. Submit a new Pull Request

License

The gem is available as open source under the terms of the MIT License.