lib/social_profile/people/vkontakte.rb in social_profile-0.2.2 vs lib/social_profile/people/vkontakte.rb in social_profile-0.3.0

- old
+ new

@@ -165,9 +165,30 @@ :fields => "screen_name" }.merge(options) fetch_all_method_items(:fetch_followers, options) end + + # Get post by id + # + def get_post(post_uid, options={}) + options = { + :posts => post_uid, + :extended => 1 + }.merge(options) + + user.wall.getById(options) + end + + # Get mutual friends (options target_uids is required) + # + def mutual_friends(options={}) + response = user.friends.getMutual(options) + + return {} unless response.is_a?(Array) + + response.inject({}) {|h, a| h.merge!(a["id"].to_s => a["common_count"]) } + end protected def user @user ||= ::Vkontakte::App::User.new(uid, :access_token => access_token) \ No newline at end of file