diff options
-rw-r--r-- | src/io/OAuthRequester.java | 2 | ||||
-rw-r--r-- | src/main/Main.java | 25 | ||||
-rw-r--r-- | src/provider/ProfileListener.java | 16 | ||||
-rw-r--r-- | src/provider/ResultListener.java | 23 | ||||
-rw-r--r-- | src/provider/TweetListener.java | 16 |
5 files changed, 24 insertions, 58 deletions
diff --git a/src/io/OAuthRequester.java b/src/io/OAuthRequester.java index 7646e3f..b4ac481 100644 --- a/src/io/OAuthRequester.java +++ b/src/io/OAuthRequester.java @@ -117,7 +117,7 @@ public class OAuthRequester extends AbstractRequester { } // NOTE: this actually contributes to the ratelimit (12/minute) // TODO: find alternative that does not hit the ratelimit - JSONObject obj = getJSONRelax("1/application/rate_limit_status"); + JSONObject obj = getJSONRelax("application/rate_limit_status"); return !obj.has("errors"); } } diff --git a/src/main/Main.java b/src/main/Main.java index 656e1ee..05429fb 100644 --- a/src/main/Main.java +++ b/src/main/Main.java @@ -200,28 +200,3 @@ public class Main { } } } - -/** - * OLD main - * public static void main(String[] args) throws IOException { - * TwitterApi api = TwitterApi.getAppOnly(); - - // create the object that queues and executes the commands. - CommandQueue queue = new CommandQueue(); - - // create the object that parses the arguments. - CommandParser parser = new CommandParser(queue, api); - - // parse the input arguments and create the command. - parser.parse(args); - - Scanner input = new Scanner(System.in); - - // parse the receiving data through the input - while (true) { - queue.executeAll(); - - // parse new input. - parser.parse(scanner.nextLine()); - } - */ diff --git a/src/provider/ProfileListener.java b/src/provider/ProfileListener.java deleted file mode 100644 index 4232001..0000000 --- a/src/provider/ProfileListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package provider; - -import org.json.JSONObject; - -/** - * Callback for new user profiles. - */ -public interface ProfileListener { - - /** - * This method is called when a new profile is provided. - * - * @param obj A single JSON object - */ - void profileGenerated(JSONObject obj); -} diff --git a/src/provider/ResultListener.java b/src/provider/ResultListener.java new file mode 100644 index 0000000..87bc786 --- /dev/null +++ b/src/provider/ResultListener.java @@ -0,0 +1,23 @@ +package provider; + +import org.json.JSONObject; + +/** + * Callback when a new tweet or user is received. + */ +public interface ResultListener { + + /** + * This method is called when a new tweet is provided. + * + * @param obj A single JSON object. + */ + public void tweetGenerated(JSONObject obj); + + /** + * This method is called when a new profile is provided. + * + * @param obj A single JSON object + */ + public void profileGenerated(JSONObject obj); +} diff --git a/src/provider/TweetListener.java b/src/provider/TweetListener.java deleted file mode 100644 index 5b1df0e..0000000 --- a/src/provider/TweetListener.java +++ /dev/null @@ -1,16 +0,0 @@ - package provider; - -import org.json.JSONObject; - -/** - * Callback when a new tweet is received. - */ -public interface TweetListener { - - /** - * This method is called when a new tweet is provided. - * - * @param obj A single JSON object. - */ - public void tweetGenerated(JSONObject obj); -} |