Beispiel #1
0
 public List<BuzzActivity> getWallPosts()
     throws NotAuthentifiedException, OAuthMessageSignerException, OAuthExpectationFailedException,
         OAuthCommunicationException, ClientProtocolException, IOException, JSONException {
   if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK);
   ReadableResponse response = Utils.signedGetRequest(GET_WALLPOSTS, httpOauthConsumer, null);
   return reader.readActivities(response);
 }
Beispiel #2
0
 public List<BuzzUser> getFollowed()
     throws ClientProtocolException, IOException, NotAuthentifiedException,
         OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException,
         JSONException {
   if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK);
   ReadableResponse response = Utils.signedGetRequest(GET_FOLLOWED, httpOauthConsumer, null);
   return reader.readUsers(response);
 }
Beispiel #3
0
 public BuzzUser getUser(String identifier)
     throws JSONException, OAuthMessageSignerException, OAuthExpectationFailedException,
         OAuthCommunicationException, ClientProtocolException, IOException,
         NotAuthentifiedException {
   if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK);
   ReadableResponse response =
       Utils.signedGetRequest(GET_USER1 + identifier + GET_USER2, httpOauthConsumer, null);
   return reader.readUser(response);
 }
Beispiel #4
0
 public boolean like(Post post)
     throws NotAuthentifiedException, OAuthMessageSignerException, OAuthExpectationFailedException,
         OAuthCommunicationException, ClientProtocolException, IOException, JSONException {
   String id = post.getId();
   if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK);
   ReadableResponse response =
       Utils.signedRequest(
           PUT, PUT_LIKE + id, httpOauthConsumer, JSON_TYPE, new ArrayList<NameValuePair>());
   return reader.readResponse(response);
 }
Beispiel #5
0
  public boolean post(String content)
      throws NotAuthentifiedException, OAuthMessageSignerException, OAuthExpectationFailedException,
          OAuthCommunicationException, ClientProtocolException, IOException, JSONException {
    if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK);

    ReadableResponse response =
        Utils.signedPostRequest(
            POST_ACTIVITY, JSON_ENTITY1 + content + JSON_ENTITY2, httpOauthConsumer, JSON_TYPE);
    return reader.readResponse(response);
  }
Beispiel #6
0
 public boolean comment(Post post, String comment)
     throws FileNotFoundException, MalformedURLException, IOException, NotAuthentifiedException,
         OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException,
         JSONException {
   if (!isAuthentified()) throw new NotAuthentifiedException(NETWORK);
   String entity = XML_ENTITY1 + comment + XML_ENTITY2;
   ReadableResponse response =
       Utils.signedRequest(
           POST2, POST_COMMENT + post.getId() + COMMENTS, httpOauthConsumer, XML_TYPE, entity);
   return reader.readResponse(response);
 }