Coder Social home page Coder Social logo

chiketto's Introduction

Build Status Code Climate License Version

チケット - Chiketto

Chiketto is a ruby gem for interacting with the Eventbrite V3 API, in Japanese chiketto means 'Ticket'. This library is tested on Ruby 2.0 and above, though may work on 1.9.3.

V1 to V3 Update

In version 1.0 Chiketto removed the last remaining uses of the V1 API (creating events and organizers), and moved to exclusively using the V3 API.

Part of the V1 to V3 API change includes a new naming convention for parameters passed to POST requests, the full docs can be found at: http://www.eventbrite.com/developer/v3/

For example pre-V1.0 Chiketto:

Chiketto::Organizer.create name: 'Test Organizer'

Would, in V1.0 become:

Chiketto::Organizer.create 'organizer.name': 'Test Organizer'

In the V3 API version the required fields for each endpoint have also changed, for example, currency is now a required field for new events. For full details please refer to the API documentation.

Installation

Add this line to your application's Gemfile:

gem 'chiketto'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chiketto

Usage

Chiketto will read your API access token from the EVENTBRITE_API_TOKEN environment variable, you can also set it explicitly:

Chiketto.api_key = 'YOUR_API_KEY'

Chiketto allows you to access data from the Eventbrite API and formats it as Ruby objects for use within your application.

For example, once you've found an event on the API, Chiketto provides a simple interface for the various pieces of data to make working with it easier.

event = Chiketto::Event.find 123456
event.name                              # => 'Event Name'
event.name.html                         # => '<p>Event Name</p>'
event.organizer                         # => Chicketto::Organizer
event.organizer.name                    # => 'Organizer Name'

You can also create new events, or update existing events (using the V1 API) and Chiketto will then return the updated / new event pulled from the V3 API.

event.update 'event.name.html': 'Name'
Chiketto::Event.create 'event.name.html': 'Name', 'event.start.timezone': 'Europe/London', 'event.start.utc': , 'event.end.utc': , 'event.end.timezone': , 'event.currency': 'GBP'

You can also use the search endpoint on the API to look up events and have an Array of events returned:

Chiketto::Event.search 'name'

Chiketto also allows you to list out all the possible Categories on the Eventbrite API, returning an Array of Category objects.

Chiketto::Category.list

For more supported objects, API calls, and methods, I suggest looking at the source code.

Contributing

  1. Fork it ( https://github.com/chrisradfordltd/chiketto/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

chiketto's People

Contributors

chrisradford avatar adrianov avatar

Watchers

James Cloos avatar Kilima Glenn 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.