diff options
author | Maurice Laveaux <m.laveaux@student.tue.nl> | 2014-05-22 09:02:50 +0200 |
---|---|---|
committer | Maurice Laveaux <m.laveaux@student.tue.nl> | 2014-05-22 09:02:50 +0200 |
commit | 0c07b1d1a83ab20b4c753c40ea8048f73b3e5745 (patch) | |
tree | 47db3723c190bdb264a144b500fb6f41b2f1559f /src/io/OAuthRequester.java | |
parent | 4e0fcd499a14cfc621b256f4a28f0cafe22bfc8c (diff) | |
download | TwitterDataAnalytics-0c07b1d1a83ab20b4c753c40ea8048f73b3e5745.tar.gz |
Changed Request response to a new Response class.
* Response contains the JsonElement, tickrate, reset and leftover
data.
* Removed getJsonRelaxed, because it was not used elsewhere.
Diffstat (limited to 'src/io/OAuthRequester.java')
-rw-r--r-- | src/io/OAuthRequester.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/io/OAuthRequester.java b/src/io/OAuthRequester.java index c3538ee..3621186 100644 --- a/src/io/OAuthRequester.java +++ b/src/io/OAuthRequester.java @@ -134,12 +134,9 @@ public class OAuthRequester extends AbstractRequester { @Override public boolean isValid() throws IOException { - if (consumer.getToken() == null) { - return false; - } // NOTE: this actually contributes to the ratelimit (12/minute) // TODO: find alternative that does not hit the ratelimit - JSONObject obj = getJSONRelax("application/rate_limit_status"); - return !obj.has("errors"); + Response obj = getJSON("application/rate_limit_status"); + return !obj.getResp().getAsJsonObject().has("errors"); } } |