Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated Users model (followers, following) to GitHub API v3.

  • Loading branch information...
commit 3ff86663431fa9915872fdce9db44d69ff7a947e 1 parent 3dab7c7
@CvX CvX authored dbloete committed
Showing with 5 additions and 5 deletions.
  1. +2 −2 AppConstants.h
  2. +3 −3 Classes/GHUsers.m
View
4 AppConstants.h
@@ -29,8 +29,8 @@
#define kUserReposFormat @"https://github.com/api/v2/json/repos/show/%@"
#define kUserWatchedReposFormat @"https://github.com/api/v2/json/repos/watched/%@"
#define kUserSearchFormat @"https://github.com/api/v2/json/user/search/%@"
-#define kUserFollowingFormat @"https://github.com/api/v2/json/user/show/%@/following"
-#define kUserFollowersFormat @"https://github.com/api/v2/json/user/show/%@/followers"
+#define kUserFollowingFormat @"https://api.github.com/users/%@/following" // v3
+#define kUserFollowersFormat @"https://api.github.com/users/%@/followers" // v3
#define kUserFollowFormat @"https://github.com/api/v2/json/user/%@/%@"
// Repos
View
6 Classes/GHUsers.m
@@ -29,10 +29,10 @@ - (NSString *)description {
- (void)setValuesFromDict:(NSDictionary *)theDict {
NSMutableArray *resources = [NSMutableArray array];
- for (id item in [theDict objectForKey:@"users"]) {
- NSString *login = ([item isKindOfClass:[NSString class]]) ? item : [item objectForKey:@"login"];
+ for (id user in theDict) {
+ NSString *login = [user objectForKey:@"login"];
GHUser *theUser = [[iOctocat sharedInstance] userWithLogin:login];
- if ([item isKindOfClass:[NSDictionary class]]) [theUser setValuesFromDict:item];
+ [theUser setValuesFromDict:user];
[resources addObject:theUser];
}
[resources sortUsingSelector:@selector(compareByName:)];
Please sign in to comment.
Something went wrong with that request. Please try again.