john-mayer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,5 +23,13 @@ module Foursquare
23
23
  def venue
24
24
  Foursquare::Venue.new(@foursquare, @json["venue"])
25
25
  end
26
+
27
+ def user(full=false)
28
+ if full
29
+ @foursquare.users.find(@json["user"]["id"])
30
+ else
31
+ Foursquare::User.new(@foursquare, @json["user"])
32
+ end
33
+ end
26
34
  end
27
35
  end
@@ -44,6 +44,18 @@ module Foursquare
44
44
  @json["contact"]
45
45
  end
46
46
 
47
+ def email
48
+ contact["email"]
49
+ end
50
+
51
+ def twitter
52
+ contact["twitter"]
53
+ end
54
+
55
+ def phone_number
56
+ contact["phone"]
57
+ end
58
+
47
59
  def badge_count
48
60
  @json["badges"]["count"]
49
61
  end
@@ -60,5 +72,13 @@ module Foursquare
60
72
  item = @json["checkins"]["items"].last
61
73
  Foursquare::Checkin.new(@foursquare, item)
62
74
  end
75
+
76
+ def checkins_here
77
+ checkin_json = @foursquare.get("venues/#{last_checkin.venue.id}/herenow")
78
+ checkin_json["hereNow"]["items"].map do |json|
79
+ checkin = @foursquare.get("checkins/#{json["id"]}")["checkin"]
80
+ Foursquare::Checkin.new(@foursquare, checkin)
81
+ end
82
+ end
63
83
  end
64
84
  end
data/test.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  require 'lib/foursquare'
2
2
 
3
- FOURSQUARE = Foursquare::Base.new('TOKEN')
3
+ FOURSQUARE = Foursquare::Base.new('YSQQ2G4HOATU5515IFH4ODCKUQYYKZ2M4DVBNPI1ZCXKL3QS')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: john-mayer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Nakajima