API wrapper for getevents.co.
Installation
Add this line to your application's Gemfile:
gem 'getevents'
And then execute:
$ bundle
Or install it yourself as:
$ gem install getevents
Usage
Initialisation
You need to signup in order to get credentials. Then, initialize your client:
Getevents.configure do |config|
config.account_id = GETEVENTS_ACCOUNT_ID
config.token = GETEVENTS_TOKEN
end
For testing purpose inside your application:
Getevents.configure do |config|
config.test_mode = true
end
It will render empty arrays for each methods.
Location
locations = Getevents::Location.search('Paris')
location = locations.first
puts location.country
=> "France"
puts location.lng
=> -1.55336
Event
events = Getevents::Event.search(47.21, -1.55, { start_date: "20150921" })
event = events.first
puts event.name
=> "La fĂȘte de la grenouille"
puts event.start_date
=> "2015-09-21T00:00:00.000Z"
Eventlisting
TODO (not yet implemented)
Eventlisting curate
TODO (not yet implemented)
Contributing
- Fork it ( https://github.com/blackbirdco/getevents/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Run tests
$ GETEVENTS_ACCOUNT_ID=YOUR_ACCOUNT_ID GETEVENTS_TOKEN=YOUR_TOKEN rspec spec/