ornato-t / flairchange_bot-api

A data aggregation API for r/PoliticalCompassMemes

Home Page:https://flairchangebot-api.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flairchange_bot-api

An API aggregating data coming from r/PoliticalCompassMemes, gathered and processed by u/flairchange_bot.

Endpoints

Each endpoint can be accessed by opening the url linked on the sidebar. The API supports the following endpoints:

GET /u/<name>

With <name> being a Reddit username.

Returns a JSON object containing a user's flair history, including the date of each flair change.
Flair change data is stored in the flairs array. Each object represents a change: user name changed its flair to flairs[i].flair on flairs[i].dateAdded.

Returns a 400 error for a badly formulated request or 404 for a missing entry in the database.

Example

{
"name": "flairchange_bot",
"flairs": [{
"flair": "AuthCenter",
"dateAdded": 2022-04-26T22:29:54.489Z"
}, {
"flair": "GreyCentrist",
"dateAdded": 2022-06-01T00:00:00.000Z"
}]
}

Note: this is just an example, flairchange_bot has clearly never changed his flair, as that would make him cringe.

GET /leaderboard

Returns an array containing the top 50 flair changers of r/PoliticalCompassMemes. Can be followed by a parameter to limit/expand the returned results.

Example

[{
"name": "flair-checking-bot",
"flairs": [],
"size": 300,
"position": 1
}, ...]

GET /leaderboard/<N>

With <N> being a natural number.

Returns an array containing the top N flair changers of r/PoliticalCompassMemes. Doesn't accept a negative parameter or a parameter greater than 500.

The returned values are the same as /leaderboard.

GET /stats

Returns a JSON object containing the all the flair statistics of r/PoliticalCompassMemes. It is composed of key-value pairs, composed by a flair and the number of users having such flair. This dataset includes the recently added special "chad" flairs as well as older flairs that are no longer available.

Example

{
"AuthCenter": "32",
"Chad AuthCenter": "1",
"Centrist": "20",
"GreyCentrist": "40"
}

GET /stats/filter

Returns the same data as /stats but filters out the special flairs (such as "chad", "transhumanist", "grand inquisitor"). Users with filtered flairs are counted as members of their original, non special flair.

Example

{
"AuthCenter": "33",
"Centrist": "20",
"GreyCentrist": "40"
}

GET /stats/noAlts

Returns the same data as /stats but filters out the alternative flairs (such as "PurpleLibright" or "GreyCentrist"). Users with filtered flairs are counted as members of their original, non alternative flair.

Example

{
"AuthCenter": "32",
"Chad AuthCenter": "1",
"Centrist": "60"
}

GET /stats/filter/noAlts

Combines the two previously introduced endpoints. Returns the same data as /stats but filters out both the special and the alternative flairs. Users with filtered flairs are counted as members of their original, non special, non alternative flair.

Example

{
"AuthCenter": "33",
"Centrist": "60"
}

Access

Access to the API is free and open to all. If you are interested in additional endpoints write a Reddit message to u/Nerd02.

About

A data aggregation API for r/PoliticalCompassMemes

https://flairchangebot-api.herokuapp.com

License:GNU General Public License v3.0


Languages

Language:JavaScript 88.7%Language:HTML 11.0%Language:Procfile 0.3%