Skip to content
Browse files

TFJ-817 remove deprecated methods in REST APIs

  • Loading branch information...
1 parent 395f6a6 commit de42252ebbea360d51f55a7191627e37be370f28 @yusuke committed Mar 10, 2014
Showing with 64 additions and 747 deletions.
  1. +0 −5 twitter4j-appengine/src/main/java/twitter4j/LazyStatus.java
  2. +14 −24 twitter4j-appengine/src/main/java/twitter4j/LazyUser.java
  3. +0 −59 twitter4j-async/src/main/java/twitter4j/AsyncTwitterImpl.java
  4. +3 −42 twitter4j-async/src/main/java/twitter4j/api/ListsResourcesAsync.java
  5. +0 −24 twitter4j-async/src/main/java/twitter4j/api/TrendsResourcesAsync.java
  6. +1 −9 twitter4j-core/src/internal-json/java/twitter4j/QueryResultJSONImpl.java
  7. +0 −8 twitter4j-core/src/internal-json/java/twitter4j/RateLimitStatusJSONImpl.java
  8. +0 −7 twitter4j-core/src/internal-json/java/twitter4j/StatusJSONImpl.java
  9. +0 −8 twitter4j-core/src/internal-json/java/twitter4j/TrendJSONImpl.java
  10. +0 −22 twitter4j-core/src/internal-json/java/twitter4j/UserJSONImpl.java
  11. +0 −5 twitter4j-core/src/main/java/twitter4j/QueryResult.java
  12. +0 −9 twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java
  13. +0 −9 twitter4j-core/src/main/java/twitter4j/Status.java
  14. +0 −5 twitter4j-core/src/main/java/twitter4j/Trend.java
  15. +0 −84 twitter4j-core/src/main/java/twitter4j/TwitterImpl.java
  16. +17 −18 twitter4j-core/src/main/java/twitter4j/User.java
  17. +5 −61 twitter4j-core/src/main/java/twitter4j/api/ListsResources.java
  18. +0 −25 twitter4j-core/src/main/java/twitter4j/api/TimelinesResources.java
  19. +0 −30 twitter4j-core/src/main/java/twitter4j/api/TrendsResources.java
  20. +1 −13 twitter4j-core/src/test/java/twitter4j/StatusJSONImplTest.java
  21. +2 −2 twitter4j-core/src/test/java/twitter4j/TweetsResourcesTest.java
  22. +2 −2 twitter4j-core/src/test/java/twitter4j/TwitterTest.java
  23. +1 −1 twitter4j-examples/bin/list/addUserListMember.cmd
  24. +1 −1 twitter4j-examples/bin/list/addUserListMember.sh
  25. +9 −9 twitter4j-examples/bin/list/{addUserListMembers.cmd → createUserListMembers.cmd}
  26. +1 −1 twitter4j-examples/bin/list/{addUserListMembers.sh → createUserListMembers.sh}
  27. +3 −3 ...amples/src/main/java/twitter4j/examples/list/{AddUserListMember.java → CreateUserListMember.java}
  28. +3 −3 ...ples/src/main/java/twitter4j/examples/list/{AddUserListMembers.java → CreateUserListMembers.java}
  29. +0 −16 twitter4j-media-support/src/main/java/twitter4j/media/ImageUploadFactory.java
  30. +1 −1 twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java
  31. +0 −79 twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java
  32. +0 −75 twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java
  33. +0 −87 twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java
