foursquare2 0.8.0 → 0.9.0

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/Gemfile CHANGED
@@ -16,4 +16,8 @@ group :development do
16
16
  gem "bundler", "~> 1.0.0"
17
17
  gem "jeweler", "~> 1.5.2"
18
18
  gem "rcov", ">= 0"
19
+ gem 'fakeweb', '~> 1.3'
20
+ gem 'jnunemaker-matchy', '~> 0.4'
21
+ gem 'json_pure', '~> 1.4'
22
+ gem 'multi_json', '~> 0.0.5'
19
23
  end
data/Gemfile.lock CHANGED
@@ -2,6 +2,7 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  addressable (2.2.4)
5
+ fakeweb (1.3.0)
5
6
  faraday (0.5.5)
6
7
  addressable (~> 2.2.4)
7
8
  multipart-post (~> 1.1.0)
@@ -14,6 +15,9 @@ GEM
14
15
  bundler (~> 1.0.0)
15
16
  git (>= 1.2.5)
16
17
  rake
18
+ jnunemaker-matchy (0.4.0)
19
+ json_pure (1.5.1)
20
+ multi_json (0.0.5)
17
21
  multipart-post (1.1.0)
18
22
  rack (1.2.1)
19
23
  rake (0.8.7)
@@ -25,9 +29,13 @@ PLATFORMS
25
29
 
26
30
  DEPENDENCIES
27
31
  bundler (~> 1.0.0)
32
+ fakeweb (~> 1.3)
28
33
  faraday (~> 0.5.3)
29
34
  faraday_middleware (~> 0.3.0)
30
35
  hashie (~> 1.0.0)
31
36
  jeweler (~> 1.5.2)
37
+ jnunemaker-matchy (~> 0.4)
38
+ json_pure (~> 1.4)
39
+ multi_json (~> 0.0.5)
32
40
  rcov
33
41
  shoulda
data/Rakefile CHANGED
@@ -19,9 +19,6 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.description = "Gives access to all endpoints in version 2 of foursquare's API with syntax that will be familiar to those who used the original foursquare gem by Jeremy Welch."
20
20
  gem.email = "muellermr@gmail.com"
21
21
  gem.authors = ["Matt Mueller"]
22
- gem.add_runtime_dependency 'faraday', '~> 0.5.3'
23
- gem.add_runtime_dependency 'faraday_middleware', '~> 0.3.0'
24
- gem.add_runtime_dependency 'hashie', '~> 1.0.0'
25
22
  end
26
23
  Jeweler::RubygemsDotOrgTasks.new
27
24
 
data/Readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # foursquare2
2
2
 
