fixed url. photo
This commit is contained in:
parent
93d69c4ec7
commit
821703f4d4
2 changed files with 3 additions and 3 deletions
|
|
@ -38,8 +38,8 @@ class Services::Facebook < Service
|
|||
end
|
||||
|
||||
def save_friends
|
||||
response = RestClient.get("https://graph.facebook.com/me/friends", {:params =>
|
||||
{:fields => ['name', 'id', 'picture'], :access_token => self.access_token}})
|
||||
url = "https://graph.facebook.com/me/friends?fields[]=name&fields[]=picture&access_token=#{URI.escape(self.access_token)}"
|
||||
response = RestClient.get(url)
|
||||
data = JSON.parse(response.body)['data']
|
||||
data.each{ |p|
|
||||
ServiceUser.find_or_create_by_service_id_and_uid(:service_id => self.id, :name => p["name"],
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
- if friend.person
|
||||
= person_image_link(friend.person)
|
||||
- else
|
||||
= image_tag('/images/user/default.png', :class => 'avatar')
|
||||
= image_tag(friend.photo_url, :class => 'avatar')
|
||||
|
||||
%h4.name
|
||||
- if friend.person
|
||||
|
|
|
|||
Loading…
Reference in a new issue