blob: df6053ff558303d2934476d06dfc3f2e515bd8c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package mining;
import java.io.IOException;
import org.json.JSONObject;
/**
* Performs an API request.
*
* @author Peter Wu
*/
public interface Requester {
/**
* Performs an API request for a resource, for example
* "statuses/mentions_timeline" (note that there is no version or leading
* slash).
*
* @param resource The REST resource.
* @return A JSON object resulting from the request.
* @throws java.io.IOException on error fetching the resource.
*/
public JSONObject getJSON(String resource) throws IOException;
// TODO: retry (after sleeping) on ratelimit
}
|