Giter Site home page Giter Site logo

eventbrite-client.rb's Introduction

#eventbrite-client.rb#

##Description## A tiny ruby-based http client for the Eventbrite API

For the latest information on this project, take a look at:

##Usage Examples##

###Installation via rubygems ###

gem install eventbrite-client

###Loading the Eventbrite API Client library code###

require 'eventbrite-client'

###Initializing the client### Your API / Application key is required to initialize the client - http://eventbrite.com/api/key

Set your user_key if you want to access private data - http://eventbrite.com/userkeyapi

eb_auth_tokens = { app_key: 'YOUR_APP_KEY',
                   user_key: 'YOUR_USER_KEY'}
eb_client = EventbriteClient.new(eb_auth_tokens)

###Initializing the client using an OAuth2.0 access_token### You can also initialize our API client using an OAuth2.0 access_token, like this:

eb_client = EventbriteClient.new({ access_token: 'YOUR_USER_ACCESS_TOKEN'})

###Calling API methods### See Eventbrite's API method documentation for more information about the list of available client methods.

Here is an example using the API's user_list_events method:

response = eb_client.user_list_events()

The event_get API call should look like this:

response = eb_client.event_get({ id: 1848891083})

Widgets

Rendering an event in html as a ticketWidget is easy:

response = eb_client.event_get({ id: 1848891083})
widget_html = EventbriteWidgets::ticketWidget(response['event'])

Additional widget examples are available on developer.eventbrite.com

##Resources##

eventbrite-client.rb's People

Contributors

ryanj avatar yrashk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eventbrite-client.rb's Issues

Please provide your Application Key in the URL

I keep getting this error

eventbrite.rb:6:in `<main>': Please provide your Application Key in the URL as "?app_key=<APP_KEY>". (RuntimeError)
require 'eventbrite-client'
eb_auth_tokens = { 'app_key' => '<RETRACTED>',
                   'user_key'=> '<RETRACTED>'}
eb_client = EventbriteClient.new(eb_auth_tokens)

response = eb_client.event_get({'id' => '3350085195'})
puts response
ruby --version
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin11.4.0]

Having compatiblity issue while installing eventbrite-client

I am trying to install eventbrite-client.
I added this gem in Gemfile as gem 'eventbrite-client',:git => 'https://github.com/ryanjarvinen/eventbrite-client.rb'.

But while trying to run bundle install. Getting a below issue.
Bundler could not find compatible versions for gem "tzinfo":
In Gemfile:
eventbrite-client (>= 0) ruby depends on
tzinfo (~> 0.3.22) ruby

rails (= 4.1.0) ruby depends on
  railties (= 4.1.0) ruby depends on
    activesupport (= 4.1.0) ruby depends on
      tzinfo (~> 1.1) ruby

I tried many solution to fix this issue like removing my gemfile.lock,bundle update,removing tzinfo and reinstalling, but unable to fix it.
I am using rails 4.1.0 version on ruby 2.0.0
Any help to resolve this issue would be appreciated.

Dependency failed on Rails 4 : tzinfo

Added the following line to Gemfile

gem 'eventbrite'

but bundle install failed with:

Bundler could not find compatible versions for gem "tzinfo":
  In Gemfile:
    eventbrite-client (>= 0) ruby depends on
      tzinfo (~> 0.3.22) ruby
.
.
    activesupport (>= 3.0.0) ruby depends on
       tzinfo (1.2.2)

To make it work, I cloned this repo and changed required tzinfo version into >= 0.3.22 (instead of ~> 0.3.22)

What is the best solution?

Error while requesting data

Hi,

I am running the following script in ruby:

require 'eventbrite-client'
eb_auth_tokens = { app_key: 'my-app-key',
user_key: 'my-user-key'}
eb_client = EventbriteClient.new(eb_auth_tokens)
response = eb_client.user_list_events()

print response

I keep getting the following error.

Also, i noticed I only get the error when there is some data to be returned. If for example there are no events being returned, then there would be no error.

/home/svaish3/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in parse': (<unknown>): found unexpected ':' while scanning a plain scalar at line 1 column 547 (Psych::SyntaxError) from /home/svaish3/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:inparse_stream'
from /home/svaish3/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in parse' from /home/svaish3/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:127:inload'
from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/crack-0.1.8/lib/crack/json.rb:12:in parse' from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/parser.rb:116:injson'
from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/parser.rb:136:in parse_supported_format' from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/parser.rb:103:inparse'
from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/parser.rb:66:in call' from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/request.rb:217:inparse_response'
from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/request.rb:189:in handle_response' from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty/request.rb:71:inperform'
from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty.rb:390:in perform_request' from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.7.8/lib/httparty.rb:342:inget'
from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/eventbrite-client-0.1.0/lib/eventbrite-client.rb:34:in method_request' from /home/svaish3/.rvm/gems/ruby-1.9.3-p194/gems/eventbrite-client-0.1.0/lib/eventbrite-client.rb:42:inmethod_missing'
from EventBriteScraper.rb:9:in `

'

JSON returned by Eventbrite not parseable by Crack::JSON

When I run "response = client.user_list_events()" an error is thrown because Crack::JSON.parse can not parse string values like "2012-04-02 07:20:42" that have colons in them. To work around this, I first require the standard json gem and replace HTTParty's JSON parse method like this:

module HTTParty
  class Parser
    def json
      # Replace Crack::JSON with JSON because Crack::JSON barfs on the JSON
      # returned by Eventbrite (for example, values that are strings with
      # colons in them such as datetimes like "2012-04-02 07:20:42").
      JSON.parse(body)
    end
  end
end

I'm running Ruby 1.9.4, eventbrite-client 0.1.0, httparty 0.7.8, and crack 0.1.8.

Versions

Versions are very inconsistent.

VERSION says 0.1.0.
gemspec says 0.1.3.
rubygems has 0.1.4 listed.

I have submitted a PR to the eventbrite repo to update HTTParty, but I have no idea if the code there is the latest, because of this confusion. Who is maintaining this project now?

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.