Permalink
Browse files

Updated API requests as per Twitter's Spring 2012 API deprecations an…

  • Loading branch information...
jjc1138
jjc1138 committed May 7, 2012
1 parent 9664975 commit ea59ffe0883db4a435532818dc0cb87d000f2198
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/net/jjc1138/android/twitter/Fetcher.java
@@ -151,10 +151,10 @@ public void onStart(Intent intent, int startId) {
private class FetcherThread extends Thread {
private final Charset FILE_CHARSET = Charset.forName("US-ASCII");
private static final String API_HOST = "twitter.com";
private static final String API_HOST = "api.twitter.com";
private static final int API_PORT = 443;
private static final String API_ROOT =
"https://" + API_HOST + ":" + API_PORT + "/";
"https://" + API_HOST + ":" + API_PORT + "/1/";
private static final int FIRST_RUN_NOTIFICATIONS = 3;
// This should be 200, but firing so many notifications causes a memory
@@ -579,7 +579,8 @@ void endElement() {
try {
if (filterType != FILTER_ALL) {
ent = download(client, consumer, new URI(API_ROOT +
"statuses/friends_timeline.xml" + "?" +
"statuses/home_timeline.xml" + "?" +
"include_rts=true&include_entities=true&" +
(firstRun ? "" :
("since_id=" + lastFriendStatus + "&")) +
"count=" + ((firstRun && filterType == FILTER_NONE) ?
@@ -623,12 +624,13 @@ void endElement() {
try {
ent = download(client, consumer, new URI(API_ROOT +
"direct_messages.xml" + "?" +
"include_entities=true&" +
"since_id=" + lastMessage));
} catch (final HttpErrorException e) {
if (e.getStatus() == HttpStatus.SC_FORBIDDEN) {
// This likely means that we have an old
// authentication token that doesn't allow DM
// access. Show a notification suggestion a
// access. Show a notification suggesting a
// reauthentication but allow the rest of the
// fetching process to continue.
showUnauthorizedNotification(true);
@@ -649,7 +651,8 @@ void endElement() {
if (prefs.getBoolean("replies", false)) {
ent = download(client, consumer, new URI(API_ROOT +
"statuses/replies.xml" + "?" +
"statuses/mentions.xml" + "?" +
"include_rts=true&include_entities=true&" +
"since_id=" + lastReply));
if (ent != null) {
reader.setContentHandler(new ReplyHandler());

0 comments on commit ea59ffe

Please sign in to comment.