Skip to content

Commit

Permalink
add Profile module
Browse files Browse the repository at this point in the history
  • Loading branch information
qrtt1 committed Sep 16, 2011
1 parent 3c6c7f3 commit 8de3456
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main/java/com/google/jplurk_oauth/module/Profile.java
@@ -0,0 +1,34 @@
package com.google.jplurk_oauth.module;

import org.json.JSONObject;

import com.google.jplurk_oauth.skeleton.AbstractModule;
import com.google.jplurk_oauth.skeleton.Args;
import com.google.jplurk_oauth.skeleton.HttpMethod;
import com.google.jplurk_oauth.skeleton.RequestException;

public class Profile extends AbstractModule {

@Override
protected String getModulePath() {
return "/APP/Profile";
}

public JSONObject getOwnProfile() throws RequestException {
return requestBy("getOwnProfile").withoutArgs()
.in(HttpMethod.GET).thenJsonObject();
}

public JSONObject getPublicProfile(Long userId) throws RequestException {
return requestBy("getPublicProfile")
.with(new Args().add("user_id", userId))
.in(HttpMethod.GET).thenJsonObject();
}

public JSONObject getPublicProfile(String userId) throws RequestException {
return requestBy("getPublicProfile")
.with(new Args().add("user_id", userId))
.in(HttpMethod.GET).thenJsonObject();
}

}

0 comments on commit 8de3456

Please sign in to comment.