3
- Ruby wrapper for the [foursquare v2 API](http://developer.foursquare.com/docs).
3
+ Ruby wrapper for the [foursquare v2 API](http://developer.foursquare.com/docs/).
4
4
 
5
5
  ## Installation
6
6
 
@@ -23,7 +23,7 @@ Currently this gem does not handle the oauth2 authentication flow for you, use t
23
23
 
24
24
  ### Examples
25
25
 
26
- See [the documentation](http://rubydoc.info/gems/foursquare2) for a list of all supported methods and available options.
26
+ See [the documentation](http://rubydoc.info/gems/foursquare2/frames) for a list of all supported methods and available options.
27
27
 
28
28
  #### Get information about a user (use 'self' for the authenticated user)
29
29
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.9.0
data/foursquare2.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{foursquare2}
8
- s.version = "0.8.0"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Mueller"]
12
- s.date = %q{2011-02-12}
12
+ s.date = %q{2011-02-13}
13
13
  s.description = %q{Gives access to all endpoints in version 2 of foursquare's API with syntax that will be familiar to those who used the original foursquare gem by Jeremy Welch.}
14
14
  s.email = %q{muellermr@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -33,8 +33,25 @@ Gem::Specification.new do |s|
33
33
  "lib/foursquare2/tips.rb",
34
34
  "lib/foursquare2/users.rb",
35
35
  "lib/foursquare2/venues.rb",
36
+ "test/fixtures/checkin.json",
37
+ "test/fixtures/friend_checkins.json",
38
+ "test/fixtures/photo.json",
39
+ "test/fixtures/search_specials.json",
40
+ "test/fixtures/search_tips.json",
41
+ "test/fixtures/search_users.json",
42
+ "test/fixtures/search_venues.json",
43
+ "test/fixtures/special.json",
44
+ "test/fixtures/tip.json",
45
+ "test/fixtures/user.json",
46
+ "test/fixtures/venue.json",
36
47
  "test/helper.rb",
37
- "test/test_foursquare2.rb"
48
+ "test/test_checkins.rb",
49
+ "test/test_client.rb",
50
+ "test/test_photos.rb",
51
+ "test/test_specials.rb",
52
+ "test/test_tips.rb",
53
+ "test/test_users.rb",
54
+ "test/test_venues.rb"
38
55
  ]
39
56
  s.homepage = %q{http://github.com/mattmueller/foursquare2}
40
57
  s.licenses = ["MIT"]
@@ -43,7 +60,13 @@ Gem::Specification.new do |s|
43
60
  s.summary = %q{Foursquare API v2 gem in the spirit of the original foursquare gem}
44
61
  s.test_files = [
45
62
  "test/helper.rb",
46
- "test/test_foursquare2.rb"
63
+ "test/test_checkins.rb",
64
+ "test/test_client.rb",
65
+ "test/test_photos.rb",
66
+ "test/test_specials.rb",
67
+ "test/test_tips.rb",
68
+ "test/test_users.rb",
69
+ "test/test_venues.rb"
47
70
  ]
48
71
 
49
72
  if s.respond_to? :specification_version then
@@ -58,9 +81,10 @@ Gem::Specification.new do |s|
58
81
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
59
82
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
60
83
  s.add_development_dependency(%q<rcov>, [">= 0"])
61
- s.add_runtime_dependency(%q<faraday>, ["~> 0.5.3"])
62
- s.add_runtime_dependency(%q<faraday_middleware>, ["~> 0.3.0"])
63
- s.add_runtime_dependency(%q<hashie>, ["~> 1.0.0"])
84
+ s.add_development_dependency(%q<fakeweb>, ["~> 1.3"])
85
+ s.add_development_dependency(%q<jnunemaker-matchy>, ["~> 0.4"])
86
+ s.add_development_dependency(%q<json_pure>, ["~> 1.4"])
87
+ s.add_development_dependency(%q<multi_json>, ["~> 0.0.5"])
64
88
  else
65
89
  s.add_dependency(%q<faraday>, ["~> 0.5.3"])
66
90
  s.add_dependency(%q<faraday_middleware>, ["~> 0.3.0"])
@@ -69,9 +93,10 @@ Gem::Specification.new do |s|
69
93
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
70
94
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
71
95
  s.add_dependency(%q<rcov>, [">= 0"])
72
- s.add_dependency(%q<faraday>, ["~> 0.5.3"])
73
- s.add_dependency(%q<faraday_middleware>, ["~> 0.3.0"])
74
- s.add_dependency(%q<hashie>, ["~> 1.0.0"])
96
+ s.add_dependency(%q<fakeweb>, ["~> 1.3"])
97
+ s.add_dependency(%q<jnunemaker-matchy>, ["~> 0.4"])
98
+ s.add_dependency(%q<json_pure>, ["~> 1.4"])
99
+ s.add_dependency(%q<multi_json>, ["~> 0.0.5"])
75
100
  end
76
101
  else
77
102
  s.add_dependency(%q<faraday>, ["~> 0.5.3"])
@@ -81,9 +106,10 @@ Gem::Specification.new do |s|
81
106
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
82
107
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
83
108
  s.add_dependency(%q<rcov>, [">= 0"])
84
- s.add_dependency(%q<faraday>, ["~> 0.5.3"])
85
- s.add_dependency(%q<faraday_middleware>, ["~> 0.3.0"])
86
- s.add_dependency(%q<hashie>, ["~> 1.0.0"])
109
+ s.add_dependency(%q<fakeweb>, ["~> 1.3"])
110
+ s.add_dependency(%q<jnunemaker-matchy>, ["~> 0.4"])
111
+ s.add_dependency(%q<json_pure>, ["~> 1.4"])
112
+ s.add_dependency(%q<multi_json>, ["~> 0.0.5"])
87
113
  end
88
114
  end
89
115
 
@@ -12,6 +12,7 @@ module Foursquare2
12
12
  include Specials
13
13
  include Users
14
14
 
15
+ attr_reader :client_id, :client_secret, :oauth_token
15
16
 
16
17
  #Initialize the client class that will be used for all foursquare API requests. Note that either a valid user oauth token OR a valid client_id + secret is required.
17
18
  #
@@ -0,0 +1,108 @@
1
+ {
2
+ "meta": {
3
+ "code": 200
4
+ },
5
+ "response": {
6
+ "checkin": {
7
+ "id": "4d572bcc9e508cfab975189b",
8
+ "createdAt": 1297558476,
9
+ "type": "checkin",
10
+ "timeZone": "America/Indiana/Knox",
11
+ "user": {
12
+ "id": "108914",
13
+ "firstName": "Matt",
14
+ "lastName": "Mueller",
15
+ "photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/-1_1258721627014.jpg",
16
+ "gender": "male",
17
+ "homeCity": "Nashville, TN",
18
+ "relationship": "self"
19
+ },
20
+ "venue": {
21
+ "id": "4b8c3d87f964a520f7c532e3",
22
+ "name": "Bridgestone Arena",
23
+ "contact": {
24
+ "phone": "6157702000",
25
+ "twitter": "BrdgstoneArena"
26
+ },
27
+ "location": {
28
+ "address": "501 Broadway",
29
+ "city": "Nashville",
30
+ "state": "TN",
31
+ "postalCode": "37203",
32
+ "country": "USA",
33
+ "lat": 36.159221413680946,
34
+ "lng": -86.7784309387207
35
+ },
36
+ "categories": [
37
+ {
38
+ "id": "4bf58dd8d48988d185941735",
39
+ "name": "Hockey",
40
+ "icon": "http://foursquare.com/img/categories/arts_entertainment/stadium_hockey.png",
41
+ "parents": [
42
+ "Arts & Entertainment",
43
+ "Stadium"
44
+ ],
45
+ "primary": true
46
+ },
47
+ {
48
+ "id": "4bf58dd8d48988d1e5931735",
49
+ "name": "Music Venue",
50
+ "icon": "http://foursquare.com/img/categories/arts_entertainment/musicvenue.png",
51
+ "parents": [
52
+ "Arts & Entertainment"
53
+ ]
54
+ },
55
+ {
56
+ "id": "4bf58dd8d48988d171941735",
57
+ "name": "Event Space",
58
+ "icon": "http://foursquare.com/img/categories/building/default.png",
59
+ "parents": [
60
+ "Home / Work / Other"
61
+ ]
62
+ },
63
+ {
64
+ "id": "4bf58dd8d48988d1e6931735",
65
+ "name": "Concert Hall",
66
+ "icon": "http://foursquare.com/img/categories/arts_entertainment/musicvenue.png",
67
+ "parents": [
68
+ "Arts & Entertainment",
69
+ "Music Venue"
70
+ ]
71
+ },
72
+ {
73
+ "id": "4bf58dd8d48988d1f1931735",
74
+ "name": "Other - Entertainment",
75
+ "icon": "http://foursquare.com/img/categories/arts_entertainment/default.png",
76
+ "parents": [
77
+ "Arts & Entertainment"
78
+ ]
79
+ }
80
+ ],
81
+ "verified": true,
82
+ "stats": {
83
+ "checkinsCount": 7692,
84
+ "usersCount": 2858
85
+ },
86
+ "todos": {
87
+ "count": 0
88
+ }
89
+ },
90
+ "source": {
91
+ "name": "foursquare for Android",
92
+ "url": "http://foursquare.com/devices/android"
93
+ },
94
+ "photos": {
95
+ "count": 0,
96
+ "items": [
97
+
98
+ ]
99
+ },
100
+ "comments": {
101
+ "count": 0,
102
+ "items": [
103
+
104
+ ]
105
+ }
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,154 @@
1
+ {
2
+ "meta": {
3
+ "code": 200
4
+ },
5
+ "response": {
6
+ "recent": [
7
+ {
8
+ "id": "4d57562fcff7721e2db0c1f5",
9
+ "createdAt": 1297569327,
10
+ "type": "checkin",
11
+ "timeZone": "America/Indiana/Knox",
12
+ "user": {
13
+ "id": "104500",
14
+ "firstName": "Chris",
15
+ "lastName": "McIntyre",
16
+ "photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/-1_1258670041337.jpg",
17
+ "gender": "male",
18
+ "homeCity": "Davidson, TN",
19
+ "relationship": "friend"
20
+ },
21
+ "venue": {
22
+ "id": "4b058668f964a520cc6022e3",
23
+ "name": "Buffalo Billiards",
24
+ "contact": {
25
+
26
+ },
27
+ "location": {
28
+ "address": "154 2nd Avenue North",
29
+ "city": "Nashville",
30
+ "state": "TN",
31
+ "postalCode": "37201",
32
+ "lat": 36.163561,
33
+ "lng": -86.776222
34
+ },
35
+ "categories": [
36
+ {
37
+ "id": "4bf58dd8d48988d1e3931735",
38
+ "name": "Billiards",
39
+ "icon": "http://foursquare.com/img/categories/arts_entertainment/billiards.png",
40
+ "parents": [
41
+ "Arts & Entertainment"
42
+ ],
43
+ "primary": true
44
+ },
45
+ {
46
+ "id": "4bf58dd8d48988d116941735",
47
+ "name": "Bar",
48
+ "icon": "http://foursquare.com/img/categories/nightlife/default.png",
49
+ "parents": [
50
+ "Nightlife"
51
+ ]
52
+ }
53
+ ],
54
+ "verified": false,
55
+ "stats": {
56
+ "checkinsCount": 331,
57
+ "usersCount": 188
58
+ },
59
+ "todos": {
60
+ "count": 0
61
+ },
62
+ "specials": [
63
+
64
+ ]
65
+ },
66
+ "source": {
67
+ "name": "Gowalla",
68
+ "url": "http://gowalla.com/"
69
+ },
70
+ "photos": {
71
+ "count": 0,
72
+ "items": [
73
+
74
+ ]
75
+ },
76
+ "comments": {
77
+ "count": 0,
78
+ "items": [
79
+
80
+ ]
81
+ }
82
+ },
83
+ {
84
+ "id": "4d575426c6edf04dce4edca2",
85
+ "createdAt": 1297568806,
86
+ "type": "checkin",
87
+ "isMayor": true,
88
+ "timeZone": "America/Indiana/Knox",
89
+ "user": {
90
+ "id": "343118",
91
+ "firstName": "David",
92
+ "lastName": "Cintron",
93
+ "photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/NDBY0W44W4CKCEKX.jpg",
94
+ "gender": "male",
95
+ "homeCity": "Nashville, TN",
96
+ "relationship": "friend"
97
+ },
98
+ "venue": {
99
+ "id": "4b0b5f97f964a520ed3023e3",
100
+ "name": "Brentwood Downs",
101
+ "contact": {
102
+ "phone": "6158346355"
103
+ },
104
+ "location": {
105
+ "address": "One Derby Trace",
106
+ "city": "Nashville",
107
+ "state": "TN",
108
+ "postalCode": "37211",
109
+ "lat": 36.0427951,
110
+ "lng": -86.7394326
111
+ },
112
+ "categories": [
113
+ {
114
+ "id": "4bf58dd8d48988d103941735",
115
+ "name": "Home",
116
+ "icon": "http://foursquare.com/img/categories/building/home.png",
117
+ "parents": [
118
+ "Home / Work / Other"
119
+ ],
120
+ "primary": true
121
+ }
122
+ ],
123
+ "verified": false,
124
+ "stats": {
125
+ "checkinsCount": 758,
126
+ "usersCount": 39
127
+ },
128
+ "todos": {
129
+ "count": 0
130
+ },
131
+ "specials": [
132
+
133
+ ]
134
+ },
135
+ "source": {
136
+ "name": "foursquare for iPhone",
137
+ "url": "http://foursquare.com/devices/iphone"
138
+ },
139
+ "photos": {
140
+ "count": 0,
141
+ "items": [
142
+
143
+ ]
144
+ },
145
+ "comments": {
146
+ "count": 0,
147
+ "items": [
148
+
149
+ ]
150
+ }
151
+ }
152
+ ]
153
+ }
154
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "meta": {
3
+ "code": 200
4
+ },
5
+ "response": {
6
+ "photo": {
7
+ "id": "4d0fb8162d39a340637dc42b",
8
+ "createdAt": 1292875798,
9
+ "url": "http://playfoursquare.s3.amazonaws.com/pix/UYU54GYOCURPAUYXH5V2U3EOM4DCX4VZPT3YOMN43H555KU2.jpg",
10
+ "sizes": {
11
+ "count": 4,
12
+ "items": [
13
+ {
14
+ "url": "http://playfoursquare.s3.amazonaws.com/pix/UYU54GYOCURPAUYXH5V2U3EOM4DCX4VZPT3YOMN43H555KU2.jpg",
15
+ "width": 540,
16
+ "height": 720
17
+ },
18
+ {
19
+ "url": "http://playfoursquare.s3.amazonaws.com/derived_pix/UYU54GYOCURPAUYXH5V2U3EOM4DCX4VZPT3YOMN43H555KU2_300x300.jpg",
20
+ "width": 300,
21
+ "height": 300
22
+ },
23
+ {
24
+ "url": "http://playfoursquare.s3.amazonaws.com/derived_pix/UYU54GYOCURPAUYXH5V2U3EOM4DCX4VZPT3YOMN43H555KU2_100x100.jpg",
25
+ "width": 100,
26
+ "height": 100
27
+ },
28
+ {
29
+ "url": "http://playfoursquare.s3.amazonaws.com/derived_pix/UYU54GYOCURPAUYXH5V2U3EOM4DCX4VZPT3YOMN43H555KU2_36x36.jpg",
30
+ "width": 36,
31
+ "height": 36
32
+ }
33
+ ]
34
+ },
35
+ "user": {
36
+ "id": "2102",
37
+ "firstName": "Kushal",
38
+ "lastName": "D.",
39
+ "photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/2102_1242573242.jpg",
40
+ "gender": "male",
41
+ "homeCity": "Brooklyn, NY"
42
+ }
43
+ }
44
+ }
45
+ }