Module: Orkut::Client::People

Includes:
Base
Included in:
Orkut::Client
Defined in:
lib/orkut/client/people.rb

Overview

Defines methods related to people, friends and contacts

Constant Summary

Constants included from Base

Base::DEFAULT_COUNT, Base::DEFAULT_DATETIME_FORMAT, Base::DEFAULT_LANGUAGE

Instance Method Summary collapse

Methods included from Base

#default_headers, #format_datetime, #get_refresh_token, #request_id

Instance Method Details

#get_person_full_profile(options = {}) ⇒ Object

“data”=>{“gender”=>“male”, “status”=>“Realização de Testes via Agregador”, “profileUrl”=>“/Profile.aspx?uid=143766589716977679&mt=os”, “addresses”=>[{“region”=>“São Paulo”, “locality”=>“São Paulo”, “type”=>“currentLocation”, “country”=>“BR”], “isViewer”=>true, “id”=>“13930868467330630793”, “thumbnailUrl”=>“”, “name”=>Pereira”, “givenName”=>“Ygor Eduardo”, “currentLocation”=>Paulo”, “locality”=>“São Paulo”, “longitude”=>0.0, “latitude”=>0.0, “type”=>“currentLocation”, “country”=>“BR”}}


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/orkut/client/people.rb', line 30

def get_person_full_profile(options={})
  params = [{
    Orkut::Constants::Fields::PARAMS => {
      Orkut::Constants::Fields::FIELDS => [
          Orkut::Constants::Fields::NAME,
          Orkut::Constants::Fields::THUMBNAIL_URL,
          Orkut::Constants::Fields::PROFILE_URL,
          Orkut::Constants::Fields::STATUS,
          Orkut::Constants::Fields::EMAILS,
          Orkut::Constants::Fields::GENDER,
          Orkut::Constants::Fields::PHONE_NUMBERS,
          Orkut::Constants::Fields::BIRTHDAY,
          Orkut::Constants::Fields::CURRENT_LOCATION
      ],
      Orkut::Constants::Fields::GROUP_ID => Orkut::Constants::Group::SELF,
      Orkut::Constants::Fields::USER_ID => (options[:user_id] || Orkut::Constants::InternalConstants::USERID_ME)
    },
    Orkut::Constants::Fields::ID     => request_id.to_s+'-'+Orkut::Constants::MethodNames::PEOPLE_GET,
    Orkut::Constants::Fields::METHOD => Orkut::Constants::MethodNames::PEOPLE_GET
  }]
  MultiJson.decode(post_v1(nil, params.to_s, default_headers).body)
end

#list_friends(options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/orkut/client/people.rb', line 15

def list_friends(options={})
  params = [{
    Orkut::Constants::Fields::PARAMS => {
      Orkut::Constants::Fields::GROUP_ID    => Orkut::Constants::Group::FRIENDS,
      Orkut::Constants::Fields::USER_ID     => Orkut::Constants::InternalConstants::USERID_ME,
      Orkut::Constants::Fields::COUNT       => (options[:count] || Orkut::Client::Base::DEFAULT_COUNT),
      Orkut::Constants::Fields::START_INDEX => 0
    },
    Orkut::Constants::Fields::ID     => request_id.to_s+'-'+Orkut::Constants::MethodNames::PEOPLE_GET,
    Orkut::Constants::Fields::METHOD => Orkut::Constants::MethodNames::PEOPLE_GET
  }]
  MultiJson.decode(post_v1(nil, params.to_s, default_headers).body)
end