Class MemeratorAPI

java.lang.Object
me.memerator.api.MemeratorAPI

public final class MemeratorAPI
extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getToken

      public String getToken()
      Returns:
      the token you entered
    • setToken

      public void setToken​(String newToken)
      Changes the token
      Parameters:
      newToken - the new token
    • getAPI

      public API getAPI()
      The API method used in the lib. Has base URL already set.
      Returns:
      the API
    • getMeme

      public Meme getMeme​(String id)
      Gets a meme from the website by its Meme ID.
      Parameters:
      id - the meme id
      Returns:
      a Meme
    • getUser

      public User getUser​(String username)
      Gets a user by username or user ID.
      Parameters:
      username - the username or ID.
      Returns:
      a User
    • getProfile

      public Profile getProfile()
      Gets the currently logged in Profile. Inherits User
      Returns:
      your Profile
    • getStats

      public Stats getStats()
      The site's stats as seen on https://memerator.me/stats
      Returns:
      a Stats object with the stats.
    • getRandomMeme

      public Meme getRandomMeme()
      Gets a random meme from the website. Up to Teen by default.
      Returns:
      a random meme
    • getRandomMeme

      public Meme getRandomMeme​(Age max)
      Gets a random meme from the website up a specified Max Age.
      Parameters:
      max - the maximum allowed age group.
      Returns:
      a Meme.
    • searchMemes

      public List<Meme> searchMemes​(String query) throws UnsupportedEncodingException
      Searches the website for a meme. As seen on https://memerator.me/search
      Parameters:
      query - the search query
      Returns:
      an Array of Memes. Can be empty, never null.
      Throws:
      UnsupportedEncodingException - this will never be thrown.
    • getRecentMemes

      public List<Meme> getRecentMemes()
      Get the 25 most recent memes
      Returns:
      a list of Memes
    • getRecentMemes

      public List<Meme> getRecentMemes​(int amount)
      Get the specified amount of recent memes, up to 25.
      Parameters:
      amount - the amount of memes to get
      Returns:
      the memes
    • getRecentMemes

      public List<Meme> getRecentMemes​(int amount, int offset)
      Get the specified amount (up to 25) of recent memes at a specific offset.
      Parameters:
      amount - the amount of memes to get
      offset - the offset, anywhere from 0 to the total amount of memes.
      Returns:
      the memes
    • submitMeme

      public Meme submitMeme​(org.json.JSONObject meme)
      Submit a meme. See MemeBuilder class.
      Parameters:
      meme - a prepared Meme
      Returns:
      the submitted Meme.
    • getTopMemers

      public Map<String,​List<TopMemer>> getTopMemers()
      Returns a list of hashmap with 3 items Each item is time frame as key and a list of top memers as the value 1d = Top for the past day 7d = Top for the past week 1mo = Top for the past month
      Returns:
      the top memers