Package me.memerator.api
Class MemeratorAPI
java.lang.Object
me.memerator.api.MemeratorAPI
public final class MemeratorAPI extends Object
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MemeratorAPI(String apiKey) -
Method Summary
Modifier and Type Method Description APIgetAPI()The API method used in the lib.MemegetMeme(String id)Gets a meme from the website by its Meme ID.ProfilegetProfile()Gets the currently logged in Profile.MemegetRandomMeme()Gets a random meme from the website.MemegetRandomMeme(Age max)Gets a random meme from the website up a specified Max Age.List<Meme>getRecentMemes()Get the 25 most recent memesList<Meme>getRecentMemes(int amount)Get the specified amount of recent memes, up to 25.List<Meme>getRecentMemes(int amount, int offset)Get the specified amount (up to 25) of recent memes at a specific offset.StatsgetStats()The site's stats as seen on https://memerator.me/statsStringgetToken()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 monthUsergetUser(String username)Gets a user by username or user ID.List<Meme>searchMemes(String query)Searches the website for a meme.voidsetToken(String newToken)Changes the tokenMemesubmitMeme(org.json.JSONObject meme)Submit a meme.
-
Field Details
-
Constructor Details
-
Method Details
-
getToken
- Returns:
- the token you entered
-
setToken
Changes the token- Parameters:
newToken- the new token
-
getAPI
The API method used in the lib. Has base URL already set.- Returns:
- the API
-
getMeme
Gets a meme from the website by its Meme ID.- Parameters:
id- the meme id- Returns:
- a Meme
-
getUser
Gets a user by username or user ID.- Parameters:
username- the username or ID.- Returns:
- a User
-
getProfile
Gets the currently logged in Profile. Inherits User- Returns:
- your Profile
-
getStats
The site's stats as seen on https://memerator.me/stats- Returns:
- a Stats object with the stats.
-
getRandomMeme
Gets a random meme from the website. Up to Teen by default.- Returns:
- a random meme
-
getRandomMeme
Gets a random meme from the website up a specified Max Age.- Parameters:
max- the maximum allowed age group.- Returns:
- a Meme.
-
searchMemes
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
Get the 25 most recent memes- Returns:
- a list of Memes
-
getRecentMemes
Get the specified amount of recent memes, up to 25.- Parameters:
amount- the amount of memes to get- Returns:
- the memes
-
getRecentMemes
Get the specified amount (up to 25) of recent memes at a specific offset.- Parameters:
amount- the amount of memes to getoffset- the offset, anywhere from 0 to the total amount of memes.- Returns:
- the memes
-
submitMeme
Submit a meme. See MemeBuilder class.- Parameters:
meme- a prepared Meme- Returns:
- the submitted Meme.
-
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
-