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

    Fields
    Modifier and Type Field Description
    private com.patreon.PatreonAPI apiClient
    apiClient is the object used to connect to Patreon's API
    private java.lang.String token
    Patreon API token needed to provide authorization to get Patreon content creator information
  • Constructor Summary

    Constructors
    Constructor Description
    PostGetter​(java.lang.String token)
    Initialize PatreonAPI and set PatreonAPI token
  • Method Summary

    Modifier and Type Method Description
    org.json.simple.JSONArray getPosts()
    Returns a JSONArray with all the content creator's posts

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • apiClient

      private com.patreon.PatreonAPI apiClient
      apiClient is the object used to connect to Patreon's API
    • token

      private java.lang.String token
      Patreon API token needed to provide authorization to get Patreon content creator information
  • Constructor Details

    • PostGetter

      public PostGetter​(java.lang.String token)
      Initialize PatreonAPI 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.ParseException
      Returns a JSONArray with all the content creator's posts
      Returns:
      a JSONArray of content creator posts
      Throws:
      java.io.IOException - in case the HTTP connection fails
      org.json.simple.parser.ParseException - in case the scanner fails