mogli 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mogli.rb CHANGED
@@ -15,12 +15,14 @@ require "mogli/activity"
15
15
  require "mogli/address"
16
16
  require "mogli/album"
17
17
  require "mogli/book"
18
+ require "mogli/checkin"
18
19
  require "mogli/comment"
19
20
  require "mogli/education"
20
21
  require "mogli/event"
21
22
  require "mogli/group"
22
23
  require "mogli/interest"
23
24
  require "mogli/link"
25
+ require "mogli/location"
24
26
  require "mogli/movie"
25
27
  require "mogli/music"
26
28
  require "mogli/note"
@@ -0,0 +1,9 @@
1
+ module Mogli
2
+ class Checkin < Model
3
+ define_properties :id,:message, :created_time
4
+ hash_populating_accessor :from, "User"
5
+ hash_populating_accessor :tags, "User"
6
+ hash_populating_accessor :place, "Page"
7
+ hash_populating_accessor :application, "Page"
8
+ end
9
+ end
data/lib/mogli/client.rb CHANGED
@@ -16,6 +16,10 @@ module Mogli
16
16
  "https://graph.facebook.com/#{path}"
17
17
  end
18
18
 
19
+ def fql_path
20
+ "https://api.facebook.com/method/fql.query"
21
+ end
22
+
19
23
  def initialize(access_token = nil,expiration=nil)
20
24
  @access_token = access_token
21
25
  # nil expiration means extended access
@@ -54,6 +58,12 @@ module Mogli
54
58
  self.class.delete(api_path(path),:query=>default_params)
55
59
  end
56
60
 
61
+ def fql_query(query,klass=nil,format="json")
62
+ data = self.class.post(fql_path,:body=>default_params.merge({:query=>query,:format=>format}))
63
+ return data unless format=="json"
64
+ map_data(data,klass)
65
+ end
66
+
57
67
  def get_and_map(path,klass=nil,body_args = {})
58
68
  data = self.class.get(api_path(path),:query=>default_params.merge(body_args))
59
69
  map_data(data,klass)
@@ -0,0 +1,6 @@
1
+ module Mogli
2
+ class Location < Model
3
+ define_properties :latitude, :longitude
4
+
5
+ end
6
+ end
data/lib/mogli/page.rb CHANGED
@@ -12,6 +12,9 @@ module Mogli
12
12
  # Musicians
13
13
  define_properties :record_label, :hometown, :band_members, :genre
14
14
 
15
+ # As a like
16
+ define_properties :created_time
17
+
15
18
  def client_for_page
16
19
  if access_token.blank?
17
20
  raise MissingAccessToken.new("You can only get a client for this page if an access_token has been provided. i.e. via /me/accounts")
data/lib/mogli/profile.rb CHANGED
@@ -13,7 +13,9 @@ module Mogli
13
13
  has_association :events, "Event"
14
14
  has_association :links, "Link"
15
15
  has_association :statuses, "Status"
16
-
16
+ has_association :checkins, "Checkin"
17
+
18
+ hash_populating_accessor :location, "Location"
17
19
  def image_url
18
20
  "https://graph.facebook.com/#{id}/picture"
19
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mogli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Mangino
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-07-26 00:00:00 -04:00
12
+ date: 2010-08-20 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,7 @@ files:
47
47
  - lib/mogli/album.rb
48
48
  - lib/mogli/authenticator.rb
49
49
  - lib/mogli/book.rb
50
+ - lib/mogli/checkin.rb
50
51
  - lib/mogli/client/event.rb
51
52
  - lib/mogli/client/user.rb
52
53
  - lib/mogli/client.rb
@@ -57,6 +58,7 @@ files:
57
58
  - lib/mogli/group.rb
58
59
  - lib/mogli/interest.rb
59
60
  - lib/mogli/link.rb
61
+ - lib/mogli/location.rb
60
62
  - lib/mogli/model.rb
61
63
  - lib/mogli/movie.rb
62
64
  - lib/mogli/music.rb