Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rmehner/badgeville
Ruby Badgeville Client
https://github.com/rmehner/badgeville
Last synced: 3 months ago
JSON representation
Ruby Badgeville Client
- Host: GitHub
- URL: https://github.com/rmehner/badgeville
- Owner: rmehner
- Created: 2011-11-15T10:06:15.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2012-11-30T15:50:14.000Z (about 12 years ago)
- Last Synced: 2024-10-11T04:46:48.039Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 230 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[![Build Status](https://secure.travis-ci.org/rmehner/badgeville.png)](http://travis-ci.org/rmehner/badgeville)
Badgeville API
==============Client for Badgeville API http://rules.badgeville.com/
Note
====We're in the process of rewriting this gem to have more features in a
cleaner and well tested way.We work directly in master, so if you're brave and want to help, load the
master version in your app and report back if something breaks / doesn't work
as advertised. We're using master in one of our production apps and it works
fine so far.If you want to have a _stable_ version, use the released one that is available
on rubygems.org. We'll keep the deprecated usage for the next release, but will
remove that eventually in near future.Have a look at the [Changelog](https://github.com/rmehner/badgeville/blob/master/CHANGELOG.md)
to get a feeling of what changes and what is added with the upcoming versionDeprecated Usage
----------------
First, checkout the examples folder. TL;DR:* create connection object with your api_key, and secret.
```ruby
require 'badgeville'
settings = JSON.parse(File.read('keys.json.example'))
badgeville = Badgeville::Client.new(email, settings)
```* register user and player on site
```ruby
badgeville.create_player
```* get player id
```ruby
badgeville.player_info
```* log actions
```ruby
badgeville.log_activity "commented"
```* get all logged activities
```ruby
badgeville.get_activities
```* get list of reward definitions
```ruby
badgeville.reward_definitions
```* manually award some reward
```ruby
badgeville.award "Best User"
```Installing
----------
1) add to your Gemfile```
gem 'badgeville'
```2) Create a keys.json file with your api_key and secret (see keys.json.example file)