Skip to content

Commit

Permalink
Release adds me/contacts as a path, fixes #37 #36
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSwitch committed Apr 2, 2014
1 parent fa49006 commit 626f741
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hello",
"version": "0.1.4",
"version": "0.1.5",
"homepage": "http://adodson.com/hello.js/",
"license" : "https://github.com/MrSwitch/hello.js/blob/master/LICENSE",
"repository": {
Expand Down
42 changes: 34 additions & 8 deletions dist/hello.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -3320,6 +3320,12 @@ hello.init({
return o;
}

function formatPerson(o){
o.name = o.displayName || o.name;
o.picture = o.picture || ( o.image ? o.image.url : null);
o.thumbnail = o.picture;
}

function formatFriends(o){
paging(o);
var r = [];
Expand Down Expand Up @@ -3691,7 +3697,7 @@ hello.init({
events : '',
photos : 'https://picasaweb.google.com/data/',
videos : 'http://gdata.youtube.com',
friends : 'https://www.google.com/m8/feeds',
friends : 'https://www.google.com/m8/feeds, https://www.googleapis.com/auth/plus.login',
files : 'https://www.googleapis.com/auth/drive.readonly',

publish : '',
Expand All @@ -3711,9 +3717,10 @@ hello.init({
'me' : 'oauth2/v1/userinfo?alt=json',

// https://developers.google.com/+/api/latest/people/list
'me/friends' : contacts_url,
'me/friends' : 'plus/v1/people/me/people/visible?maxResults=@{limit|100}',
'me/following' : contacts_url,
'me/followers' : contacts_url,
'me/contacts' : contacts_url,
'me/share' : 'plus/v1/people/me/activities/public?maxResults=@{limit|100}',
'me/feed' : 'plus/v1/people/me/activities/public?maxResults=@{limit|100}',
'me/albums' : 'https://picasaweb.google.com/data/feed/api/user/default?alt=json&max-results=@{limit|100}&start-index=@{start|1}',
Expand Down Expand Up @@ -3776,13 +3783,23 @@ hello.init({
o.last_name = o.family_name || (o.name? o.name.familyName : null);
o.first_name = o.given_name || (o.name? o.name.givenName : null);
// o.name = o.first_name + ' ' + o.last_name;
o.picture = o.picture || ( o.image ? o.image.url : null);
o.thumbnail = o.picture;
o.name = o.displayName || o.name;

formatPerson(o);
}
return o;
},
'me/friends' : formatFriends,
'me/friends' : function(o){
if(o.items){
paging(o);
o.data = o.items;
delete o.items;
for(var i=0;i<o.data.length;i++){
formatPerson(o.data[i]);
}
}
return o;
},
'me/contacts' : formatFriends,
'me/followers' : formatFriends,
'me/following' : formatFriends,
'me/share' : function(o){
Expand Down Expand Up @@ -4399,8 +4416,15 @@ hello.init({
function formatUser(o){
if(o.id){
var token = hello.getAuthResponse('windows').access_token;
o.email = (o.emails?o.emails.preferred:null);
o.thumbnail = o.picture = 'https://apis.live.net/v5.0/'+o.id+'/picture?access_token='+token;
if(o.emails){
o.email = o.emails.preferred;
}
// If this is not an non-network friend
if(o.is_friend!==false){
// Use the id of the user_id if available
var id = (o.user_id||o.id);
o.thumbnail = o.picture = 'https://apis.live.net/v5.0/'+id+'/picture?access_token='+token;
}
}
}

Expand Down Expand Up @@ -4462,6 +4486,7 @@ hello.init({
"me/friends" : "me/friends",
"me/following" : "me/contacts",
"me/followers" : "me/friends",
"me/contacts" : "me/contacts",

"me/albums" : 'me/albums',

Expand Down Expand Up @@ -4500,6 +4525,7 @@ hello.init({
return o;
},
'me/friends' : formatFriends,
'me/contacts' : formatFriends,
'me/followers' : formatFriends,
'me/following' : formatFriends,
'me/albums' : function(o){
Expand Down
Loading

0 comments on commit 626f741

Please sign in to comment.