Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
TFJ-585 fix typo in TwitpicImageUpload
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke committed May 9, 2011
1 parent 7961121 commit 53d23f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
24 changes: 11 additions & 13 deletions twitter4j-core/src/main/java/twitter4j/TwitterImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,9 @@ public UserList showUserList(int listId) throws TwitterException {
*/
public UserList destroyUserList(int listId) throws TwitterException {
ensureAuthorizationEnabled();
return new UserListJSONImpl(post(conf.getRestBaseURL() + "lists/destroy.json?list_id=" + listId), conf);
return new UserListJSONImpl(post(conf.getRestBaseURL() + "lists/destroy.json",
new HttpParameter[]{
new HttpParameter("list_id", listId)}), conf);
}

/**
Expand Down Expand Up @@ -789,21 +791,15 @@ public ResponseList<UserList> getAllUserLists(long userId)
*/
public PagableResponseList<User> getUserListMembers(String listOwnerScreenName, int listId
, long cursor) throws TwitterException {
ensureAuthorizationEnabled();
return UserJSONImpl.createPagableUserList(get(conf.getRestBaseURL() +
listOwnerScreenName + "/" + listId + "/members.json?include_entities="
+ conf.isIncludeEntitiesEnabled() + "&cursor=" + cursor), conf);
return getUserListMembers(listId, cursor);
}

/**
* {@inheritDoc}
*/
public PagableResponseList<User> getUserListMembers(long listOwnerId, int listId
, long cursor) throws TwitterException {
ensureAuthorizationEnabled();
return UserJSONImpl.createPagableUserList(get(conf.getRestBaseURL() +
listOwnerId + "/" + listId + "/members.json?include_entities="
+ conf.isIncludeEntitiesEnabled() + "&cursor=" + cursor), conf);
return getUserListMembers(listId, cursor);
}

/**
Expand All @@ -813,7 +809,7 @@ public PagableResponseList<User> getUserListMembers(int listId
, long cursor) throws TwitterException {
ensureAuthorizationEnabled();
return UserJSONImpl.createPagableUserList(get(conf.getRestBaseURL() +
"lists/members.json?list_id=" + listId + "include_entities="
"lists/members.json?list_id=" + listId + "&include_entities="
+ conf.isIncludeEntitiesEnabled() + "&cursor=" + cursor), conf);
}

Expand All @@ -823,8 +819,10 @@ public PagableResponseList<User> getUserListMembers(int listId
public UserList addUserListMember(int listId, long userId) throws TwitterException {
ensureAuthorizationEnabled();
return new UserListJSONImpl(post(conf.getRestBaseURL() +
"lists/members/create.json?user_id=" + userId + "&list_id=" +
listId), conf);
"lists/members/create.json",
new HttpParameter[]{
new HttpParameter("user_id", userId),
new HttpParameter("list_id", listId)}), conf);
}

/**
Expand Down Expand Up @@ -896,7 +894,7 @@ public PagableResponseList<User> getUserListSubscribers(String listOwnerScreenNa
*/
public PagableResponseList<User> getUserListSubscribers(int listId, long cursor) throws TwitterException {
return UserJSONImpl.createPagableUserList(get(conf.getRestBaseURL() +
"lists/subscribers.json?list_id=" + listId + "include_entities="
"lists/subscribers.json?list_id=" + listId + "&include_entities="
+ conf.isIncludeEntitiesEnabled() + "&cursor=" + cursor), conf);
}

Expand Down
3 changes: 3 additions & 0 deletions twitter4j-core/src/test/java/twitter4j/TwitterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ public void testListMethods() throws Exception {

userList = twitter1.updateUserList(userList.getId(), "testpoint2", true, "description2");
assertEquals(userList, DataObjectFactory.createUserList(DataObjectFactory.getRawJSON(userList)));
// workarounding issue 2166
// http://code.google.com/p/twitter-api/issues/detail?id=2166
userList = twitter1.showUserList(userList.getId());
assertTrue(userList.isPublic());
assertNotNull(DataObjectFactory.getRawJSON(userList));
assertNotNull(userList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void main(String[] args) {
}
try {
Configuration conf = new ConfigurationBuilder().setMediaProviderAPIKey(args[0]).build();
ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.PLIXI);
ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.TWITPIC);
String url;
if (args.length >= 3) {
url = upload.upload(new File(args[1]), args[2]);
Expand Down

0 comments on commit 53d23f2

Please sign in to comment.