eventbrite-api 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -19
- data/README.md +168 -0
- data/VERSION +1 -1
- data/eventbrite-api.gemspec +4 -2
- data/lib/eventbrite-api.rb +2 -0
- data/lib/eventbrite/api/client.rb +2 -0
- data/lib/eventbrite/api/model/category.rb +11 -0
- data/lib/eventbrite/api/model/format.rb +11 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f115ae7cf783ef0318c7e84b1d381c5b89380113
|
4
|
+
data.tar.gz: 0da7bf7139f8558fa48e0750afd19bd2cbd827c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a72db89bf171569a9fbdf8f75db20ab691353479a908aa2aff2053e9f3a0fa297fc64210e748804637e5c3a441ea15ecdb7af326275fae301129f590829142
|
7
|
+
data.tar.gz: 99c8186b12ddd237232b3ca566f005949733d74735d37ba08a94eb17c363c2e937a20f317c2d073daa507037c3f241b11296847a38bb3a99231ebee4fa85bf70
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.3.
|
4
|
+
addressable (2.3.7)
|
5
5
|
builder (3.2.2)
|
6
6
|
crack (0.4.2)
|
7
7
|
safe_yaml (~> 1.0.0)
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
faraday (0.9.1)
|
13
13
|
multipart-post (>= 1.2, < 3)
|
14
14
|
git (1.2.9.1)
|
15
|
-
github_api (0.12.
|
15
|
+
github_api (0.12.3)
|
16
16
|
addressable (~> 2.3)
|
17
17
|
descendants_tracker (~> 0.0.4)
|
18
18
|
faraday (~> 0.8, < 0.10)
|
@@ -20,8 +20,8 @@ GEM
|
|
20
20
|
multi_json (>= 1.7.5, < 2.0)
|
21
21
|
nokogiri (~> 1.6.3)
|
22
22
|
oauth2
|
23
|
-
hashie (3.
|
24
|
-
highline (1.
|
23
|
+
hashie (3.4.0)
|
24
|
+
highline (1.7.0)
|
25
25
|
jeweler (2.0.1)
|
26
26
|
builder
|
27
27
|
bundler (>= 1.0)
|
@@ -48,27 +48,28 @@ GEM
|
|
48
48
|
rack (1.6.0)
|
49
49
|
rake (10.4.2)
|
50
50
|
rdoc (4.2.0)
|
51
|
-
rspec (3.
|
52
|
-
rspec-core (~> 3.
|
53
|
-
rspec-expectations (~> 3.
|
54
|
-
rspec-mocks (~> 3.
|
55
|
-
rspec-core (3.1
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-expectations (3.
|
51
|
+
rspec (3.2.0)
|
52
|
+
rspec-core (~> 3.2.0)
|
53
|
+
rspec-expectations (~> 3.2.0)
|
54
|
+
rspec-mocks (~> 3.2.0)
|
55
|
+
rspec-core (3.2.1)
|
56
|
+
rspec-support (~> 3.2.0)
|
57
|
+
rspec-expectations (3.2.0)
|
58
58
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-mocks (3.1
|
61
|
-
|
62
|
-
|
59
|
+
rspec-support (~> 3.2.0)
|
60
|
+
rspec-mocks (3.2.1)
|
61
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
+
rspec-support (~> 3.2.0)
|
63
|
+
rspec-support (3.2.2)
|
63
64
|
safe_yaml (1.0.4)
|
64
|
-
simplecov (0.9.
|
65
|
+
simplecov (0.9.2)
|
65
66
|
docile (~> 1.1.0)
|
66
67
|
multi_json (~> 1.0)
|
67
|
-
simplecov-html (~> 0.
|
68
|
-
simplecov-html (0.
|
68
|
+
simplecov-html (~> 0.9.0)
|
69
|
+
simplecov-html (0.9.0)
|
69
70
|
thread_safe (0.3.4)
|
70
71
|
thread_safe (0.3.4-java)
|
71
|
-
timecop (0.7.
|
72
|
+
timecop (0.7.3)
|
72
73
|
webmock (1.20.4)
|
73
74
|
addressable (>= 2.3.6)
|
74
75
|
crack (>= 0.3.2)
|
data/README.md
CHANGED
@@ -1,2 +1,170 @@
|
|
1
1
|
eventbrite-api
|
2
2
|
===============
|
3
|
+
|
4
|
+
[![Build Status](https://secure.travis-ci.org/BrunoChauvet/eventbrite-api.png?branch=master)](http://travis-ci.org/BrunoChauvet/eventbrite-api)
|
5
|
+
|
6
|
+
## Eventbrite API client
|
7
|
+
|
8
|
+
Integrate with ![Eventbrite API](http://developer.eventbrite.com/)
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
`gem 'eventbrite-api'`
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
`bundle`
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
`gem install eventbrite-api`
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
### OAuth Authentication
|
27
|
+
|
28
|
+
If you've already got an OAuth access token, feel free to skip to API Client Setup.
|
29
|
+
|
30
|
+
The Eventbrite API uses 3 legged OAuth2. You need to implement the following controller methods and store the `access_token` if needed.
|
31
|
+
|
32
|
+
|
33
|
+
``` ruby
|
34
|
+
class EventbriteSessionController
|
35
|
+
def new
|
36
|
+
redirect_to eventbrite_client.get_access_code_url
|
37
|
+
end
|
38
|
+
|
39
|
+
def create
|
40
|
+
@token = eventbrite_client.get_access_token(params[:code])
|
41
|
+
end
|
42
|
+
|
43
|
+
def eventbrite_client
|
44
|
+
@api_client = Eventbrite::Api::Client.new({
|
45
|
+
consumer: {
|
46
|
+
key: YOUR_CONSUMER_KEY,
|
47
|
+
secret: YOUR_CONSUMER_SECRET,
|
48
|
+
},
|
49
|
+
redirect_uri: callback_create_url
|
50
|
+
})
|
51
|
+
end
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
### API Client Setup
|
56
|
+
|
57
|
+
#### Create an api_client
|
58
|
+
|
59
|
+
``` ruby
|
60
|
+
api_client = Eventbrite::Api::Client.new({
|
61
|
+
consumer: {
|
62
|
+
key: YOUR_CONSUMER_KEY,
|
63
|
+
secret: YOUR_CONSUMER_SECRET,
|
64
|
+
},
|
65
|
+
access_token: YOUR_OAUTH_ACCESS_TOKEN
|
66
|
+
})
|
67
|
+
```
|
68
|
+
|
69
|
+
### API Methods
|
70
|
+
|
71
|
+
#### get
|
72
|
+
|
73
|
+
Retrieves the first page of specified collection
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
categories = api_client.category.get
|
77
|
+
```
|
78
|
+
|
79
|
+
#### next_page / previous_page
|
80
|
+
|
81
|
+
Retrieves the next/previous page of specified collection. A call to `get` must have been performed first
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
categories = api_client.category.get
|
85
|
+
next_categories = api_client.category.next_page
|
86
|
+
previous_categories = api_client.category.previous_page
|
87
|
+
```
|
88
|
+
|
89
|
+
#### find
|
90
|
+
|
91
|
+
Retrieves a single element by uid
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
event = api_client.event.find('123')
|
95
|
+
```
|
96
|
+
|
97
|
+
#### create
|
98
|
+
|
99
|
+
Creates a resource
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
event = api_client.event.create({'name' => 'My Event', ...})
|
103
|
+
```
|
104
|
+
|
105
|
+
#### update
|
106
|
+
|
107
|
+
Updates a resource
|
108
|
+
|
109
|
+
```ruby
|
110
|
+
event = api_client.event.update('123', {'name' => 'My Event', ...})
|
111
|
+
```
|
112
|
+
|
113
|
+
#### all
|
114
|
+
|
115
|
+
Fetches the entire collection of elements
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
categories = api_client.category.all_items
|
119
|
+
```
|
120
|
+
|
121
|
+
### API Resources
|
122
|
+
|
123
|
+
#### Events
|
124
|
+
|
125
|
+
Search events
|
126
|
+
```ruby
|
127
|
+
events = api_client.event.search
|
128
|
+
more_events = api_client.event.next_page
|
129
|
+
|
130
|
+
filtered_events = api_client.event.search({params: {q: 'sandwich'}})
|
131
|
+
```
|
132
|
+
|
133
|
+
Publish/Unpublish events
|
134
|
+
```ruby
|
135
|
+
response = api_client.event.publish('13270934723')
|
136
|
+
response = api_client.event.unpublish('13270934723')
|
137
|
+
```
|
138
|
+
|
139
|
+
#### Owned Events
|
140
|
+
|
141
|
+
User owned events
|
142
|
+
```ruby
|
143
|
+
events = api_client.owned_event.get({'user_id'=>'133925426255'})
|
144
|
+
```
|
145
|
+
|
146
|
+
#### Owned Event Attendees
|
147
|
+
|
148
|
+
User owned event attendees
|
149
|
+
```ruby
|
150
|
+
event_attendees = api_client.owned_event_attendee.get({'user_id'=>'133925426255'})
|
151
|
+
```
|
152
|
+
|
153
|
+
#### Owned Event Orders
|
154
|
+
|
155
|
+
User owned event orders
|
156
|
+
```ruby
|
157
|
+
event_orders = api_client.owned_event_order.get({'user_id'=>'133925426255'})
|
158
|
+
```
|
159
|
+
|
160
|
+
#### Categories
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
categories = api_client.category.get
|
164
|
+
```
|
165
|
+
|
166
|
+
#### Formats
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
formats = api_client.format.get
|
170
|
+
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/eventbrite-api.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: eventbrite-api 0.0.
|
5
|
+
# stub: eventbrite-api 0.0.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "eventbrite-api"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -34,8 +34,10 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/eventbrite/api/client.rb",
|
35
35
|
"lib/eventbrite/api/helper.rb",
|
36
36
|
"lib/eventbrite/api/model/base.rb",
|
37
|
+
"lib/eventbrite/api/model/category.rb",
|
37
38
|
"lib/eventbrite/api/model/event.rb",
|
38
39
|
"lib/eventbrite/api/model/event_ticket_class.rb",
|
40
|
+
"lib/eventbrite/api/model/format.rb",
|
39
41
|
"lib/eventbrite/api/model/order.rb",
|
40
42
|
"lib/eventbrite/api/model/organizer.rb",
|
41
43
|
"lib/eventbrite/api/model/owned_event.rb",
|
data/lib/eventbrite-api.rb
CHANGED
@@ -5,6 +5,8 @@ require 'eventbrite/api/model/user.rb'
|
|
5
5
|
require 'eventbrite/api/model/venue.rb'
|
6
6
|
require 'eventbrite/api/model/organizer.rb'
|
7
7
|
require 'eventbrite/api/model/event.rb'
|
8
|
+
require 'eventbrite/api/model/category.rb'
|
9
|
+
require 'eventbrite/api/model/format.rb'
|
8
10
|
require 'eventbrite/api/model/event_ticket_class.rb'
|
9
11
|
require 'eventbrite/api/model/order.rb'
|
10
12
|
require 'eventbrite/api/model/user_order.rb'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventbrite-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BrunoChauvet
|
@@ -61,8 +61,10 @@ files:
|
|
61
61
|
- lib/eventbrite/api/client.rb
|
62
62
|
- lib/eventbrite/api/helper.rb
|
63
63
|
- lib/eventbrite/api/model/base.rb
|
64
|
+
- lib/eventbrite/api/model/category.rb
|
64
65
|
- lib/eventbrite/api/model/event.rb
|
65
66
|
- lib/eventbrite/api/model/event_ticket_class.rb
|
67
|
+
- lib/eventbrite/api/model/format.rb
|
66
68
|
- lib/eventbrite/api/model/order.rb
|
67
69
|
- lib/eventbrite/api/model/organizer.rb
|
68
70
|
- lib/eventbrite/api/model/owned_event.rb
|