Skip to content

Commit 295d32c

Browse files
committed
Added Mendeley API class
1 parent bf4f0db commit 295d32c

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2012 Arieh 'Vainolo' Bibliowicz
3+
* You can use this code for educational purposes. For any other uses
4+
* please contact me: vainolo@gmail.com
5+
*******************************************************************************/
6+
package org.scribe.builder.api;
7+
8+
import org.scribe.model.Token;
9+
import org.scribe.model.Verb;
10+
11+
public class MendeleyApi extends DefaultApi10a {
12+
13+
private static final String AUTHORIZATION_URL = "http://api.mendeley.com/oauth/authorize?oauth_token=%s";
14+
15+
@Override
16+
public String getRequestTokenEndpoint() {
17+
return "http://api.mendeley.com/oauth/request_token/";
18+
}
19+
20+
@Override
21+
public String getAccessTokenEndpoint() {
22+
return "http://api.mendeley.com/oauth/access_token/";
23+
}
24+
25+
@Override
26+
public String getAuthorizationUrl(Token requestToken) {
27+
return String.format(AUTHORIZATION_URL, requestToken.getToken());
28+
}
29+
30+
@Override
31+
public Verb getAccessTokenVerb() {
32+
return Verb.GET;
33+
}
34+
35+
@Override
36+
public Verb getRequestTokenVerb() {
37+
return Verb.GET;
38+
}
39+
}

0 commit comments

Comments
 (0)