Skip to content

Commit 7b4fe73

Browse files
Merge pull request scribejava#301 from vainolo/master
Added Mendeley API
2 parents 422fb2b + ca470f8 commit 7b4fe73

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package org.scribe.builder.api;
2+
3+
import org.scribe.model.*;
4+
5+
/**
6+
* @author Arieh "Vainolo" Bibliowicz
7+
* @see http://apidocs.mendeley.com/home/authentication
8+
*/
9+
public class MendeleyApi extends DefaultApi10a
10+
{
11+
12+
private static final String AUTHORIZATION_URL = "http://api.mendeley.com/oauth/authorize?oauth_token=%s";
13+
14+
@Override
15+
public String getRequestTokenEndpoint()
16+
{
17+
return "http://api.mendeley.com/oauth/request_token/";
18+
}
19+
20+
@Override
21+
public String getAccessTokenEndpoint()
22+
{
23+
return "http://api.mendeley.com/oauth/access_token/";
24+
}
25+
26+
@Override
27+
public String getAuthorizationUrl(Token requestToken)
28+
{
29+
return String.format(AUTHORIZATION_URL, requestToken.getToken());
30+
}
31+
32+
@Override
33+
public Verb getAccessTokenVerb()
34+
{
35+
return Verb.GET;
36+
}
37+
38+
@Override
39+
public Verb getRequestTokenVerb()
40+
{
41+
return Verb.GET;
42+
}
43+
}

0 commit comments

Comments
 (0)