1b9509693de83c45aea0839e68fab39f1a49bdc4
[atutor.git] / mods / atsocial_iphone_app / Classes / OSProvider.m
1 //
2 //  OSProvider.m
3 //  ATutor
4 //
5 //  Created by Quang Anh Do on 29/05/2010.
6 //  Copyright 2010 Quang Anh Do. All rights reserved.
7 //
8
9 #import "OSProvider.h"
10 #import "OARequestParameter.h"
11
12
13 @implementation OSProvider
14
15 @synthesize requestUrl, authorizeUrl, accessUrl, endpointUrl, extraRequestUrlParams, isOpenSocial, consumerKey, consumerSecret, name;
16
17 - (void)dealloc {
18         [requestUrl release];
19         [authorizeUrl release];
20         [accessUrl release];
21         [endpointUrl release];
22         [consumerKey release];
23         [consumerSecret release];
24         [name release];
25         
26         [super dealloc];
27 }
28
29 + (OSProvider *)getATutorProviderWithKey:(NSString *)key withSecret:(NSString *)secret {
30         OSProvider *atutor = [[[OSProvider alloc] init] autorelease];
31         atutor.requestUrl = [NSString stringWithFormat:@"%@/mods/_standard/social/lib/oauth/request_token.php", kATutorURL];
32         atutor.authorizeUrl = [NSString stringWithFormat:@"%@/mods/_standard/social/lib/oauth/authorize.php", kATutorURL];
33         atutor.accessUrl = [NSString stringWithFormat:@"%@/mods/_standard/social/lib/oauth/access_token.php", kATutorURL];
34         atutor.endpointUrl = [NSString stringWithFormat:@"%@/social/rest", kShindigURL];
35         
36         atutor.isOpenSocial = YES;
37         
38         atutor.consumerKey = key;
39         atutor.consumerSecret = secret;
40         
41         atutor.name = @"ATutor";
42         
43         return atutor;
44 }
45
46 @end