View
5 twitter4j-appengine/src/main/java/twitter4j/LazyStatus.java
@@ -265,11 +265,6 @@ public boolean isPossiblySensitive() {
}
@Override
- public String getIsoLanguageCode() {
- return getTarget().getIsoLanguageCode();
- }
-
- @Override
public String getLang() {
return getTarget().getLang();
}
View
38 twitter4j-appengine/src/main/java/twitter4j/LazyUser.java
@@ -19,7 +19,6 @@
import twitter4j.conf.Configuration;
import javax.annotation.Generated;
-import java.net.URL;
import java.util.Date;
/**
@@ -159,12 +158,6 @@ public String getOriginalProfileImageURL() {
return getTarget().getOriginalProfileImageURL();
}
- @Override
- public URL getProfileImageUrlHttps() {
- return getProfileImageUrlHttps();
- }
-
-
/**
* Returns the profile image url of the user, served over SSL
*
@@ -231,81 +224,78 @@ public Status getStatus() {
return getTarget().getStatus();
}
-
+ @Override
public String getProfileBackgroundColor() {
return getTarget().getProfileBackgroundColor();
}
-
+ @Override
public String getProfileTextColor() {
return getTarget().getProfileTextColor();
}
-
+ @Override
public String getProfileLinkColor() {
return getTarget().getProfileLinkColor();
}
-
+ @Override
public String getProfileSidebarFillColor() {
return getTarget().getProfileSidebarFillColor();
}
-
+ @Override
public String getProfileSidebarBorderColor() {
return getTarget().getProfileSidebarBorderColor();
}
-
+ @Override
public boolean isProfileUseBackgroundImage() {
return getTarget().isProfileUseBackgroundImage();
}
-
+ @Override
public boolean isShowAllInlineMedia() {
return getTarget().isShowAllInlineMedia();
}
-
+ @Override
public int getFriendsCount() {
return getTarget().getFriendsCount();
}
-
+ @Override
public Date getCreatedAt() {
return getTarget().getCreatedAt();
}
-
+ @Override
public int getFavouritesCount() {
return getTarget().getFavouritesCount();
}
-
+ @Override
public int getUtcOffset() {
return getTarget().getUtcOffset();
}
-
+ @Override
public String getTimeZone() {
return getTarget().getTimeZone();
}
@Override
- public String getProfileBackgroundImageUrl() {
- return getProfileBackgroundImageURL();
- }
-
-
public String getProfileBackgroundImageURL() {
return getTarget().getProfileBackgroundImageURL();
}
+ @Override
public String getProfileBackgroundImageUrlHttps() {
return getTarget().getProfileBackgroundImageUrlHttps();
}
+ @Override
public String getProfileBannerURL() {
return getTarget().getProfileBannerURL();
}
View
59 twitter4j-async/src/main/java/twitter4j/AsyncTwitterImpl.java
@@ -1922,11 +1922,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void deleteUserListMember(long listId, long userId) {
- destroyUserListMember(listId, userId);
- }
-
/**
* {@inheritDoc}
*/
@@ -1950,14 +1945,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
* {@inheritDoc}
*/
@Override
- public void deleteUserListMember(final long ownerId, final String slug, final long userId) {
- destroyUserListMember(ownerId, slug, userId);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void getUserListMemberships(final long cursor) {
getDispatcher().invokeLater(new AsyncTask(USER_LIST_MEMBERSHIPS, listeners) {
@Override
@@ -2199,11 +2186,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void addUserListMembers(long listId, long[] userIds) {
- createUserListMembers(listId, userIds);
- }
-
/**
* {@inheritDoc}
*/
@@ -2223,11 +2205,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void addUserListMembers(long ownerId, String slug, long[] userIds) {
- createUserListMembers(ownerId, slug, userIds);
- }
-
/**
* {@inheritDoc}
*/
@@ -2247,11 +2224,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void addUserListMembers(long listId, String[] screenNames) {
- createUserListMembers(listId, screenNames);
- }
-
/**
* {@inheritDoc}
*/
@@ -2271,11 +2243,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void addUserListMembers(long ownerId, String slug, String[] screenNames) {
- createUserListMembers(ownerId, slug, screenNames);
- }
-
/**
* {@inheritDoc}
*/
@@ -2371,11 +2338,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void addUserListMember(long listId, long userId) {
- createUserListMember(listId, userId);
- }
-
/**
* {@inheritDoc}
*/
@@ -2395,11 +2357,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}
- @Override
- public void addUserListMember(long ownerId, String slug, long userId) {
- createUserListMember(ownerId, slug, userId);
- }
-
/**
* {@inheritDoc}
*/
@@ -2732,14 +2689,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
* {@inheritDoc}
*/
@Override
- public void getLocationTrends(int woeid) {
- getPlaceTrends(woeid);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void getPlaceTrends(final int woeid) {
getDispatcher().invokeLater(new AsyncTask(PLACE_TRENDS, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
@@ -2777,14 +2726,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
* {@inheritDoc}
*/
@Override
- public void getAvailableTrends(GeoLocation location) {
- getClosestTrends(location);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void getClosestTrends(final GeoLocation location) {
getDispatcher().invokeLater(new AsyncTask(CLOSEST_TRENDS, listeners) {
@Override
View
45 twitter4j-async/src/main/java/twitter4j/api/ListsResourcesAsync.java
@@ -27,7 +27,7 @@
* <br>This method calls https://api.twitter.com/1.1/lists.json
*
* @param listOwnerScreenName The screen name of the list owner
-as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
+ * as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
* @see <a href="https://dev.twitter.com/docs/api/1.1/get/lists">GET lists | Twitter Developers</a>
* @since Twitter4J 2.1.1
*/
@@ -38,7 +38,7 @@
* <br>This method calls https://api.twitter.com/1.1/lists.json
*
* @param listOwnerUserId The id of the list owner
-returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
+ * returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
* @see <a href="https://dev.twitter.com/docs/api/1.1/get/lists">GET lists | Twitter Developers</a>
* @since Twitter4J 2.2.3
*/
@@ -79,11 +79,6 @@
void destroyUserListMember(long listId, long userId);
/**
- * @deprecated use {@link #destroyUserListMember(long, long)} instead
- */
- void deleteUserListMember(long listId, long userId);
-
- /**
* Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
* <br>This method calls https://api.twitter.com/1.1/lists/members/destroy.json
*
@@ -96,11 +91,6 @@
void destroyUserListMember(long ownerId, String slug, long userId);
/**
- * @deprecated use {@link #destroyUserListMember(long, long)} instead
- */
- void deleteUserListMember(long ownerId, String slug, long userId);
-
- /**
* List the lists the authenticating user has been added to.
* <br>This method calls https://api.twitter.com/1.1/lists/memberships.json
*
@@ -258,11 +248,6 @@
void createUserListMembers(long listId, long[] userIds);
/**
- * @deprecated use {@link #createUserListMembers(long, long[])} instead
- */
- void addUserListMembers(long listId, long[] userIds);
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -275,11 +260,6 @@
void createUserListMembers(long ownerId, String slug, long[] userIds);
/**
- * @deprecated use {@link #createUserListMembers(long, long[])} instead
- */
- void addUserListMembers(long ownerId, String slug, long[] userIds);
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -291,11 +271,6 @@
void createUserListMembers(long listId, String[] screenNames);
/**
- * @deprecated use {@link #createUserListMembers(long, String[])} instead
- */
- void addUserListMembers(long listId, String[] screenNames);
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -308,11 +283,6 @@
void createUserListMembers(long ownerId, String slug, String[] screenNames);
/**
- * @deprecated use {@link #createUserListMembers(long, String[])} instead
- */
- void addUserListMembers(long ownerId, String slug, String[] screenNames);
-
- /**
* Check if a user is a member of the specified list.<br>
* <br>This method calls https://api.twitter.com/1.1/lists/members/show.json
*
@@ -371,11 +341,6 @@
void createUserListMember(long listId, long userId);
/**
- * @deprecated use {@link #createUserListMember(long, long)} instead
- */
- void addUserListMember(long listId, long userId);
-
- /**
* Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create.json
*
@@ -388,11 +353,6 @@
void createUserListMember(long ownerId, String slug, long userId);
/**
- * @deprecated use {@link #createUserListMember(long, String, long)} instead
- */
- void addUserListMember(long ownerId, String slug, long userId);
-
- /**
* Deletes the specified list. Must be owned by the authenticated user.
* <br>This method calls https://api.twitter.com/1.1/lists/destroy.json
*
@@ -439,6 +399,7 @@
* @since Twitter4J 3.0.0
*/
void updateUserList(long ownerId, String slug, String newListName, boolean isPublicList, String newDescription);
+
/**
* Creates a new list for the authenticated user. Accounts are limited to 20 lists.
* <br>This method calls https://api.twitter.com/1.1/lists/create.json
View
24 twitter4j-async/src/main/java/twitter4j/api/TrendsResourcesAsync.java
@@ -33,19 +33,6 @@
*
* @param woeid <a href="http://developer.yahoo.com/geo/geoplanet/">The Yahoo! Where On Earth ID</a> of the location to return trending information for. Global information is available by using 1 as the WOEID.
* @see <a href="https://dev.twitter.com/docs/api/1.1/get/trends/place">GET trends/place | Twitter Developers</a>
- * @since Twitter4J 2.1.1
- * @deprecated use {@link #getPlaceTrends(int)} instead
- */
- void getLocationTrends(int woeid);
-
- /**
- * Returns the top 10 trending topics for a specific WOEID, if trending information is available for it.<br>
- * The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on <a href="http://search.twitter.com/">Twitter Search</a>, and the Twitter Search URL.<br>
- * This information is cached for 5 minutes. Requesting more frequently than that will not return any more data, and will count against your rate limit usage.<br>
- * <br>This method calls https://api.twitter.com/1.1/trends/place.json
- *
- * @param woeid <a href="http://developer.yahoo.com/geo/geoplanet/">The Yahoo! Where On Earth ID</a> of the location to return trending information for. Global information is available by using 1 as the WOEID.
- * @see <a href="https://dev.twitter.com/docs/api/1.1/get/trends/place">GET trends/place | Twitter Developers</a>
* @since Twitter4J 3.0.2
*/
void getPlaceTrends(int woeid);
@@ -60,17 +47,6 @@
void getAvailableTrends();
/**
- * Retrieves the sorted locations that Twitter has trending topic information for. The response is an array of &quot;locations&quot; that encode the location's WOEID (a <a href="http://developer.yahoo.com/geo/geoplanet/">Yahoo! Where On Earth ID</a>) and some other human-readable information such as a canonical name and country the location belongs in.
- * <br>This method calls https://api.twitter.com/1/trends/available.json
- *
- * @param location the available trend locations will be sorted by distance to the lat and long passed in. The sort is nearest to furthest.
- * @see <a href="https://dev.twitter.com/docs/api/1/get/trends/available">GET trends/available | Twitter Developers</a>
- * @since Twitter4J 2.1.1
- * @deprecated use {@link #getClosestTrends(twitter4j.GeoLocation)} instead
- */
- void getAvailableTrends(GeoLocation location);
-
- /**
* Returns the locations that Twitter has trending topic information for, closest to a specified location.<br>
* The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.<br>
* A WOEID is a <a href="http://developer.yahoo.com/geo/geoplanet/">Yahoo! Where On Earth ID</a>.
View
10 twitter4j-core/src/internal-json/java/twitter4j/QueryResultJSONImpl.java
@@ -108,14 +108,6 @@ public long getMaxId() {
return maxId;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public String getRefreshUrl() {
- return getRefreshURL();
- }
-
@Override
public String getRefreshURL() {
return refreshUrl;
@@ -191,7 +183,7 @@ public boolean equals(Object o) {
if (count != that.getCount()) return false;
if (sinceId != that.getSinceId()) return false;
if (!query.equals(that.getQuery())) return false;
- if (refreshUrl != null ? !refreshUrl.equals(that.getRefreshUrl()) : that.getRefreshUrl() != null)
+ if (refreshUrl != null ? !refreshUrl.equals(that.getRefreshURL()) : that.getRefreshURL() != null)
return false;
if (tweets != null ? !tweets.equals(that.getTweets()) : that.getTweets() != null)
return false;
View
8 twitter4j-core/src/internal-json/java/twitter4j/RateLimitStatusJSONImpl.java
@@ -128,14 +128,6 @@ public int getRemaining() {
* {@inheritDoc}
*/
@Override
- public int getRemainingHits() {
- return getRemaining();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public int getLimit() {
return limit;
}
View
7 twitter4j-core/src/internal-json/java/twitter4j/StatusJSONImpl.java
@@ -435,13 +435,6 @@ public boolean isPossiblySensitive() {
/**
* {@inheritDoc}
*/
- public String getIsoLanguageCode() {
- return isoLanguageCode;
- }
-
- /**
- * {@inheritDoc}
- */
public Scopes getScopes() {
return scopes;
}
View
8 twitter4j-core/src/internal-json/java/twitter4j/TrendJSONImpl.java
@@ -53,14 +53,6 @@ public String getName() {
* {@inheritDoc}
*/
@Override
- public String getUrl() {
- return getURL();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public String getURL() {
return url;
}
View
22 twitter4j-core/src/internal-json/java/twitter4j/UserJSONImpl.java
@@ -18,8 +18,6 @@
import twitter4j.conf.Configuration;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.Date;
/**
@@ -273,18 +271,6 @@ private String toResizedURL(String originalURL, String sizeSuffix) {
return null;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public URL getProfileImageUrlHttps() {
- try {
- return new URL(profileImageUrlHttps);
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
@Override
public String getProfileImageURLHttps() {
return profileImageUrlHttps;
@@ -435,14 +421,6 @@ public String getTimeZone() {
* {@inheritDoc}
*/
@Override
- public String getProfileBackgroundImageUrl() {
- return getProfileBackgroundImageURL();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public String getProfileBackgroundImageURL() {
return profileBackgroundImageUrl;
}
View
5 twitter4j-core/src/main/java/twitter4j/QueryResult.java
@@ -28,11 +28,6 @@
long getMaxId();
- /**
- * @deprecated use {@link #getRefreshURL()} instead
- */
- String getRefreshUrl();
-
String getRefreshURL();
int getCount();
View
9 twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java
@@ -33,15 +33,6 @@
int getRemaining();
/**
- * Returns the remaining number of API requests available.<br>
- * This value is identical to the &quot;X-Rate-Limit-Remaining&quot; response header.
- *
- * @return the remaining number of API requests available
- * @deprecated use {@link #getRemaining()} instead
- */
- int getRemainingHits();
-
- /**
* Returns the current limit in effect<br>
* This value is identical to the &quot;X-Rate-Limit-Limit&quot; response header.
*
View
9 twitter4j-core/src/main/java/twitter4j/Status.java
@@ -188,15 +188,6 @@
boolean isPossiblySensitive();
/**
- * Returns the iso language code set by the Twitter API (best-effort). This field is available only with the search api.
- * It is suggested to use {@link #getLang()}
- *
- * @return two-letter iso language code
- * @deprecated use {@link #getLang()} instead
- */
- String getIsoLanguageCode();
-
- /**
* Returns the lang of the status text if available.
*
* @return two-letter iso language code
View
5 twitter4j-core/src/main/java/twitter4j/Trend.java
@@ -26,11 +26,6 @@
public interface Trend extends java.io.Serializable {
String getName();
- /**
- * @deprecated use {@link #getURL()} instead
- */
- String getUrl();
-
String getURL();
String getQuery();
View
84 twitter4j-core/src/main/java/twitter4j/TwitterImpl.java
@@ -79,14 +79,6 @@
* {@inheritDoc}
*/
@Override
- public ResponseList<Status> getMentions() throws TwitterException {
- return getMentionsTimeline();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public ResponseList<Status> getMentionsTimeline() throws TwitterException {
return factory.createStatusList(get(conf.getRestBaseURL() + "statuses/mentions_timeline.json"));
}
@@ -95,20 +87,11 @@
* {@inheritDoc}
*/
@Override
- public ResponseList<Status> getMentions(Paging paging) throws TwitterException {
- return getMentionsTimeline(paging);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public ResponseList<Status> getMentionsTimeline(Paging paging) throws TwitterException {
return factory.createStatusList(get(conf.getRestBaseURL()
+ "statuses/mentions_timeline.json", paging.asPostParameterArray()));
}
-
/**
* {@inheritDoc}
*/
@@ -1130,11 +1113,6 @@ public UserList destroyUserListMember(long listId, long userId) throws TwitterEx
));
}
- @Override
- public UserList deleteUserListMember(long listId, long userId) throws TwitterException {
- return destroyUserListMember(listId, userId);
- }
-
/**
* {@inheritDoc}
*/
@@ -1166,11 +1144,6 @@ public UserList destroyUserListMember(String ownerScreenName, String slug,
, new HttpParameter("slug", slug), new HttpParameter("user_id", userId)}));
}
- @Override
- public UserList deleteUserListMember(long ownerId, String slug, long userId) throws TwitterException {
- return destroyUserListMember(ownerId, slug, userId);
- }
-
/**
* {@inheritDoc}
*/
@@ -1206,17 +1179,6 @@ public UserList destroyUserListMembers(String ownerScreenName, String slug, Stri
* {@inheritDoc}
*/
@Override
- public UserList destroyUserListMembers(String ownerScreenName, String slug, long[] userIds) throws TwitterException {
- return factory.createAUserList(post(conf.getRestBaseURL() +
- "lists/members/destroy_all.json", new HttpParameter[]{new HttpParameter("owner_screen_name", ownerScreenName),
- new HttpParameter("slug", slug),
- new HttpParameter("user_id", StringUtil.join(userIds))}));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public PagableResponseList<UserList> getUserListMemberships(long cursor) throws TwitterException {
return factory.createPagableUserListList(get(conf.getRestBaseURL() + "lists/memberships.json?cursor=" + cursor));
@@ -1384,11 +1346,6 @@ public UserList createUserListMembers(long listId, long[] userIds) throws Twitte
));
}
- @Override
- public UserList addUserListMembers(long listId, long[] userIds) throws TwitterException {
- return createUserListMembers(listId, userIds);
- }
-
/**
* {@inheritDoc}
*/
@@ -1412,11 +1369,6 @@ public UserList createUserListMembers(String ownerScreenName, String slug,
));
}
- @Override
- public UserList addUserListMembers(long ownerId, String slug, long[] userIds) throws TwitterException {
- return createUserListMembers(ownerId, slug, userIds);
- }
-
/**
* {@inheritDoc}
*/
@@ -1430,11 +1382,6 @@ public UserList createUserListMembers(long listId, String[] screenNames) throws
));
}
- @Override
- public UserList addUserListMembers(long listId, String[] screenNames) throws TwitterException {
- return createUserListMembers(listId, screenNames);
- }
-
/**
* {@inheritDoc}
*/
@@ -1460,11 +1407,6 @@ public UserList createUserListMembers(String ownerScreenName, String slug,
));
}
- @Override
- public UserList addUserListMembers(long ownerId, String slug, String[] screenNames) throws TwitterException {
- return createUserListMembers(ownerId, slug, screenNames);
- }
-
/**
* {@inheritDoc}
*/
@@ -1532,11 +1474,6 @@ public UserList createUserListMember(long listId, long userId) throws TwitterExc
, new HttpParameter("list_id", listId)}));
}
- @Override
- public UserList addUserListMember(long listId, long userId) throws TwitterException {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
/**
* {@inheritDoc}
*/
@@ -1558,11 +1495,6 @@ public UserList createUserListMember(String ownerScreenName, String slug,
, new HttpParameter("owner_screen_name", ownerScreenName), new HttpParameter("slug", slug)}));
}
- @Override
- public UserList addUserListMember(long ownerId, String slug, long userId) throws TwitterException {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
/**
* {@inheritDoc}
*/
@@ -1804,14 +1736,6 @@ public Place createPlace(String name, String containedWithin, String token, GeoL
* {@inheritDoc}
*/
@Override
- public Trends getLocationTrends(int woeid) throws TwitterException {
- return getPlaceTrends(woeid);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public Trends getPlaceTrends(int woeid) throws TwitterException {
return factory.createTrends(get(conf.getRestBaseURL()
+ "trends/place.json?id=" + woeid));
@@ -1830,14 +1754,6 @@ public Trends getPlaceTrends(int woeid) throws TwitterException {
* {@inheritDoc}
*/
@Override
- public ResponseList<Location> getAvailableTrends(GeoLocation location) throws TwitterException {
- return getClosestTrends(location);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public ResponseList<Location> getClosestTrends(GeoLocation location) throws TwitterException {
return factory.createLocationList(get(conf.getRestBaseURL()
+ "trends/closest.json",
View
35 twitter4j-core/src/main/java/twitter4j/User.java
@@ -16,7 +16,6 @@
package twitter4j;
-import java.net.URL;
import java.util.Date;
/**
@@ -74,20 +73,19 @@
* @return the profile image url of the user
*/
String getProfileImageURL();
+
String getBiggerProfileImageURL();
+
String getMiniProfileImageURL();
+
String getOriginalProfileImageURL();
- /**
- * Returns the profile image url of the user, served over SSL
- *
- * @return the profile image url of the user, served over SSL
- * @deprecated use {@link #getProfileImageURL()} instead
- */
- URL getProfileImageUrlHttps();
String getProfileImageURLHttps();
+
String getBiggerProfileImageURLHttps();
+
String getMiniProfileImageURLHttps();
+
String getOriginalProfileImageURLHttps();
/**
@@ -145,10 +143,6 @@
String getTimeZone();
- /**
- * @deprecated use {@link #getProfileImageURL()} instead
- */
- String getProfileBackgroundImageUrl();
String getProfileBackgroundImageURL();
String getProfileBackgroundImageUrlHttps();
@@ -157,22 +151,27 @@
* @since Twitter4J 3.0.0
*/
String getProfileBannerURL();
+
/**
* @since Twitter4J 3.0.0
*/
String getProfileBannerRetinaURL();
+
/**
* @since Twitter4J 3.0.0
*/
String getProfileBannerIPadURL();
+
/**
* @since Twitter4J 3.0.0
*/
String getProfileBannerIPadRetinaURL();
+
/**
* @since Twitter4J 3.0.0
*/
String getProfileBannerMobileURL();
+
/**
* @since Twitter4J 3.0.0
*/
@@ -225,22 +224,22 @@
* @since Twitter4J 2.1.4
*/
boolean isFollowRequestSent();
-
+
/**
* Returns URL entities for user description.
- *
+ *
* @return URL entities for user description
* @since Twitter4J 3.0.3
*/
URLEntity[] getDescriptionURLEntities();
-
+
/**
* Returns URL entity for user's URL.
- *
+ *
* @return URL entity for user's URL.
* @since Twitter4J 3.0.3
*/
URLEntity getURLEntity();
-
-
+
+
}
View
66 twitter4j-core/src/main/java/twitter4j/api/ListsResources.java
@@ -27,7 +27,7 @@
* <br>This method calls https://api.twitter.com/1.1/lists.json
*
* @param listOwnerScreenName The screen name of the list owner
- as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
+ * as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
* @return the list of lists
* @throws TwitterException when Twitter service or network is unavailable
* @see <a href="https://dev.twitter.com/docs/api/1.1/get/lists/list">GET lists/list | Twitter Developers</a>
@@ -111,7 +111,7 @@
* Removes the specified members from the list. The authenticated user must be the list's owner to remove members from the list.
* <br>This method calls https://api.twitter.com/1.1/lists/members/destroy.json
*
- * @param listId The id of the list.
+ * @param listId The id of the list.
* @param screenName The screen name of the member you wish to remove from the list.
* @return the updated list
* @throws TwitterException when Twitter service or network is unavailable
@@ -124,7 +124,7 @@
* Removes the specified members from the list. The authenticated user must be the list's owner to remove members from the list.
* <br>This method calls https://api.twitter.com/1.1/lists/members/destroy_all.json
*
- * @param listId The id of the list.
+ * @param listId The id of the list.
* @param screenNames The screen names of the members you wish to remove from the list.
* @return the updated list
* @throws TwitterException when Twitter service or network is unavailable
@@ -137,7 +137,7 @@
* Removes the specified members from the list. The authenticated user must be the list's owner to remove members from the list.
* <br>This method calls https://api.twitter.com/1.1/lists/members/destroy_all.json
*
- * @param listId The id of the list.
+ * @param listId The id of the list.
* @param userIds The array of ids of the user to add as member of the list. up to 100 are allowed in a single request.
* @return the updated list
* @throws TwitterException when Twitter service or network is unavailable
@@ -152,7 +152,7 @@
*
* @param ownerScreenName The screen name of the user who owns the list being requested by a slug.
* @param slug slug of the list
- * @param screenNames The screen names of the members you wish to remove from the list.
+ * @param screenNames The screen names of the members you wish to remove from the list.
* @return the updated list
* @throws TwitterException when Twitter service or network is unavailable
* @see <a href="https://dev.twitter.com/docs/api/1.1/post/lists/members/destroy_all">POST lists/members/destroy_all | Twitter Developers</a>
@@ -161,25 +161,6 @@
UserList destroyUserListMembers(String ownerScreenName, String slug, String[] screenNames) throws TwitterException;
/**
- * Removes the specified members from the list. The authenticated user must be the list's owner to remove members from the list.
- * <br>This method calls https://api.twitter.com/1.1/lists/members/destroy_all.json
- *
- * @param ownerScreenName The screen name of the user who owns the list being requested by a slug.
- * @param slug slug of the list
- * @param userIds The array of ids of the user to add as member of the list. up to 100 are allowed in a single request.
- * @return the updated list
- * @throws TwitterException when Twitter service or network is unavailable
- * @see <a href="https://dev.twitter.com/docs/api/1.1/post/lists/members/destroy_all">POST lists/members/destroy_all | Twitter Developers</a>
- * @since Twitter4J 3.0.6
- */
- UserList destroyUserListMembers(String ownerScreenName, String slug, long[] userIds) throws TwitterException;
-
- /**
- * @deprecated use {@link #destroyUserList(long)} instead
- */
- UserList deleteUserListMember(long listId, long userId) throws TwitterException;
-
- /**
* Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
* <br>This method calls https://api.twitter.com/1.1/lists/members/destroy.json
*
@@ -194,12 +175,6 @@
UserList destroyUserListMember(long ownerId, String slug, long userId) throws TwitterException;
/**
- * @deprecated use {@link #destroyUserListMember(long, String, long)} instead
- */
- UserList deleteUserListMember(long ownerId, String slug, long userId) throws TwitterException;
-
-
- /**
* Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
* <br>This method calls https://api.twitter.com/1.1/lists/members/destroy.json
*
@@ -461,11 +436,6 @@
UserList createUserListMembers(long listId, long[] userIds) throws TwitterException;
/**
- * @deprecated use {@link #createUserListMembers(long, long[])} instead
- */
- UserList addUserListMembers(long listId, long[] userIds) throws TwitterException;
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -479,12 +449,6 @@
UserList createUserListMembers(long ownerId, String slug, long[] userIds) throws TwitterException;
/**
- * @deprecated use {@link #createUserListMembers(long, long[])} instead
- */
- UserList addUserListMembers(long ownerId, String slug, long[] userIds) throws TwitterException;
-
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -509,11 +473,6 @@
UserList createUserListMembers(long listId, String[] screenNames) throws TwitterException;
/**
- * @deprecated use {@link #createUserListMembers(long, String[])} instead
- */
- UserList addUserListMembers(long listId, String[] screenNames) throws TwitterException;
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -526,11 +485,6 @@
UserList createUserListMembers(long ownerId, String slug, String[] screenNames) throws TwitterException;
/**
- * @deprecated use {@link #createUserListMembers(long, String[])} instead
- */
- UserList addUserListMembers(long ownerId, String slug, String[] screenNames) throws TwitterException;
-
- /**
* Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create_all.json
*
@@ -644,11 +598,6 @@
UserList createUserListMember(long listId, long userId) throws TwitterException;
/**
- * @deprecated use {@link #createUserListMember(long, long)}} instead
- */
- UserList addUserListMember(long listId, long userId) throws TwitterException;
-
- /**
* Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create.json
*
@@ -663,11 +612,6 @@
UserList createUserListMember(long ownerId, String slug, long userId) throws TwitterException;
/**
- * @deprecated use {@link #createUserListMember(long, String, long)} instead
- */
- UserList addUserListMember(long ownerId, String slug, long userId) throws TwitterException;
-
- /**
* Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.
* <br>This method calls https://api.twitter.com/1.1/lists/members/create.json
*
View
25 twitter4j-core/src/main/java/twitter4j/api/TimelinesResources.java
@@ -26,18 +26,6 @@
*/
public interface TimelinesResources {
/**
- * Returns the 20 most recent mentions (status containing @username) for the authenticating user.
- * <br>This method calls https://api.twitter.com/1.1/statuses/mentions
- *
- * @return the 20 most recent replies
- * @throws TwitterException when Twitter service or network is unavailable
- * @see <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/mentions">GET statuses/mentions | Twitter Developers</a>
- * @since Twitter4J 2.0.1
- * @deprecated use {@link #getMentionsTimeline()} instead
- */
- ResponseList<Status> getMentions() throws TwitterException;
-
- /**
* Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user.<br>
* The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.<br>
* This method can only return up to 800 tweets.<br>
@@ -52,19 +40,6 @@
ResponseList<Status> getMentionsTimeline() throws TwitterException;
/**
- * Returns the 20 most recent mentions (status containing @username) for the authenticating user.
- * <br>This method calls https://api.twitter.com/1.1/statuses/mentions
- *
- * @param paging controls pagination. Supports since_id, max_id, count and page parameters.
- * @return the 20 most recent replies
- * @throws TwitterException when Twitter service or network is unavailable
- * @see <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/mentions">GET statuses/mentions | Twitter Developers</a>
- * @since Twitter4J 2.0.1
- * @deprecated use {@link #getMentionsTimeline(twitter4j.Paging)} instead
- */
- ResponseList<Status> getMentions(Paging paging) throws TwitterException;
-
- /**
* Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user.<br>
* The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.<br>
* This method can only return up to 800 tweets.<br>
View
30 twitter4j-core/src/main/java/twitter4j/api/TrendsResources.java
@@ -19,8 +19,6 @@
import twitter4j.*;
-import java.util.Date;
-
/**
* @author Yusuke Yamamoto - yusuke at mac.com
* @since Twitter4J 2.1.3
@@ -36,21 +34,6 @@
* @return trends
* @throws twitter4j.TwitterException when Twitter service or network is unavailable
* @see <a href="https://dev.twitter.com/docs/api/1.1/get/trends/place">GET trends/place | Twitter Developers</a>
- * @since Twitter4J 2.1.1
- * @deprecated use {@link #getPlaceTrends(int)} instead
- */
- Trends getLocationTrends(int woeid) throws TwitterException;
-
- /**
- * Returns the top 10 trending topics for a specific WOEID, if trending information is available for it.<br>
- * The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on <a href="http://search.twitter.com/">Twitter Search</a>, and the Twitter Search URL.<br>
- * This information is cached for 5 minutes. Requesting more frequently than that will not return any more data, and will count against your rate limit usage.<br>
- * <br>This method calls https://api.twitter.com/1.1/trends/place.json
- *
- * @param woeid <a href="http://developer.yahoo.com/geo/geoplanet/">The Yahoo! Where On Earth ID</a> of the location to return trending information for. Global information is available by using 1 as the WOEID.
- * @return trends
- * @throws twitter4j.TwitterException when Twitter service or network is unavailable
- * @see <a href="https://dev.twitter.com/docs/api/1.1/get/trends/place">GET trends/place | Twitter Developers</a>
* @since Twitter4J 3.0.2
*/
Trends getPlaceTrends(int woeid) throws TwitterException;
@@ -67,19 +50,6 @@
ResponseList<Location> getAvailableTrends() throws TwitterException;
/**
- * Returns the sorted locations that Twitter has trending topic information for. The response is an array of &quot;locations&quot; that encode the location's WOEID (a <a href="http://developer.yahoo.com/geo/geoplanet/">Yahoo! Where On Earth ID</a>) and some other human-readable information such as a canonical name and country the location belongs in.
- * <br>This method calls https://api.twitter.com/1/trends/available.json
- *
- * @param location the available trend locations will be sorted by distance to the lat and long passed in. The sort is nearest to furthest.
- * @return the locations
- * @throws twitter4j.TwitterException when Twitter service or network is unavailable
- * @see <a href="https://dev.twitter.com/docs/api/1/get/trends/available">GET trends/available | Twitter Developers</a>
- * @since Twitter4J 2.1.1
- * @deprecated use {@link #getClosestTrends(twitter4j.GeoLocation)} instead
- */
- ResponseList<Location> getAvailableTrends(GeoLocation location) throws TwitterException;
-
- /**
* Returns the locations that Twitter has trending topic information for, closest to a specified location.<br>
* The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.<br>
* A WOEID is a <a href="http://developer.yahoo.com/geo/geoplanet/">Yahoo! Where On Earth ID</a>.
View
14 twitter4j-core/src/test/java/twitter4j/StatusJSONImplTest.java
@@ -7,25 +7,13 @@
*/
public class StatusJSONImplTest extends TestCase {
- public void testGetIsoLanguageCode() throws Exception {
- // given
- String json = "{\"contributors\":null,\"text\":\"@belbeer After four years of study in radiotechnical college I realized that the language skills are much more useful than fucking math.\",\"geo\":null,\"retweeted\":false,\"in_reply_to_screen_name\":\"belbeer\",\"truncated\":false,\"entities\":{\"urls\":[],\"hashtags\":[],\"user_mentions\":[{\"id\":74987101,\"name\":\"belbeer\",\"indices\":[0,8],\"screen_name\":\"belbeer\",\"id_str\":\"74987101\"}]},\"in_reply_to_status_id_str\":\"297250346298904576\",\"id\":297265580690513920,\"source\":\"web\",\"in_reply_to_user_id_str\":\"74987101\",\"favorited\":false,\"in_reply_to_status_id\":297250346298904576,\"retweet_count\":0,\"created_at\":\"Fri Feb 01 08:50:12 +0000 2013\",\"in_reply_to_user_id\":74987101,\"id_str\":\"297265580690513920\",\"place\":null,\"user\":{\"location\":\"where am i?\",\"default_profile\":true,\"profile_background_tile\":false,\"statuses_count\":1100,\"lang\":\"ru\",\"profile_link_color\":\"0084B4\",\"id\":386522307,\"following\":null,\"protected\":false,\"favourites_count\":13,\"profile_text_color\":\"333333\",\"description\":\"160 ????????\",\"verified\":false,\"contributors_enabled\":false,\"profile_sidebar_border_color\":\"C0DEED\",\"name\":\"???????? ??????\",\"profile_background_color\":\"C0DEED\",\"created_at\":\"Fri Oct 07 12:44:01 +0000 2011\",\"default_profile_image\":false,\"followers_count\":46,\"profile_image_url_https\":\"https://si0.twimg.com/profile_images/2785804589/b0b355c75d3f77658fc94ec05a7bb5af_normal.jpeg\",\"geo_enabled\":true,\"profile_background_image_url\":\"http://a0.twimg.com/images/themes/theme1/bg.png\",\"profile_background_image_url_https\":\"https://si0.twimg.com/images/themes/theme1/bg.png\",\"follow_request_sent\":null,\"entities\":{\"description\":{\"urls\":[]},\"url\":{\"urls\":[{\"expanded_url\":null,\"indices\":[0,29],\"url\":\"http://goodfoto.blogspot.com/\"}]}},\"url\":\"http://goodfoto.blogspot.com/\",\"utc_offset\":7200,\"time_zone\":\"Athens\",\"notifications\":null,\"profile_use_background_image\":true,\"friends_count\":46,\"profile_sidebar_fill_color\":\"DDEEF6\",\"screen_name\":\"LonliLokli2000\",\"id_str\":\"386522307\",\"profile_image_url\":\"http://a0.twimg.com/profile_images/2785804589/b0b355c75d3f77658fc94ec05a7bb5af_normal.jpeg\",\"listed_count\":1,\"is_translator\":false},\"coordinates\":null,\"metadata\":{\"result_type\":\"recent\",\"iso_language_code\":\"en\"}}";
- Status status = TwitterObjectFactory.createStatus(json);
-
- // when
- String lang = status.getIsoLanguageCode();
-
- // then
- assertEquals("en", lang);
- }
-
public void testReturningNullForMissingIsoLanguageCode() throws Exception {
// given
String json = "{\"contributors\":null,\"text\":\"@belbeer After four years of study in radiotechnical college I realized that the language skills are much more useful than fucking math.\",\"geo\":null,\"retweeted\":false,\"in_reply_to_screen_name\":\"belbeer\",\"truncated\":false,\"entities\":{\"urls\":[],\"hashtags\":[],\"user_mentions\":[{\"id\":74987101,\"name\":\"belbeer\",\"indices\":[0,8],\"screen_name\":\"belbeer\",\"id_str\":\"74987101\"}]},\"in_reply_to_status_id_str\":\"297250346298904576\",\"id\":297265580690513920,\"source\":\"web\",\"in_reply_to_user_id_str\":\"74987101\",\"favorited\":false,\"in_reply_to_status_id\":297250346298904576,\"retweet_count\":0,\"created_at\":\"Fri Feb 01 08:50:12 +0000 2013\",\"in_reply_to_user_id\":74987101,\"id_str\":\"297265580690513920\",\"place\":null,\"user\":{\"location\":\"where am i?\",\"default_profile\":true,\"profile_background_tile\":false,\"statuses_count\":1100,\"lang\":\"ru\",\"profile_link_color\":\"0084B4\",\"id\":386522307,\"following\":null,\"protected\":false,\"favourites_count\":13,\"profile_text_color\":\"333333\",\"description\":\"160 ????????\",\"verified\":false,\"contributors_enabled\":false,\"profile_sidebar_border_color\":\"C0DEED\",\"name\":\"???????? ??????\",\"profile_background_color\":\"C0DEED\",\"created_at\":\"Fri Oct 07 12:44:01 +0000 2011\",\"default_profile_image\":false,\"followers_count\":46,\"profile_image_url_https\":\"https://si0.twimg.com/profile_images/2785804589/b0b355c75d3f77658fc94ec05a7bb5af_normal.jpeg\",\"geo_enabled\":true,\"profile_background_image_url\":\"http://a0.twimg.com/images/themes/theme1/bg.png\",\"profile_background_image_url_https\":\"https://si0.twimg.com/images/themes/theme1/bg.png\",\"follow_request_sent\":null,\"entities\":{\"description\":{\"urls\":[]},\"url\":{\"urls\":[{\"expanded_url\":null,\"indices\":[0,29],\"url\":\"http://goodfoto.blogspot.com/\"}]}},\"url\":\"http://goodfoto.blogspot.com/\",\"utc_offset\":7200,\"time_zone\":\"Athens\",\"notifications\":null,\"profile_use_background_image\":true,\"friends_count\":46,\"profile_sidebar_fill_color\":\"DDEEF6\",\"screen_name\":\"LonliLokli2000\",\"id_str\":\"386522307\",\"profile_image_url\":\"http://a0.twimg.com/profile_images/2785804589/b0b355c75d3f77658fc94ec05a7bb5af_normal.jpeg\",\"listed_count\":1,\"is_translator\":false},\"coordinates\":null}";
Status status = TwitterObjectFactory.createStatus(json);
// when
- String lang = status.getIsoLanguageCode();
+ String lang = status.getLang();
// then
assertNull(lang);
View
4 twitter4j-core/src/test/java/twitter4j/TweetsResourcesTest.java
@@ -44,7 +44,7 @@ public void testShowStatus() throws Exception {
status = twitter2.showStatus(1000l);
assertNotNull(TwitterObjectFactory.getRawJSON(status));
assertEquals(status, TwitterObjectFactory.createStatus(TwitterObjectFactory.getRawJSON(status)));
- assertEquals("en", status.getIsoLanguageCode());
+ assertEquals("en", status.getLang());
assertEquals(52, status.getUser().getId());
Status status2 = twitter1.showStatus(1000l);
assertEquals(52, status2.getUser().getId());
@@ -53,7 +53,7 @@ public void testShowStatus() throws Exception {
assertEquals(status2, TwitterObjectFactory.createStatus(TwitterObjectFactory.getRawJSON(status2)));
status2 = twitter1.showStatus(999383469l);
- assertEquals("et", status2.getIsoLanguageCode());
+ assertEquals("et", status2.getLang());
assertNotNull(TwitterObjectFactory.getRawJSON(status2));
assertEquals(status2, TwitterObjectFactory.createStatus(TwitterObjectFactory.getRawJSON(status2)));
assertEquals("01010100 01110010 01101001 01110101 01101101 01110000 01101000 <3", status2.getText());
View
4 twitter4j-core/src/test/java/twitter4j/TwitterTest.java
@@ -92,11 +92,11 @@ public void onRateLimitReached(RateLimitStatusEvent event) {
// the listener doesn't implement serializable and deserialized form should not be equal to the original object
assertDeserializedFormIsNotEqual(twitter1);
- twitter1.getMentions();
+ twitter1.getMentionsTimeline();
assertTrue(accountLimitStatusAcquired);
assertFalse(ipLimitStatusAcquired);
RateLimitStatus previous = this.rateLimitStatus;
- twitter1.getMentions();
+ twitter1.getMentionsTimeline();
assertTrue(accountLimitStatusAcquired);
assertFalse(ipLimitStatusAcquired);
assertTrue(previous.getRemaining() > this.rateLimitStatus.getRemaining());
View
2 twitter4j-examples/bin/list/addUserListMember.cmd
@@ -4,6 +4,6 @@ cd ..
call setEnv.cmd
echo on
-"%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.AddUserListMember %*
+"%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.CreateUserListMember %*
ENDLOCAL
View
2 twitter4j-examples/bin/list/addUserListMember.sh
@@ -2,6 +2,6 @@
cd ..
. ./setEnv.sh
-RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.AddUserListMember"
+RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.CreateUserListMember"
echo $RUN_CMD ${1+"$@"}
exec $RUN_CMD ${1+"$@"}
View
18 ...-examples/bin/list/addUserListMembers.cmd → ...amples/bin/list/createUserListMembers.cmd
@@ -1,9 +1,9 @@
-echo off
-SETLOCAL enabledelayedexpansion
-cd ..
-call setEnv.cmd
-
-echo on
-"%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.AddUserListMembers %*
-
-ENDLOCAL
+echo off
+SETLOCAL enabledelayedexpansion
+cd ..
+call setEnv.cmd
+
+echo on
+"%JAVA_HOME%\bin\java" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.list.CreateUserListMembers %*
+
+ENDLOCAL
View
2 ...j-examples/bin/list/addUserListMembers.sh → ...xamples/bin/list/createUserListMembers.sh
@@ -2,6 +2,6 @@
cd ..
. ./setEnv.sh
-RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.AddUserListMembers"
+RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.list.CreateUserListMembers"
echo $RUN_CMD ${1+"$@"}
exec $RUN_CMD ${1+"$@"}
View
6 ...er4j/examples/list/AddUserListMember.java → ...j/examples/list/CreateUserListMember.java
@@ -25,15 +25,15 @@
*
* @author Yusuke Yamamoto - yusuke at mac.com
*/
-public final class AddUserListMember {
+public final class CreateUserListMember {
/**
- * Usage: java twitter4j.examples.list.AddUserListMember [list id] [user id]
+ * Usage: java twitter4j.examples.list.CreateUserListMember [list id] [user id]
*
* @param args message
*/
public static void main(String[] args) {
if (args.length < 2) {
- System.out.println("Usage: java twitter4j.examples.list.AddUserListMember [list id] [user id]");
+ System.out.println("Usage: java twitter4j.examples.list.CreateUserListMember [list id] [user id]");
System.exit(-1);
}
try {
View
6 ...r4j/examples/list/AddUserListMembers.java → .../examples/list/CreateUserListMembers.java
@@ -25,15 +25,15 @@
*
* @author Yusuke Yamamoto - yusuke at mac.com
*/
-public final class AddUserListMembers {
+public final class CreateUserListMembers {
/**
- * Usage: java twitter4j.examples.list.AddUserListMembers [list id] [screen name[,screen name..]]
+ * Usage: java twitter4j.examples.list.CreateUserListMembers [list id] [screen name[,screen name..]]
*
* @param args message
*/
public static void main(String[] args) {
if (args.length < 2) {
- System.out.println("Usage: java twitter4j.examples.list.AddUserListMembers [list id] [screen name[,screen name..]]");
+ System.out.println("Usage: java twitter4j.examples.list.CreateUserListMembers [list id] [screen name[,screen name..]]");
System.exit(-1);
}
try {
View
16 twitter4j-media-support/src/main/java/twitter4j/media/ImageUploadFactory.java
@@ -49,22 +49,14 @@ public ImageUploadFactory(Configuration conf) {
defaultMediaProvider = TWITTER;
} else if ("imgly".equals(mediaProvider) || "img_ly".equals(mediaProvider)) {
defaultMediaProvider = IMG_LY;
- } else if ("plixi".equals(mediaProvider)) {
- defaultMediaProvider = PLIXI;
- } else if ("lockerz".equals(mediaProvider)) {
- defaultMediaProvider = LOCKERZ;
} else if ("twipple".equals(mediaProvider)) {
defaultMediaProvider = TWIPPLE;
- } else if ("twitgoo".equals(mediaProvider)) {
- defaultMediaProvider = TWITGOO;
} else if ("twitpic".equals(mediaProvider)) {
defaultMediaProvider = TWITPIC;
} else if ("yfrog".equals(mediaProvider)) {
defaultMediaProvider = YFROG;
} else if ("mobypicture".equals(mediaProvider)) {
defaultMediaProvider = MOBYPICTURE;
- } else if ("posterous".equals(mediaProvider)) {
- defaultMediaProvider = POSTEROUS;
} else {
throw new IllegalArgumentException("unsupported media provider:" + mediaProvider);
}
@@ -120,22 +112,14 @@ public ImageUpload getInstance(MediaProvider mediaProvider, Authorization author
return new TwitterUpload(conf, oauth);
} else if (mediaProvider == IMG_LY) {
return new ImgLyUpload(conf, oauth);
- } else if (mediaProvider == PLIXI) {
- return new PlixiUpload(conf, apiKey, oauth);
- } else if (mediaProvider == LOCKERZ) {
- return new PlixiUpload(conf, apiKey, oauth);
} else if (mediaProvider == TWIPPLE) {
return new TwippleUpload(conf, oauth);
- } else if (mediaProvider == TWITGOO) {
- return new TwitgooUpload(conf, oauth);
} else if (mediaProvider == TWITPIC) {
return new TwitpicUpload(conf, apiKey, oauth);
} else if (mediaProvider == YFROG) {
return new YFrogUpload(conf, oauth);
} else if (mediaProvider == MOBYPICTURE) {
return new MobypictureUpload(conf, apiKey, oauth);
- } else if (mediaProvider == POSTEROUS) {
- return new PosterousUpload(conf, oauth);
} else {
throw new AssertionError("Unknown provider");
}
View
2 twitter4j-media-support/src/main/java/twitter4j/media/MediaProvider.java
@@ -21,5 +21,5 @@
* @since Twitter4J 2.1.8
*/
public enum MediaProvider {
- TWITTER, IMG_LY, @Deprecated PLIXI, @Deprecated LOCKERZ, TWIPPLE, @Deprecated TWITGOO, TWITPIC, YFROG, MOBYPICTURE, @Deprecated POSTEROUS
+ TWITTER, IMG_LY, TWIPPLE, TWITPIC, YFROG, MOBYPICTURE
}
View
79 twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java
@@ -1,79 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.media;
-
-import twitter4j.HttpParameter;
-import twitter4j.TwitterException;
-import twitter4j.auth.OAuthAuthorization;
-import twitter4j.conf.Configuration;
-
-/**
- * @author Takao Nakaguchi - takao.nakaguchi at gmail.com
- * @author withgod - noname at withgod.jp
- * @since Twitter4J 2.1.8
- * @deprecated They no longer privde API to publish pictures
- */
-class PlixiUpload extends AbstractImageUploadImpl {
-// Described at http://groups.google.com/group/tweetphoto/web/multipart-form-data-upload
-// and http://groups.google.com/group/tweetphoto/web/oauth-echo
-
- public PlixiUpload(Configuration conf, String apiKey, OAuthAuthorization oauth) {
- super(conf, apiKey, oauth);
- logger.warn("Lockerz is no longer providing API.");
- this.uploadUrl = "http://api.plixi.com/api/upload.aspx";//"https://api.plixi.com/api/tpapi.svc/upload2";
- }
-
- @Override
- protected String postUpload() throws TwitterException {
- int statusCode = httpResponse.getStatusCode();
- if (statusCode != 201)
- throw new TwitterException("Plixi image upload returned invalid status code", httpResponse);
-
- String response = httpResponse.asString();
-
- if (response.contains("<Error><ErrorCode>")) {
- String error = response.substring(response.indexOf("<ErrorCode>") + "<ErrorCode>".length(), response.lastIndexOf("</ErrorCode>"));
- throw new TwitterException("Plixi image upload failed with this error message: " + error, httpResponse);
- }
- if (response.contains("<Status>OK</Status>")) {
- return response.substring(response.indexOf("<MediaUrl>") + "<MediaUrl>".length(), response.indexOf("</MediaUrl>"));
- }
-
- throw new TwitterException("Unknown Plixi response", httpResponse);
- }
-
- @Override
- protected void preUpload() throws TwitterException {
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
-
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
- headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
-
- if (null == apiKey) {
- throw new IllegalStateException("No API Key for Plixi specified. put media.providerAPIKey in twitter4j.properties.");
- }
- HttpParameter[] params = {
- new HttpParameter("api_key", apiKey),
- this.image
- };
- if (message != null) {
- params = appendHttpParameters(new HttpParameter[]{
- this.message}, params);
- }
- this.postParameter = params;
- }
-}
View
75 twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java
@@ -1,75 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.media;
-
-import twitter4j.HttpParameter;
-import twitter4j.JSONException;
-import twitter4j.JSONObject;
-import twitter4j.TwitterException;
-import twitter4j.auth.OAuthAuthorization;
-import twitter4j.conf.Configuration;
-
-/**
- * @author withgod - noname at withgod.jp
- * @see <a href="http://apidocs.posterous.com/pages/twitter">Posterous API Documentation</a>
- * @since Twitter4J 2.1.12
- * @deprecated they're gone http://www.posterous.com/
- */
-class PosterousUpload extends AbstractImageUploadImpl {
-
- public PosterousUpload(Configuration conf, OAuthAuthorization oauth) {
- super(conf, oauth);
- logger.warn("Posterous is gone ever after.");
- }
-
-
- @Override
- protected String postUpload() throws TwitterException {
- int statusCode = httpResponse.getStatusCode();
- if (statusCode != 200)
- throw new TwitterException("Posterous image upload returned invalid status code", httpResponse);
-
- String response = httpResponse.asString();
-
- try {
- JSONObject json = new JSONObject(response);
- if (!json.isNull("url"))
- return json.getString("url");
- } catch (JSONException e) {
- throw new TwitterException("Invalid Posterous response: " + response, e);
- }
-
- throw new TwitterException("Unknown Posterous response", httpResponse);
- }
-
- @Override
- protected void preUpload() throws TwitterException {
- uploadUrl = "http://posterous.com/api2/upload.json";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1);
-
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1);
- headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
-
- HttpParameter[] params = {this.image};
- if (message != null) {
- params = appendHttpParameters(new HttpParameter[]{
- this.message
- }, params);
- }
- this.postParameter = params;
- }
-}
View
87 twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java
@@ -1,87 +0,0 @@
-/*
- * Copyright 2007 Yusuke Yamamoto
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package twitter4j.media;
-
-import twitter4j.HttpParameter;
-import twitter4j.TwitterException;
-import twitter4j.auth.OAuthAuthorization;
-import twitter4j.conf.Configuration;
-
-/**
- * @author Takao Nakaguchi - takao.nakaguchi at gmail.com
- * @author withgod - noname at withgod.jp
- * @since Twitter4J 2.1.8
- * @deprecated They're gone. TFJ-814
- */
-class TwitgooUpload extends AbstractImageUploadImpl {
-
- public TwitgooUpload(Configuration conf, OAuthAuthorization oauth) {
- super(conf, oauth);
- }
-
-
- @Override
- protected String postUpload() throws TwitterException {
- int statusCode = httpResponse.getStatusCode();
- if (statusCode != 200)
- throw new TwitterException("Twitgoo image upload returned invalid status code", httpResponse);
-
- String response = httpResponse.asString();
- if (response.contains("<rsp status=\"ok\">")) {
- String h = "<mediaurl>";
- int i = response.indexOf(h);
- if (i != -1) {
- int j = response.indexOf("</mediaurl>", i + h.length());
- if (j != -1) {
- return response.substring(i + h.length(), j);
- }
- }
- } else if (response.contains("<rsp status=\"fail\">")) {
- String h = "msg=\"";
- int i = response.indexOf(h);
- if (i != -1) {
- int j = response.indexOf("\"", i + h.length());
- if (j != -1) {
- String msg = response.substring(i + h.length(), j);
- throw new TwitterException("Invalid Twitgoo response: " + msg);
- }
- }
- }
-
- throw new TwitterException("Unknown Twitgoo response", httpResponse);
- }
-
- @Override
- protected void preUpload() throws TwitterException {
- uploadUrl = "http://twitgoo.com/api/uploadAndPost";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1);
-
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1);
- headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
-
- HttpParameter[] params = {
- new HttpParameter("no_twitter_post", "1"),
- this.image
- };
- if (message != null) {
- params = appendHttpParameters(new HttpParameter[]{
- this.message
- }, params);
- }
- this.postParameter = params;
- }
-}

0 comments on commit de42252

Please sign in to comment.
Something went wrong with that request. Please try again.