upcoming-events 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,224 @@
1
+ module Upcoming
2
+ class Group
3
+ include Upcoming::Defaults
4
+
5
+ # Retrieve group information and metadata for public and private groups.
6
+ #
7
+ # +group_id+ (Required)
8
+ # The id number of the group. You can also pass multiple group_id's separated by commas to getInfo on multiple groups.
9
+ #
10
+ # +token+ (Optional)
11
+ # An authentication token. Pass to see even private groups.
12
+ #
13
+ def self.info(group_id, token=nil)
14
+ group_id = group_id.join(',') if group_id.is_a?(Array)
15
+ token = token['token'] if token and token['token']
16
+ query = {:method => 'group.getInfo', :group_id => group_id}
17
+ query.merge!(:token => token) if token
18
+ Mash.new(self.get('/', :query => query.merge(Upcoming.default_options))).rsp.group
19
+ end
20
+
21
+ # Retrieve group member user information and metadata for any public group or private group that the authenticated user is a member of.
22
+ #
23
+ # +token+ (Required)
24
+ # An authentication token.
25
+ #
26
+ # +group_id+ (Numeric, Required)
27
+ # The group id requested.
28
+ #
29
+ # +members_per_page+ (Numeric, Optional)
30
+ # To restrict the number of members per page of results. Default is 100.
31
+ #
32
+ # +page+ (Numeric, Optional)
33
+ # Page # to return. Starts with 1.
34
+ #
35
+ # +order+ (Either 'member_timestamp' or 'username', default: 'username')
36
+ # Member_timestamp orders by date joined.
37
+ #
38
+ # +dir+ (Either 'asc' or 'desc', default: asc)
39
+ # Sort direction.
40
+ #
41
+ def self.members(group_id, token, options={})
42
+ opts = {:membersPerPage => 100, :page => 1, :order => 'username', :dir => 'asc'}
43
+ opts.merge! options
44
+ opts[:membersPerPage] = opts.delete(:members_per_page) if opts[:members_per_page]
45
+ token = token['token'] if token and token['token']
46
+ query = {:method => 'group.getMembers', :group_id => group_id, :token => token}
47
+ Mash.new(self.get('/', :query => query.merge(opts).merge(Upcoming.default_options))).rsp.user
48
+ end
49
+
50
+ # Retrieve group event information and metadata for any public group or private group that the authenticated user is a member of.
51
+ #
52
+ # +token+ (Optional)
53
+ # An authentication token.
54
+ #
55
+ # +group_id+ (Numeric, Required)
56
+ # The group id requested.
57
+ #
58
+ # +events_per_page+ (Numeric, Optional)
59
+ # To restrict the number of members per page of results.
60
+ #
61
+ # +page+ (Numeric, Optional)
62
+ # Page # to return. Starts with 1.
63
+ #
64
+ # +order+ (Either 'event_time' or 'time_added', default: 'event_time')
65
+ # Event_time orders by event start date, time_added orders by the time the event was added to the group.
66
+ #
67
+ # +dir+ (Either 'asc' or 'desc', default: asc)
68
+ # Sort direction.
69
+ #
70
+ # +show_past+ (Either 1 or 0, default: 0)
71
+ # Whether to exclusively show past results (instead of upcoming) in the event results.
72
+ def self.events(group_id, token, options={})
73
+ opts = {:eventsPerPage => 100, :page => 1, :order => 'event_time', :dir => 'asc', :show_past => 0}
74
+ opts.merge! options
75
+ opts[:eventsPerPage] = opts.delete(:events_per_page) if opts[:events_per_page]
76
+ token = token['token'] if token and token['token']
77
+ query = {:method => 'group.getEvents', :group_id => group_id, :token => token}
78
+ Mash.new(self.get('/', :query => query.merge(opts).merge(Upcoming.default_options))).rsp.event
79
+ end
80
+
81
+ # Retrieve group information and metadata for all groups that the authenticated user is a member of. This method requires authentication.
82
+ #
83
+ # +token+ (Required)
84
+ # An authentication token.
85
+ def self.my_groups(token)
86
+ Mash.new(self.get('/', :query => {:method => 'getMyGroups', :token => token}.merge(Upcoming.default_options))).rsp.event
87
+ end
88
+
89
+ # Add a new group to the database. This method requires authentication.
90
+ #
91
+ # +token+ (Required)
92
+ # An authentication token.
93
+ #
94
+ # +name+ (Required)
95
+ # The name of the group.
96
+ #
97
+ # +description+ (Optional)
98
+ # The group's description. May contain some HTML.
99
+ #
100
+ # +event_moderation+ (Numeric, either 1 or 0)
101
+ # Whether to enable moderation of event suggestions. Default is 0.
102
+ #
103
+ # +member_moderation+ (Numeric, either 1 or 0)
104
+ # Whether to enable moderation of new members. Default is 0.
105
+ #
106
+ # +is_private+ (Number, 1 or 0)
107
+ # Indicates whether it should be a private, invite-only group(1), or available for public view and searching (0).
108
+ def self.add(info, token)
109
+ token = Upcoming::Auth.token_code(token)
110
+ format :xml
111
+ body = {:method => 'group.add', :token => token}
112
+ body.merge!(info)
113
+ body.merge!(Upcoming.default_options)
114
+ body.merge!({:format => 'xml'})
115
+ Mash.new(self.post('/', :body => body)).rsp.group
116
+ end
117
+
118
+ # Edit a group. Only an admin of a group may edit it.This method requires authentication.
119
+ #
120
+ # +token+ (Required)
121
+ # An authentication token.
122
+ #
123
+ # +group_id+ (Numeric, Required)
124
+ # The id of the group to edit.
125
+ #
126
+ # +name+ (Required)
127
+ # The name of the group.
128
+ #
129
+ # +description+ (Optional)
130
+ # The group's description. May contain some HTML.
131
+ #
132
+ # +event_moderation+ (Numeric, either 1 or 0)
133
+ # Whether to enable moderation of event suggestions. Default is 0.
134
+ #
135
+ # +member_moderation+ (Numeric, either 1 or 0)
136
+ # Whether to enable moderation of new members. Default is 0.
137
+ #
138
+ # +is_private+ (Number, 1 or 0)
139
+ # Indicates whether it should be a private, invite-only group(1), or available for public view and searching (0).
140
+ #
141
+ def self.edit(group, token)
142
+ token = Upcoming::Auth.token_code(token)
143
+ format :xml
144
+ body = {:method => 'group.edit', :token => token}
145
+ body.merge!(info)
146
+ body.merge!(Upcoming.default_options)
147
+ body.merge!({:format => 'xml'})
148
+ Mash.new(self.post('/', :body => body)).rsp.group
149
+ end
150
+
151
+ # Try to join a group. If the group is moderated, the request may be queued for administrator review instead of processed immediately. This method requires authentication.
152
+ #
153
+ # +token+ (Required)
154
+ # An authentication token.
155
+ #
156
+ # +group_id+ (Required)
157
+ # The id of the group to join.
158
+ def self.join(group_id, token)
159
+ token = Upcoming::Auth.token_code(token)
160
+ format :xml
161
+ body = {:method => 'group.join', :group_id => group_id, :token => token}
162
+ body.merge!(Upcoming.default_options)
163
+ body.merge!({:format => 'xml'})
164
+ Mash.new(self.post('/', :body => body)).rsp.group
165
+ end
166
+
167
+ # Try to leave a group. If the user leaving was the last member of the group, the group is permanently deleted, and may not be rejoined. If the user who left was the last admin in the group, the user remaining with the earliest join timestamp becomes an admin. This method requires authentication.
168
+ #
169
+ # +token+ (Required)
170
+ # An authentication token.
171
+ #
172
+ # +group_id+ (Required)
173
+ # The id of the group to leave.
174
+ def self.leave(group_id, token)
175
+ token = Upcoming::Auth.token_code(token)
176
+ format :xml
177
+ body = {:method => 'group.leave', :group_id => group_id, :token => token}
178
+ body.merge!(Upcoming.default_options)
179
+ body.merge!({:format => 'xml'})
180
+ Mash.new(self.post('/', :body => body)).rsp.stat == 'ok'
181
+ end
182
+
183
+ # Try to add an event to a group. If the group is moderated, the request may be queued for administrator review instead of processed immediately.This method requires authentication.
184
+ #
185
+ # +token+ (Required)
186
+ # An authentication token.
187
+ #
188
+ # +group_id+ (Required)
189
+ # The id of the group.
190
+ #
191
+ # +event_id+ (Required)
192
+ # The id of the event to send.
193
+ #
194
+ def self.add_event(group_id, event_id, token)
195
+ token = Upcoming::Auth.token_code(token)
196
+ format :xml
197
+ body = {:method => 'group.addEventTo', :group_id => group_id, :event_id => event_id, :token => token}
198
+ body.merge!(Upcoming.default_options)
199
+ body.merge!({:format => 'xml'})
200
+ Mash.new(self.post('/', :body => body)).rsp.group
201
+ end
202
+
203
+ # Try to remove an event to a group. This method can only be called by an authenticated group admin, or by the user who added the event to the group. This method requires authentication.
204
+ #
205
+ # +token+ (Required)
206
+ # An authentication token.
207
+ #
208
+ # +group_id+ (Required)
209
+ # The id of the group.
210
+ #
211
+ # +event_id+ (Required)
212
+ # The id of the event to remove.
213
+ #
214
+ def self.remove_event(group_id, event_id, token)
215
+ token = Upcoming::Auth.token_code(token)
216
+ format :xml
217
+ body = {:method => 'group.removeEvent', :group_id => group_id, :event_id => event, :token => token}
218
+ body.merge!(Upcoming.default_options)
219
+ body.merge!({:format => 'xml'})
220
+ Mash.new(self.post('/', :body => body)).rsp.stat == 'ok'
221
+ end
222
+
223
+ end
224
+ end
@@ -0,0 +1,78 @@
1
+ module Upcoming
2
+ class Metro
3
+ include Upcoming::Defaults
4
+
5
+ # Retrieve the details about a metro.
6
+ #
7
+ # +metro_id+ (Required)
8
+ # The metro_id number of the metro to look within. To find metro_id's, use metro.getList. To run getInfo on multiple metros, simply pass a comma-separated list of metro_id numbers.
9
+ #
10
+ def self.info(metro_id)
11
+ metro_id = metro_id.join(',') if metro_id.is_a?(Array)
12
+ Mash.new(self.get('/', :query => {:method => 'metro.getInfo', :metro_id => metro_id}.merge(Upcoming.default_options))).rsp.metro
13
+ end
14
+
15
+ # Retrieve the single record of the most popular metro in the area of a latitude and longitude coordinate. Will return a 404 Not Found if one cannot be found. Only the US and some of Canada is currently supported. To get a Lat/Lon from a street address, try Yahoo!'s Geocoding API. Useful for adding new venues.
16
+ #
17
+ # +latitude+ (Float, Required)
18
+ # Latitude coordinate.
19
+ #
20
+ # +longitude+ (Float, Required)
21
+ # Longitude coordinate.
22
+ #
23
+ def self.for_latitude_and_longitude(latitude, longitude)
24
+ Mash.new(self.get('/', :query => {:method => 'metro.getForLatLon', :latitude => latitude, :longitude => longitude}.merge(Upcoming.default_options))).rsp.metro
25
+ end
26
+
27
+ # Searches for metros whose name or "code" matches the search_text.
28
+ #
29
+ # +search_text+ (Optional)
30
+ # The search text to use. Supports quoted strings and empty parameter (to display all). Please restrict by another parameter when using blank values.
31
+ #
32
+ # +country_id+ (Numeric, Optional)
33
+ # The country_id of the event, used to narrow down the responses. To get a country_id, try the metro.getCountryList function.
34
+ #
35
+ # +state_id+ (Numeric, Optional)
36
+ # The state_id of the event, used to narrow down the responses. To get a state_id, try the metro.getStateList function.
37
+ #
38
+ def self.search(query={})
39
+ Mash.new(self.get('/', :query => query.merge({:method => 'metro.search'}).merge(Upcoming.default_options))).rsp.metro
40
+ end
41
+
42
+ # Retrieve a list of metros for a particular state.
43
+ #
44
+ # +token+ (Required)
45
+ # An authentication token.
46
+ #
47
+ def self.my_list(token)
48
+ token = Upcoming::Auth.token_code(token)
49
+ Mash.new(self.get('/', :query => {:method => 'metro.getMyList', :token => token}.merge(Upcoming.default_options))).rsp.metro
50
+ end
51
+
52
+ # Retrieve a list of metros for a particular state.
53
+ #
54
+ # +state_id+ (Required)
55
+ # The state_id number of the state to look within. To find state_id's, use metro.getStateList.
56
+ #
57
+ def self.list(state_id)
58
+ state_id = state_id.join(',') if state_id.is_a?(Array)
59
+ Mash.new(self.get('/', :query => {:method => 'metro.getList', :state_id => state_id}.merge(Upcoming.default_options))).rsp.metro
60
+ end
61
+
62
+ # Retrieve a list of states for a particular country.
63
+ #
64
+ # +country_id+ (Required)
65
+ # The country_id number of the country to look within. To find country_id's, use metro.getCountryList.
66
+ #
67
+ def self.state_list(country_id)
68
+ country_id = country_id.join(',') if country_id.is_a?(Array)
69
+ Mash.new(self.get('/', :query => {:method => 'metro.getStateList', :country_id => country_id}.merge(Upcoming.default_options))).rsp.state
70
+ end
71
+
72
+ # Retrieve a list of all countries in the database.
73
+ #
74
+ def self.country_list
75
+ Mash.new(self.get('/', :query => {:method => 'metro.getCountryList'}.merge(Upcoming.default_options))).rsp.country
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,13 @@
1
+ module Upcoming
2
+ class State
3
+ include Upcoming::Defaults
4
+
5
+ # +state_id+ (Required)
6
+ # The state_id number of the state to look within. State ID's are referenced in other methods, such as metro.getStateList and metro.getInfo. To run getInfo on multiple states, simply pass an array or a comma-separated list of state_id numbers.
7
+ #
8
+ def self.info(state_id)
9
+ state_id = state_id.join(',') if state_id.is_a?(Array)
10
+ Mash.new(self.get('/', :query => {:method => 'state.getInfo', :state_id => state_id}.merge(Upcoming.default_options))).rsp.state
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,83 @@
1
+ module Upcoming
2
+ class User
3
+ include Upcoming::Defaults
4
+
5
+ # Retrieve the details about a user.
6
+ #
7
+ # +user_id+ (Required)
8
+ # The user_id number of the user to look within. To run getInfo on multiple users, simply pass a comma-separated list of user_id numbers.
9
+ #
10
+ def self.info(user_id)
11
+ user_id = user_id.join(',') if user_id.is_a?(Array)
12
+ Mash.new(self.get('/', :query => {:method => 'user.getInfo', :user_id => user_id}.merge(Upcoming.default_options))).rsp.user
13
+ end
14
+
15
+ # Retrieve the details about a user by username/screenname.
16
+ #
17
+ # +username+ (Required)
18
+ # The username (or screen name) of the user to look within. To run getInfoByUsername on multiple users, simply pass a comma-separated list of username strings.
19
+ #
20
+ def self.info_by_username(username)
21
+ username = username.join(',') if username.is_a?(Array)
22
+ Mash.new(self.get('/', :query => {:method => 'user.getInfoByUsername', :username => username}.merge(Upcoming.default_options))).rsp.user
23
+ end
24
+
25
+ # Retrieve the details about a user by email
26
+ #
27
+ # +email+ (Required)
28
+ # The email of the user to look within. To run getInfoByEmail on multiple addresses, simply pass a comma-separated list of valid email addresses.
29
+ #
30
+ def self.info_by_email(email)
31
+ email = email.join(',') if email.is_a?(Array)
32
+ Mash.new(self.get('/', :query => {:method => 'user.getInfoByEmail', :email => email}.merge(Upcoming.default_options))).rsp.user
33
+ end
34
+
35
+ # Retrieve a list of metros for a particular user.
36
+ #
37
+ # +token+ (Required)
38
+ # An authentication token.
39
+ def self.metro_list(token)
40
+ token = Upcoming::Auth.token_code(token)
41
+ Mash.new(self.get('/', :query => {:method => 'user.getMetroList', :token => token}.merge(Upcoming.default_options))).rsp.metro
42
+ end
43
+
44
+ # Gets all events in the watchlist for a user. You may optionally pass authentication parameters for this function to get back private events from people who have authenticated user as a friend. The 'username' returned is the username of the watchlist owner. It also returns either status="attend" or status="watch". Watchlists for personal events that are created by friends of the user authenticated are shown.
45
+ #
46
+ # In other words, you pass a username and password. Naturally, you'll have access to see any events created by others who have you as a friend. If the user_id you query has any of those specific personal events as an item in their watchlist, they will show up in this function.
47
+ #
48
+ # Additionally, by default, user.getWatchlist only returns events with a start date >= today, or upcoming events. To get all events ever in a user's watchlist, or to get past events only, pass the "show" parameter.
49
+ #
50
+ # +token+ (Optional)
51
+ # An authentication token.
52
+ #
53
+ # +user_id+ (Required)
54
+ # The user_id requested.
55
+ #
56
+ # +show+ (Optional, Default: 'upcoming')
57
+ # May be 'upcoming', 'all', or 'past' to retrieve corresponding events.
58
+ #
59
+ def self.watchlist(user_id, show='upcoming', token=nil)
60
+ token = Upcoming::Auth.token_code(token)
61
+ query = {:method => 'user.getWatchlist', :show => show}
62
+ query.merge!(:token => token) if token
63
+ Mash.new(self.get('/', :query => query.merge(Upcoming.default_options))).rsp.event
64
+ end
65
+
66
+ # Retrieve the events being watched/attended by a user's friends. These events can either be public or created by a person who calls the user a friend.
67
+ #
68
+ # +token+ (Required)
69
+ # An authentication token required to see the user's friends events.
70
+ #
71
+ # +per_page+ (Numeric, Optional, Default = 100)
72
+ # Number of results to return per page. Max is 100 per page.
73
+ #
74
+ # +page+ (Numeric, Optional, Default = 1)
75
+ # The page number of results to return.
76
+ def self.friends_events(token, per_page=100, page=1)
77
+ token = Upcoming::Auth.token_code(token)
78
+ query = {:method => 'user.getMyFriendsEvents', :per_page => per_page, :page => page}
79
+ Mash.new(self.get('/', :query => query.merge(Upcoming.default_options))).rsp.event
80
+ end
81
+
82
+ end
83
+ end
@@ -0,0 +1,170 @@
1
+ module Upcoming
2
+ class Venue
3
+ include Upcoming::Defaults
4
+
5
+ # Retrieve the details about a venue.
6
+ #
7
+ # venue_id (Required)
8
+ # The venue_id number of the venue to look within. To find venue_id's, use venue.getList. You can also pass multiple venue_id's separated by commas to getInfo on multiple venues.
9
+ #
10
+ # token (Optional)
11
+ # An authentication token. Optional for viewing private venues.
12
+ #
13
+ def self.info(venue_id, token=nil)
14
+ venue_id = venue_id.join(',') if venue_id.is_a?(Array)
15
+ token = token['token'] if token and token['token']
16
+ query = {:method => 'venue.getInfo', :venue_id => venue_id}
17
+ query.merge!({:token => token}) if token
18
+ Mash.new(self.get('/', :query => query.merge(Upcoming.default_options))).rsp.venue
19
+ end
20
+
21
+ # Retrieve a list of venues for a particular metro.
22
+ #
23
+ # metro_id (Required)
24
+ # The metro_id number of the metro to look within. To find metro_id's, use metro.getList.
25
+ #
26
+ # token (Optional)
27
+ # An authentication token. Pass to return private venues.
28
+ #
29
+ def self.list(metro_id, token=nil)
30
+ metro_id = metro_id.join(',') if metro_id.is_a?(Array)
31
+ token = token['token'] if token and token['token']
32
+ query = {:method => 'venue.getList', :metro_id => metro_id}
33
+ query.merge!({:token => token}) if token
34
+ Mash.new(self.get('/', :query => query.merge(Upcoming.default_options))).rsp.venue
35
+ end
36
+
37
+ # Allows searching through venues.
38
+ #
39
+ # +search_text+ (Optional)
40
+ # The search string to use when looking for venues. Supports quoted phrases and blank values for searching all venues. Please restrict by another parameter when using blank values.
41
+ #
42
+ # +location+ (Optional)
43
+ # Only for use in proximity search within the US, the location parameter, if provided, will attempt to restrict search results to areas near that location. This may either be formatted as a comma-separated latitude and longitude (i.e. "37.821, -111.179"), or a fulltext location similar to the following:
44
+ #
45
+ # * City, State
46
+ # * City, State, Zip
47
+ # * Zip
48
+ # * Street, City, State
49
+ # * Street, City, State, Zip
50
+ # * Street, Zip
51
+ #
52
+ # Any search that uses the location parameter will add the additional data elements "distance" and "distance_units" to the result set.
53
+ #
54
+ # +radius+ (mi) (Optional, Default: 50mi., Max: 100mi.)
55
+ # If location is specified, then event.search will look for a radius parameter. Otherwise, it will use 50mi. as the radius of the search.
56
+ #
57
+ # +country_id+ (Numeric, Optional)
58
+ # The country_id of the event, used to narrow down the responses. To get a country_id, try the metro.getCountryList function.
59
+ #
60
+ # +state_id+ (Numeric, Optional)
61
+ # The state_id of the event, used to narrow down the responses. To get a state_id, try the metro.getStateList function.
62
+ #
63
+ # +metro_id+ (Numeric, Optional)
64
+ # The metro_id of the event, used to narrow down the responses. To get a metro_id, try the metro.getList function.
65
+ #
66
+ # +per_page+ (Numeric, Optional, Default = 100)
67
+ # Number of results to return per page. Max is 100 per page.
68
+ #
69
+ # +page+ (Numeric, Optional, Default = 1)
70
+ # The page number of results to return.
71
+ #
72
+ # +sort+ (One of name-desc, name-asc, distance-asc, distance-desc, Default = name-asc)
73
+ # The field and direction on which to sort the results. Distance sorts must ONLY be used if location is specified.
74
+ def self.search(options={})
75
+ Mash.new(self.get('/', :query => {:method => 'venue.search'}.merge(options).merge(Upcoming.default_options))).rsp.venue
76
+ end
77
+
78
+ # Add a new venue to the database. You must pass authentication parameters for this function.
79
+ #
80
+ # +token+ (Required)
81
+ # An authentication token.
82
+ #
83
+ # +venuename+ (Required)
84
+ # The name of the venue.
85
+ #
86
+ # +venueaddress+ (Required)
87
+ # The name of the venue.
88
+ #
89
+ # +venuecity+ (Required)
90
+ # The name of the venue.
91
+ #
92
+ # +metro_id+ (Numeric,required if no location )
93
+ # The metro_id of the venue. To get a metro_id, try the metro.* series of functions.
94
+ #
95
+ # +location+ (Required if no metro_id)
96
+ # Location parameter accepts comma separated address fields and adds the venue based on your input.
97
+ #
98
+ # +venuezip+ (Optional)
99
+ # The venue's Zip Code or equivalent.
100
+ #
101
+ # +venuephone+ (Optional)
102
+ # The venue's phone number.
103
+ #
104
+ # +venueurl+ (Optional)
105
+ # The url of the venue's website (if any).
106
+ #
107
+ # +venuedescription+ (Optional)
108
+ # A textual description of the venue.
109
+ #
110
+ # +private+ (1 or 0, Optional, Defaults to 0)
111
+ # A flag indicating whether the venue should be public (0), or shown only to your friends (1).
112
+ #
113
+ def self.add(info, token)
114
+ token = Upcoming::Auth.token_code(token)
115
+ format :xml
116
+ body = {:method => 'venue.add'}
117
+ body.merge!({:token => token})
118
+ body.merge!(info)
119
+ body.merge!(Upcoming.default_options)
120
+ body.merge!({:format => 'xml'})
121
+ Mash.new(self.post('/', :body => body)).rsp.venue
122
+ end
123
+
124
+ # Edit a venue. Only the authenticated user that added the venue may edit it. You must pass authentication parameters for this function.
125
+ #
126
+ # +token+ (Required)
127
+ # An authentication token.
128
+ #
129
+ # +venue_id+ (Numeric, Required)
130
+ # The id of the venue.
131
+ #
132
+ # +venuename+ (Required)
133
+ # The name of the venue.
134
+ #
135
+ # +venueaddress+ (Required)
136
+ # The name of the venue.
137
+ #
138
+ # +venuecity+ (Required)
139
+ # The name of the venue.
140
+ #
141
+ # +metro_id+ (Numeric, Required)
142
+ # The metro_id of the venue. To get a metro_id, try the metro.* series of functions.
143
+ #
144
+ # +venuezip+ (Optional)
145
+ # The venue's Zip Code or equivalent.
146
+ #
147
+ # +venuephone+ (Optional)
148
+ # The venue's phone number.
149
+ #
150
+ # +venueurl+ (Optional)
151
+ # The url of the venue's website (if any).
152
+ #
153
+ # +venuedescription+ (Optional)
154
+ # A textual description of the venue.
155
+ #
156
+ # +private+ (1 or 0, Optional, Defaults to 0)
157
+ # A flag indicating whether the venue should be public (0), or shown only to your friends (1).
158
+ #
159
+ def self.edit(venue, token)
160
+ token = Upcoming::Auth.token_code(token)
161
+ format :xml
162
+ body = {:method => 'venue.edit'}
163
+ body.merge!({:token => token})
164
+ body.merge!(event)
165
+ body.merge!(Upcoming.default_options)
166
+ body.merge!({:format => 'xml'})
167
+ Mash.new(self.post('/', :body => body)).rsp.venue
168
+ end
169
+ end
170
+ end