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,61 @@
1
+ module Upcoming
2
+ class Watchlist
3
+ include Upcoming::Defaults
4
+
5
+ # Retrieve the watchlist for a user.
6
+ #
7
+ # +token+ (Required)
8
+ # An authentication token.
9
+ #
10
+ # +min_date+ (YYYY-MM-DD, Optional)
11
+ # Get watchlisted events on or after this date, formatted as YYYY-MM-DD.
12
+ #
13
+ # +max_date+ (YYYY-MM-DD, Optional)
14
+ # Get watchlisted events on or before this date, formatted as YYYY-MM-DD.
15
+ #
16
+ # +sort+ ('start-date-asc', 'start-date-desc', 'post-date-asc', 'post-date-desc') [Default: 'post-date-asc']
17
+ # Sort the watchlisted events by start date or post date.
18
+ #
19
+ def self.list(token, query={})
20
+ query.merge!({:method => 'watchlist.getList'})
21
+ Mash.new(self.get('/', :query => query.merge(Upcoming.default_options))).rsp.watchlist
22
+ end
23
+
24
+ # Add an event to a user's watchlist. This function will delete an existing watchlist setting and replace it with the new one, so you don't have to call watchlist.remove first.
25
+ #
26
+ # +token+ (Required)
27
+ # An authentication token.
28
+ #
29
+ # +event_id+ (Numeric, Required)
30
+ # The event_id of the event. To get a event_id, try the event.search function.
31
+ #
32
+ # +status+ (Either 'attend' or 'watch', Optional, Default = 'watch')
33
+ # A setting indicating whether you plan to attend or watch this event.
34
+ #
35
+ def self.add(token, event_id, status='watch')
36
+ token = Upcoming::Auth.token_code(token)
37
+ format :xml
38
+ body = {:method => 'watchlist.add', :token => token, :event_id => event_id, :status => status}
39
+ body.merge!(Upcoming.default_options)
40
+ body.merge!({:format => 'xml'})
41
+ Mash.new(self.post('/', :body => body)).rsp.watchlist
42
+ end
43
+
44
+ # Remove a watchlist record from a user's watchlist.
45
+ #
46
+ # +token+ (Required)
47
+ # An authentication token.
48
+ #
49
+ # +watchlist_id+ (Numeric, Required)
50
+ # The watchlist_id of the event. To get a watchlist_id, try the watchlist.getList function.
51
+ #
52
+ def self.remove(token, watchlist_id)
53
+ token = Upcoming::Auth.token_code(token)
54
+ format :xml
55
+ body = {:method => 'watchlist.remove', :token => token, :watchlist_id => watchlist_id}
56
+ body.merge!(Upcoming.default_options)
57
+ body.merge!({:format => 'xml'})
58
+ Mash.new(self.post('/', :body => body)).rsp.stat == 'ok'
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,68 @@
1
+ {
2
+ "rsp": {
3
+ "category": [{
4
+ "description": "Concerts, nightlife, raves",
5
+ "id": 1,
6
+ "name": "Music"
7
+ },
8
+ {
9
+ "description": "Theatre, dance, opera, exhibitions",
10
+ "id": 2,
11
+ "name": "Performing/Visual Arts"
12
+ },
13
+ {
14
+ "description": "Film, book readings",
15
+ "id": 3,
16
+ "name": "Media"
17
+ },
18
+ {
19
+ "description": "Rallies, gatherings, user groups",
20
+ "id": 4,
21
+ "name": "Social"
22
+ },
23
+ {
24
+ "description": "Lectures, workshops",
25
+ "id": 5,
26
+ "name": "Education"
27
+ },
28
+ {
29
+ "description": "Conventions, expos, flea markets",
30
+ "id": 6,
31
+ "name": "Commercial"
32
+ },
33
+ {
34
+ "description": "Big events, often multiple days",
35
+ "id": 7,
36
+ "name": "Festivals"
37
+ },
38
+ {
39
+ "description": "Sporting events, recreation",
40
+ "id": 8,
41
+ "name": "Sports"
42
+ },
43
+ {
44
+ "description": "Who knows?",
45
+ "id": 10,
46
+ "name": "Other"
47
+ },
48
+ {
49
+ "description": "Stand-up, improv, comic theatre",
50
+ "id": 11,
51
+ "name": "Comedy"
52
+ },
53
+ {
54
+ "description": "Rallies, fundraisers, meetings",
55
+ "id": 12,
56
+ "name": "Politics"
57
+ },
58
+ {
59
+ "description": "Family/kid-oriented music, shows, theatre",
60
+ "id": 13,
61
+ "name": "Family"
62
+ }
63
+ ],
64
+ "stat": "ok",
65
+ "version": 1
66
+ }
67
+ }
68
+
@@ -0,0 +1,27 @@
1
+ {
2
+ "rsp": {
3
+ "country": [{
4
+ "code": "us",
5
+ "id": 1,
6
+ "name": "United States"
7
+ },
8
+ {
9
+ "code": "ca",
10
+ "id": 2,
11
+ "name": "Canada"
12
+ },
13
+ {
14
+ "code": "se",
15
+ "id": 3,
16
+ "name": "Sweden"
17
+ },
18
+ {
19
+ "code": "de",
20
+ "id": 4,
21
+ "name": "Germany"
22
+ }
23
+ ],
24
+ "stat": "ok",
25
+ "version": 1
26
+ }
27
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "rsp": {
3
+ "stat": "ok",
4
+ "version": 1,
5
+ "event": [{
6
+ "id": 2467185,
7
+ "name": "Def Leppard Dallas TX",
8
+ "tags": "",
9
+ "description": "Def Leppard, Poison &amp; Cheap Trick Tickets Dallas, TX<br \/>Friday, August 21, 2009 at 7:00 PM at Superpages.com Center in Dallas, TX<br \/><br \/><a href=\"http:\/\/www.stubpass.com\/concerts\/pop-rock\/def-leppard-tickets--in-dallas-tx\/\">Buy Cheap Def Leppard Tickets - Dallas TX<\/a><br \/><br \/><img src=\"http:\/\/intl.stubpass.com\/images\/ext\/253.jpg\" alt=\"Def Leppard Poison Cheap Trick\" style=\"\"\/><br \/><br \/>Def Leppard is beyond amazing! Def Leppard will be featured live on Friday, August 21, 2009. Fans are eagerly awaiting Friday, August 21, 2009 so they can enjoy an evening of excitement as they watch Def Leppard.<br \/><br \/>Here is your chance to see Def Leppard with a performance at 1818 1st Ave. in Dallas. With seating limited at Superpages.com Center, tickets are expected to sell quickly! This is the perfect opportunity to experience the excitement and action of Def Leppard in realistic, emotional form!<br \/><br \/>Def Leppard is known to drive the audiences wild when delivering an incredible blend of fun and excitement during the performance.<br \/><br \/>Performances by Def Leppard have been scheduled for Friday, August 21st at Superpages.com Center. Even though Superpages.com Center can hold a lot of fans, it will not be enough room for everyone planning to enjoy this concert! Purchase your tickets for Def Leppard before it is sold out!<br \/><br \/>",
10
+ "start_date": "2009-08-21",
11
+ "end_date": "",
12
+ "start_time": "19:00:00",
13
+ "end_time": "",
14
+ "personal": 0,
15
+ "selfpromotion": 0,
16
+ "metro_id": 56,
17
+ "venue_id": 115339,
18
+ "user_id": 659543,
19
+ "category_id": 1,
20
+ "url": "http:\/\/www.zimbio.com\/Joe+Elliott\/articles\/2",
21
+ "date_posted": "2009-04-21",
22
+ "latitude": 32.7743,
23
+ "longitude": -96.7574,
24
+ "geocoding_precision": "address",
25
+ "geocoding_ambiguous": 0,
26
+ "venue_name": "Superpages.com Center",
27
+ "venue_address": "1818 First Ave",
28
+ "venue_city": "Dallas",
29
+ "venue_state_name": "Texas",
30
+ "venue_state_code": "tx",
31
+ "venue_state_id": 44,
32
+ "venue_country_name": "United States",
33
+ "venue_country_code": "us",
34
+ "venue_country_id": 1,
35
+ "venue_zip": 75210,
36
+ "venue_url": "",
37
+ "venue_phone": "214-421-1111",
38
+ "ticket_url": "http:\/\/www.stubpass.com\/tickets\/?1021511-2009-08-21-def-leppard-poison-cheap-trick_superpages-com-center-formerly-smirnoff-centre",
39
+ "ticket_price": "",
40
+ "ticket_free": 0,
41
+ "utc_start": "2009-08-22 00:00:00 UTC",
42
+ "utc_end": "2009-08-22 03:00:00 UTC",
43
+ "photo_url": ""
44
+ }]
45
+ }
46
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "rsp": {
3
+ "stat": "ok",
4
+ "version": 1,
5
+ "event": [{
6
+ "id": 2467185,
7
+ "name": "Def Leppard Dallas TX",
8
+ "tags": "",
9
+ "description": "Def Leppard, Poison &amp; Cheap Trick Tickets Dallas, TX<br \/>Friday, August 21, 2009 at 7:00 PM at Superpages.com Center in Dallas, TX<br \/><br \/><a href=\"http:\/\/www.stubpass.com\/concerts\/pop-rock\/def-leppard-tickets--in-dallas-tx\/\">Buy Cheap Def Leppard Tickets - Dallas TX<\/a><br \/><br \/><img src=\"http:\/\/intl.stubpass.com\/images\/ext\/253.jpg\" alt=\"Def Leppard Poison Cheap Trick\" style=\"\"\/><br \/><br \/>Def Leppard is beyond amazing! Def Leppard will be featured live on Friday, August 21, 2009. Fans are eagerly awaiting Friday, August 21, 2009 so they can enjoy an evening of excitement as they watch Def Leppard.<br \/><br \/>Here is your chance to see Def Leppard with a performance at 1818 1st Ave. in Dallas. With seating limited at Superpages.com Center, tickets are expected to sell quickly! This is the perfect opportunity to experience the excitement and action of Def Leppard in realistic, emotional form!<br \/><br \/>Def Leppard is known to drive the audiences wild when delivering an incredible blend of fun and excitement during the performance.<br \/><br \/>Performances by Def Leppard have been scheduled for Friday, August 21st at Superpages.com Center. Even though Superpages.com Center can hold a lot of fans, it will not be enough room for everyone planning to enjoy this concert! Purchase your tickets for Def Leppard before it is sold out!<br \/><br \/>",
10
+ "start_date": "2009-08-21",
11
+ "end_date": "",
12
+ "start_time": "19:00:00",
13
+ "end_time": "",
14
+ "personal": 0,
15
+ "selfpromotion": 0,
16
+ "metro_id": 56,
17
+ "venue_id": 115339,
18
+ "user_id": 659543,
19
+ "category_id": 1,
20
+ "url": "http:\/\/www.zimbio.com\/Joe+Elliott\/articles\/2",
21
+ "date_posted": "2009-04-21",
22
+ "latitude": 32.7743,
23
+ "longitude": -96.7574,
24
+ "geocoding_precision": "address",
25
+ "geocoding_ambiguous": 0,
26
+ "venue_name": "Superpages.com Center",
27
+ "venue_address": "1818 First Ave",
28
+ "venue_city": "Dallas",
29
+ "venue_state_name": "Texas",
30
+ "venue_state_code": "tx",
31
+ "venue_state_id": 44,
32
+ "venue_country_name": "United States",
33
+ "venue_country_code": "us",
34
+ "venue_country_id": 1,
35
+ "venue_zip": 75210,
36
+ "venue_url": "",
37
+ "venue_phone": "214-421-1111",
38
+ "ticket_url": "http:\/\/www.stubpass.com\/tickets\/?1021511-2009-08-21-def-leppard-poison-cheap-trick_superpages-com-center-formerly-smirnoff-centre",
39
+ "ticket_price": "",
40
+ "ticket_free": 0,
41
+ "utc_start": "2009-08-22 00:00:00 UTC",
42
+ "utc_end": "2009-08-22 03:00:00 UTC",
43
+ "photo_url": ""
44
+ },
45
+ {
46
+ "id": 4225189,
47
+ "name": "Disney&#39;s A CHRISTMAS CAROL Train Tour",
48
+ "tags": "",
49
+ "description": "\u201cDISNEY\u2019S A CHRISTMAS CAROL\u201d Train Tour rolls into Dallas August 18-19, offering visitors an exclusive 3D sneak peek from the movie as well as a behind-the-scenes glimpse of the making of the movie\u2014with artifacts and character designs housed in real train cars. The fun family event is totally free. Sponsored by HP and driven by Amtrak, the Train Tour will travel more than 16,000 miles and pass through 36 states. Amidst a winter wonderland with holiday d\u00e9cor and Christmas carolers, visitors will see footage from \u201cDisney\u2019s A Christmas Carol\u201d inside a state-of-the-art Digital 3D theatre which will be erected in each city. Visitors can also check out the cutting-edge technology behind the film, as well as artifacts from the Charles Dickens Museum and interactive games where guests can explore Dickens\u2019 London and morph their face into characters from the movie using HP TouchSmart PCs. HP powers the interactive components of the Train Tour and its technology is used in the production of the movie. Radio Disney will invite kids to enter for a chance to become a Movie Surfer representing their hometown. Each Hometown Movie Surfer will get a chance to appear on Disney Channel by filming their very own Movie Surfer\u2019s segment! Guests will also have a chance to win an HP TouchSmart PC and HP Photosmart wireless printer in every market. This family event is for guests of all ages and is free to the public. The train tour is traveling cross-country with stops in 40 cities, culminating in November at New York City\u2019s Grand Central Terminal. The latest details about tour stops and scheduled events are available at www.christmascaroltraintour.com.\r\n\r\nAUGUST 18-19, 2009\r\n8\/18: 9:00AM \u2013 7:00PM\r\n8\/19: 9:00AM \u2013 4:00PM",
50
+ "start_date": "2009-08-18",
51
+ "end_date": "2009-08-19",
52
+ "start_time": "09:00:00",
53
+ "end_time": "16:00:00",
54
+ "personal": 0,
55
+ "selfpromotion": 1,
56
+ "metro_id": "",
57
+ "venue_id": 551080,
58
+ "user_id": 925847,
59
+ "category_id": 13,
60
+ "url": "http:\/\/www.christmascaroltraintour.com",
61
+ "date_posted": "2009-08-10",
62
+ "latitude": "",
63
+ "longitude": "",
64
+ "geocoding_precision": "",
65
+ "geocoding_ambiguous": "",
66
+ "venue_name": "Union Station - Amtrak",
67
+ "venue_address": "400 S Houston St",
68
+ "venue_city": "Dallas",
69
+ "venue_state_name": "Texas",
70
+ "venue_state_code": "TX",
71
+ "venue_state_id": 44,
72
+ "venue_country_name": "United States",
73
+ "venue_country_code": "US",
74
+ "venue_country_id": 1,
75
+ "venue_zip": 75202,
76
+ "venue_url": "",
77
+ "venue_phone": "",
78
+ "ticket_url": "",
79
+ "ticket_price": "",
80
+ "ticket_free": 1,
81
+ "utc_start": "2009-08-18 14:00:00 UTC",
82
+ "utc_end": "2009-08-19 21:00:00 UTC",
83
+ "photo_url": "http:\/\/a323.yahoofs.com\/upcoming\/2886\/sm_1aac2ef8ef39a6.jpg?upAC0iKBrXdSQJrR"
84
+ }]
85
+ }
86
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "rsp": {
3
+ "event": [{
4
+ "category_id": 1,
5
+ "date_posted": "2003-06-07",
6
+ "description": "The \"Lottapianos \" Tour. Ben Folds is opening, and will play a one hour set.",
7
+ "end_date": "",
8
+ "end_time": "",
9
+ "geocoding_ambiguous": "",
10
+ "geocoding_precision": "",
11
+ "id": 1,
12
+ "latitude": "",
13
+ "longitude": "",
14
+ "metro_id": 1,
15
+ "name": "Tori Amos, Ben Folds",
16
+ "personal": 0,
17
+ "photo_url": "",
18
+ "selfpromotion": 0,
19
+ "start_date": "2003-08-01",
20
+ "start_time": "19:00:00",
21
+ "tags": "",
22
+ "ticket_free": 0,
23
+ "ticket_price": "",
24
+ "ticket_url": "",
25
+ "url": "",
26
+ "user_id": 1,
27
+ "utc_end": "2003-08-02 05:00:00 UTC",
28
+ "utc_start": "2003-08-02 02:00:00 UTC",
29
+ "venue_address": "2700 North Vermont",
30
+ "venue_city": "Los Angeles",
31
+ "venue_country_code": "us",
32
+ "venue_country_id": 1,
33
+ "venue_country_name": "United States",
34
+ "venue_id": 1,
35
+ "venue_name": "Greek Theatre",
36
+ "venue_phone": "(323) 665-5857",
37
+ "venue_state_code": "ca",
38
+ "venue_state_id": 5,
39
+ "venue_state_name": "California",
40
+ "venue_url": "http://www.greektheatrela.com/",
41
+ "venue_zip": 90027
42
+ }],
43
+ "stat": "ok",
44
+ "version": 1
45
+ }
46
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <rsp stat="ok" version="1.0">
3
+ <event id="1" name="Tori Amos, Ben Folds" tags="" description="The &quot;Lottapianos&quot; Tour. Ben Folds is opening, and will play a one hour set." start_date="2003-08-01" end_date="0000-00-00" start_time="19:00:00" end_time="" personal="0" selfpromotion="0" metro_id="1" venue_id="1" user_id="1" category_id="1" date_posted="2003-06-07" ticket_url="http://www.ticketweb.com" ticket_price="$10.00" ticket_free="0"/>
4
+ </rsp>
@@ -0,0 +1,46 @@
1
+ {
2
+ "rsp": {
3
+ "event": [{
4
+ "category_id": 1,
5
+ "date_posted": "2003-06-07",
6
+ "description": "The \"Lottapianos \" Tour. Ben Folds is opening, and will play a one hour set.",
7
+ "end_date": "",
8
+ "end_time": "",
9
+ "geocoding_ambiguous": "",
10
+ "geocoding_precision": "",
11
+ "id": 1,
12
+ "latitude": "",
13
+ "longitude": "",
14
+ "metro_id": 1,
15
+ "name": "Tori Amos, Ben Folds",
16
+ "personal": 0,
17
+ "photo_url": "http://flickr.com",
18
+ "selfpromotion": 0,
19
+ "start_date": "2003-08-01",
20
+ "start_time": "19:00:00",
21
+ "tags": "",
22
+ "ticket_free": 0,
23
+ "ticket_price": "",
24
+ "ticket_url": "",
25
+ "url": "",
26
+ "user_id": 1,
27
+ "utc_end": "2003-08-02 05:00:00 UTC",
28
+ "utc_start": "2003-08-02 02:00:00 UTC",
29
+ "venue_address": "2700 North Vermont",
30
+ "venue_city": "Los Angeles",
31
+ "venue_country_code": "us",
32
+ "venue_country_id": 1,
33
+ "venue_country_name": "United States",
34
+ "venue_id": 1,
35
+ "venue_name": "Greek Theatre",
36
+ "venue_phone": "(323) 665-5857",
37
+ "venue_state_code": "ca",
38
+ "venue_state_id": 5,
39
+ "venue_state_name": "California",
40
+ "venue_url": "http://www.greektheatrela.com/",
41
+ "venue_zip": 90027
42
+ }],
43
+ "stat": "ok",
44
+ "version": 1
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "rsp": {
3
+ "event": [{
4
+ "category_id": 1,
5
+ "date_posted": "2003-06-07",
6
+ "description": "The \"Lottapianos \" Tour. Ben Folds is opening, and will play a one hour set.",
7
+ "end_date": "",
8
+ "end_time": "",
9
+ "geocoding_ambiguous": "",
10
+ "geocoding_precision": "",
11
+ "id": 1,
12
+ "latitude": "",
13
+ "longitude": "",
14
+ "metro_id": 1,
15
+ "name": "Tori Amos, Ben Folds",
16
+ "personal": 0,
17
+ "photo_url": "",
18
+ "selfpromotion": 0,
19
+ "start_date": "2003-08-01",
20
+ "start_time": "19:00:00",
21
+ "tags": "fee fi fo fum",
22
+ "ticket_free": 0,
23
+ "ticket_price": "",
24
+ "ticket_url": "",
25
+ "url": "",
26
+ "user_id": 1,
27
+ "utc_end": "2003-08-02 05:00:00 UTC",
28
+ "utc_start": "2003-08-02 02:00:00 UTC",
29
+ "venue_address": "2700 North Vermont",
30
+ "venue_city": "Los Angeles",
31
+ "venue_country_code": "us",
32
+ "venue_country_id": 1,
33
+ "venue_country_name": "United States",
34
+ "venue_id": 1,
35
+ "venue_name": "Greek Theatre",
36
+ "venue_phone": "(323) 665-5857",
37
+ "venue_state_code": "ca",
38
+ "venue_state_id": 5,
39
+ "venue_state_name": "California",
40
+ "venue_url": "http://www.greektheatrela.com/",
41
+ "venue_zip": 90027
42
+ }],
43
+ "stat": "ok",
44
+ "version": 1
45
+ }
46
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "rsp": {
3
+ "stat": "ok",
4
+ "token": [{
5
+ "token": "1234567890123456789012345678901234467890",
6
+ "user_id": 674,
7
+ "user_name": "getluky",
8
+ "user_username": "Gordon Luk"
9
+ }],
10
+ "version": 1
11
+ }
12
+ }