Package com.patreonshout.patreon
Class PostGetter
java.lang.Object
com.patreonshout.patreon.PostGetter
public class PostGetter
extends java.lang.Object
Gets Posts from a Patreon content creator in
JSONArray
form-
Field Summary
-
Constructor Summary
Constructors Constructor Description PostGetter(java.lang.String token)
InitializePatreonAPI
and set PatreonAPI token -
Method Summary
Modifier and Type Method Description org.json.simple.JSONArray
getPosts()
Returns aJSONArray
with all the content creator's postsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
apiClient
private com.patreon.PatreonAPI apiClientapiClient is the object used to connect to Patreon's API -
token
private java.lang.String tokenPatreon API token needed to provide authorization to get Patreon content creator information
-
-
Constructor Details
-
PostGetter
public PostGetter(java.lang.String token)InitializePatreonAPI
and set PatreonAPI token- Parameters:
token
- the Patreon API token needed to provide authorization to get Patreon content creator information
-
-
Method Details
-
getPosts
public org.json.simple.JSONArray getPosts() throws java.io.IOException, org.json.simple.parser.ParseExceptionReturns aJSONArray
with all the content creator's posts- Returns:
- a
JSONArray
of content creator posts - Throws:
java.io.IOException
- in case the HTTP connection failsorg.json.simple.parser.ParseException
- in case the scanner fails
-