Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/yusuke/twitter4j
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke committed Jun 4, 2012
2 parents 6537262 + 7a6084e commit fa41314
Show file tree
Hide file tree
Showing 65 changed files with 855 additions and 1,234 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ atlassian-ide-plugin.xml
*.iml
*.ipr
*.iws
.idea/*
3 changes: 1 addition & 2 deletions package.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/sh
LANG=C

export HASH=`git log|head -n 1|sed "s/^commit //g"`

#export HASH=`git log|head -n 1|sed "s/^commit //g"`
sed -i '' "s/<url>http:\/\/oss.sonatype.org\/service\/local\/staging\/deploy\/maven2\//<url>file:\/Users\/yusukey\/maven2\//g" pom.xml
sed -i '' "s/<url>http:\/\/oss.sonatype.org\/service\/local\/staging\/deploy\/maven2\//<url>file:\/Users\/yusukey\/maven2\//g" twitter4j-core/pom.xml
sed -i '' "s/<url>http:\/\/oss.sonatype.org\/service\/local\/staging\/deploy\/maven2\//<url>file:\/Users\/yusukey\/maven2\//g" twitter4j-appengine/pom.xml
Expand Down
4 changes: 3 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Twittetr4J is a Twitter Aw binding library for the Java language licensed under Apache License 2.0.
Twitter4J is a Twitter API binding library for the Java language licensed under Apache License 2.0.

Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html

Expand All @@ -16,6 +16,7 @@ twitter4j-stream - Streaming API support : depending on twitter4j-core and twitt
Contributors
------------
Adam Samet <asamet at twitter.com> @damnitsamet
Adrian Petrescu <apetresc at gmail.com> @apetresc
Alan Gutierrez <alan at blogometer.com>
Alessandro Bahgat <ale.bahgat at gmail.com> @abahgat
Anton Evane <antonevane at gmail.com> @anton_evane
Expand All @@ -26,6 +27,7 @@ Cole Wen <wennnnke at gmail.com> @Pigwen
Dan Checkoway <dcheckoway at gmail.com>
Dong Wang <dong at twitter.com> @dongwang218
Eric Jensen <ej at twitter.com> @ej
Fiaz Hossain <fiaz at twitter.com> @fiazhossain
Hitoshi Kunimatsu <hkhumanoid at gmail.com>
Jacob S. Hoffman-Andrews <jsha at twitter.com> @j4cob
Jenny Loomis <jenny at rockmelt.com>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.zip.GZIPInputStream;
Expand Down Expand Up @@ -161,11 +162,11 @@ private void ensureResponseEvaluated() {
statusCode = r.getResponseCode();
headers = new HashMap<String, String>();
for (HTTPHeader h : r.getHeaders()) {
headers.put(h.getName(), h.getValue());
headers.put(h.getName().toLowerCase(Locale.ENGLISH), h.getValue());
}
byte[] content = r.getContent();
is = new ByteArrayInputStream(content);
if ("gzip".equals(headers.get("Content-Encoding"))) {
if ("gzip".equals(headers.get("content-encoding"))) {
// the response is gzipped
try {
is = new GZIPInputStream(is);
Expand Down
233 changes: 0 additions & 233 deletions twitter4j-async/src/main/java/twitter4j/AsyncTwitterImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,6 @@ public void invoke(List<TwitterListener> listeners) throws
});
}

/**
* {@inheritDoc}
*/
public void getPublicTimeline() {
getDispatcher().invokeLater(new AsyncTask(PUBLIC_TIMELINE, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
ResponseList<Status> statuses = twitter.getPublicTimeline();
for (TwitterListener listener : listeners) {
try {
listener.gotPublicTimeline(statuses);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -202,40 +185,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void getFriendsTimeline() {
getDispatcher().invokeLater(new AsyncTask(FRIENDS_TIMELINE, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
ResponseList<Status> statuses = twitter.getFriendsTimeline();
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsTimeline(statuses);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getFriendsTimeline(final Paging paging) {
getDispatcher().invokeLater(new AsyncTask(FRIENDS_TIMELINE, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
ResponseList<Status> statuses = twitter.getFriendsTimeline(paging);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsTimeline(statuses);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -882,108 +831,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void getFriendsStatuses(final long cursor) {
getDispatcher().invokeLater(new AsyncTask(FRIENDS_STATUSES, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getFriendsStatuses(cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsStatuses(users);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getFriendsStatuses(final String screenName, final long cursor) {
getDispatcher().invokeLater(new AsyncTask(FRIENDS_STATUSES, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getFriendsStatuses(screenName, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsStatuses(users);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getFriendsStatuses(final long userId, final long cursor) {
getDispatcher().invokeLater(new AsyncTask(FRIENDS_STATUSES, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getFriendsStatuses(userId, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsStatuses(users);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getFollowersStatuses(final long cursor) {
getDispatcher().invokeLater(new AsyncTask(FOLLOWERS_STATUSES, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getFollowersStatuses(cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFollowersStatuses(users);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getFollowersStatuses(final String screenName, final long cursor) {
getDispatcher().invokeLater(new AsyncTask(FOLLOWERS_STATUSES, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getFollowersStatuses(screenName, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFollowersStatuses(users);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getFollowersStatuses(final long userId, final long cursor) {
getDispatcher().invokeLater(new AsyncTask(FOLLOWERS_STATUSES, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getFollowersStatuses(userId, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFollowersStatuses(users);
} catch (Exception ignore) {
}
}
}
});
}

/*List Methods*/

/**
Expand Down Expand Up @@ -1054,13 +901,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void showUserList(final String listOwnerScreenName, final int listId) {
showUserList(listId);
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -1095,20 +935,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void getUserListStatuses(final String listOwnerScreenName, final int id, final Paging paging) {
getUserListStatuses(id, paging);
}

/**
* {@inheritDoc}
*/
public void getUserListStatuses(final long listOwnerId, final int id, final Paging paging) {
getUserListStatuses(id, paging);
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -1244,30 +1070,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {

/*List Members Methods*/

/**
* {@inheritDoc}
*/
public void getUserListMembers(final String listOwnerScreenName, final int listId, final long cursor) {
getDispatcher().invokeLater(new AsyncTask(LIST_MEMBERS, listeners) {
public void invoke(List<TwitterListener> listeners) throws TwitterException {
PagableResponseList<User> users = twitter.getUserListMembers(listOwnerScreenName, listId, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotUserListMembers(users);
} catch (Exception ignore) {
}
}
}
});
}

/**
* {@inheritDoc}
*/
public void getUserListMembers(final long listOwnerId, final int listId, final long cursor) {
getUserListMembers(listId, cursor);
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -1353,13 +1155,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void checkUserListMembership(final String listOwnerScreenName, final int listId, final long userId) {
showUserListMembership(listId, userId);
}

/**
* {@inheritDoc}
*/
Expand All @@ -1379,13 +1174,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {

/*List Subscribers Methods*/

/**
* {@inheritDoc}
*/
public void getUserListSubscribers(final String listOwnerScreenName, final int listId, final long cursor) {
getUserListSubscribers(listId, cursor);
}

/**
* {@inheritDoc}
*/
Expand All @@ -1403,13 +1191,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void subscribeUserList(final String listOwnerScreenName, final int listId) {
createUserListSubscription(listId);
}

/**
* {@inheritDoc}
*/
Expand All @@ -1427,13 +1208,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void unsubscribeUserList(final String listOwnerScreenName, final int listId) {
destroyUserListSubscription(listId);
}

/**
* {@inheritDoc}
*/
Expand All @@ -1451,13 +1225,6 @@ public void invoke(List<TwitterListener> listeners) throws TwitterException {
});
}

/**
* {@inheritDoc}
*/
public void checkUserListSubscription(final String listOwnerScreenName, final int listId, final long userId) {
showUserListSubscription(listId, userId);
}

/**
* {@inheritDoc}
*/
Expand Down
Loading

0 comments on commit fa41314

Please sign in to comment.