EventbriteClient 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +5 -0
- data/EventbriteClient.gemspec +2 -0
- data/README.md +7 -2
- data/lib/EventbriteClient.rb +14 -4
- data/lib/EventbriteClient/version.rb +2 -1
- data/test/test_api.rb +2 -0
- metadata +22 -2
data/.travis.yml
ADDED
data/EventbriteClient.gemspec
CHANGED
@@ -15,6 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = EventbriteClient::VERSION
|
17
17
|
|
18
|
+
gem.required_ruby_version = '>= 1.8.7'
|
18
19
|
gem.add_dependency('rest-client', '>= 1.6.7')
|
19
20
|
gem.add_dependency('json', '>= 1.7')
|
21
|
+
gem.add_development_dependency('rake')
|
20
22
|
end
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# EventbriteClient
|
2
2
|
|
3
|
-
|
3
|
+
[](http://travis-ci.org/kurtisnelson/EventbriteClient)
|
4
|
+
|
5
|
+
A library for querying the EventBrite API. It is [published](https://rubygems.org/gems/EventbriteClient) on RubyGems. Full documentation is at [rubydoc.info](http://rubydoc.info/gems/EventbriteClient/)
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -18,7 +20,10 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
eb = EventbriteClient::API.new(:app_key => "YOUR KEY")
|
24
|
+
events = eb.event_search({:keywords => ("food", "fun")})
|
25
|
+
|
26
|
+
Currently just event search is implemented. All parameters [documented](http://developer.eventbrite.com/doc/events/event_search/) should be supported.
|
22
27
|
|
23
28
|
## Contributing
|
24
29
|
|
data/lib/EventbriteClient.rb
CHANGED
@@ -2,12 +2,19 @@ require "EventbriteClient/version"
|
|
2
2
|
require 'rest_client'
|
3
3
|
require 'json'
|
4
4
|
|
5
|
+
#A library for using the EventBrite API
|
5
6
|
module EventbriteClient
|
7
|
+
#Makes RESTful API calls
|
6
8
|
class API
|
7
|
-
#
|
9
|
+
# Setup a session with the specified API keys
|
10
|
+
#
|
11
|
+
# @param [Hash{String=>String}] auth_tokens Eventbrite API keys
|
12
|
+
# @option auth_tokens [String] :app_key Application key
|
13
|
+
# @option auth_tokens [String] :user_key Optional user key
|
14
|
+
#
|
8
15
|
def initialize( auth_tokens )
|
9
16
|
@base_url = "https://www.eventbrite.com"
|
10
|
-
@auth = {app_key
|
17
|
+
@auth = {:app_key => "IT7XL4RVM2CGSGTVLX"}
|
11
18
|
@data_type = "json"
|
12
19
|
|
13
20
|
if auth_tokens != nil and auth_tokens.is_a? Hash
|
@@ -15,14 +22,17 @@ module EventbriteClient
|
|
15
22
|
#use api_key OR api_key + user_key OR api_key+email+pass
|
16
23
|
if auth_tokens.include? :user_key
|
17
24
|
# read/write access on the user account associated with :user_key
|
18
|
-
@auth = {app_key
|
25
|
+
@auth = {:app_key => auth_tokens[:app_key], :user_key => auth_tokens[:user_key]}
|
19
26
|
else
|
20
27
|
# read-only access to public data
|
21
|
-
@auth = {app_key
|
28
|
+
@auth = {:app_key => auth_tokens[:app_key]}
|
22
29
|
end
|
23
30
|
end end
|
24
31
|
end
|
25
32
|
|
33
|
+
# Search for and return an array of events
|
34
|
+
# @param [Hash{String=>String,Array,Integer}] params API request parameters
|
35
|
+
# @see http://developer.eventbrite.com/doc/events/event_search/ Event Search Documentation
|
26
36
|
def event_search (params)
|
27
37
|
querystring = @auth.merge( params.is_a?(Hash) ? params : {} )
|
28
38
|
url = @base_url + "/#{@data_type}/event_search"
|
data/test/test_api.rb
CHANGED
@@ -8,5 +8,7 @@ class TestApi < Test::Unit::TestCase
|
|
8
8
|
def test_event_search
|
9
9
|
events = @eb.event_search({})
|
10
10
|
assert events.count > 0, "No events were returned"
|
11
|
+
events = @eb.event_search({:keywords => ("food")})
|
12
|
+
assert events.count > 0, "The keywords broke, or nobody likes food"
|
11
13
|
end
|
12
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: EventbriteClient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '1.7'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
description: Access the Eventbrite API
|
47
63
|
email:
|
48
64
|
- kurtisnelson@gmail.com
|
@@ -51,6 +67,7 @@ extensions: []
|
|
51
67
|
extra_rdoc_files: []
|
52
68
|
files:
|
53
69
|
- .gitignore
|
70
|
+
- .travis.yml
|
54
71
|
- EventbriteClient.gemspec
|
55
72
|
- Gemfile
|
56
73
|
- LICENSE
|
@@ -70,13 +87,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
87
|
requirements:
|
71
88
|
- - ! '>='
|
72
89
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
90
|
+
version: 1.8.7
|
74
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
92
|
none: false
|
76
93
|
requirements:
|
77
94
|
- - ! '>='
|
78
95
|
- !ruby/object:Gem::Version
|
79
96
|
version: '0'
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
hash: 3960420601421177276
|
80
100
|
requirements: []
|
81
101
|
rubyforge_project:
|
82
102
|
rubygems_version: 1.8.24
|