class Srcom::Api::Games
- Srcom::Api::Games
- Reference
- Object
Defined in:
srcr/apis/games.crConstant Summary
-
Log =
Srcom::Log.for("games")
Class Method Summary
-
.find_by(name : String? = nil, abbreviation : String? = nil, released : Int32? = nil, gametype : String? = nil, platform : String? = nil, region : String? = nil, genre : String? = nil, engine : String? = nil, developer : String? = nil, publisher : String? = nil, moderator : String? = nil, order_by : String? = nil, sort_direction : String? = nil, page_size : Int32 = 20) : PageIterator(Game)
Searches through all
Game
s using the given query parameters. - .find_by_bulk(name : String? = nil, abbreviation : String? = nil, released : Int32? = nil, gametype : String? = nil, platform : String? = nil, region : String? = nil, genre : String? = nil, engine : String? = nil, developer : String? = nil, publisher : String? = nil, moderator : String? = nil, order_by : String? = nil, sort_direction : String? = nil, page_size : Int32 = 1000) : PageIterator(BulkGame)
-
.find_by_id(id : String) : Srcom::Game
Finds a
Game
given its id or abbreviation. -
.get_categories(id : String, miscellaneous : Bool? = nil, order_by : String? = nil, sort_direction : String? = nil) : Array(Category)
Gets the categories belonging to the
Game
given by its id or abbreviation. -
.get_derived_games(id : String, name : String? = nil, abbreviation : String? = nil, released : Int32? = nil, gametype : String? = nil, platform : String? = nil, region : String? = nil, genre : String? = nil, engine : String? = nil, developer : String? = nil, publisher : String? = nil, moderator : String? = nil, order_by : String? = nil, sort_direction : String? = nil, page_size : Int32 = 200) : PageIterator(Game)
Searches through all the derived games of the
Game
given by its id or abbreviation using the given query parameters (and gets all derived games if none of the filters are used). - .get_levels(id : String, order_by : String? = nil, sort_direction : String? = nil) : Array(Level)
-
.get_records(id : String, top : Int32 = 3, scope : String? = nil, miscellaneous : Bool = true, skip_empty : Bool = false, page_size : Int32 = 200) : PageIterator(Leaderboard)
Gets every
Leaderboard
with the top N runs for theGame
given by its id or abbreviation, skipping over emptyLeaderboard
s if skip_empty istrue
. - .get_variables(id : String, order_by : String? = nil, sort_direction : String? = nil) : Array(Variable)
Class Method Detail
Searches through all Game
s using the given query parameters.
Searching by name performs a fuzzy search across game names and abbreviations.
Seaching by abbreviation performs an exact-match search.
Searching by released restricts to search to games released in that exact year.
All other search parameters must be an ID.
Possible values for order_by: "name.jap", "name.int", "abbreviation", "released", or "created", with the default being "name.int".
Possible values for sort_direction: "desc" or "asc", with the default being "asc".
NOTE Not specifying any filter probably leads to the request eventually crashing, leading to incomplete data.
If you need every game and can afford to lose some data per game, consider using .find_by_bulk
instead.
NOTE Since Game
s are very large objects this method defaults to a small page size
to give the request a reasonable speed.
Searches through all Game
s using the given query parameters, returning BulkGame
s,
which have a greatly reduced amount of data present.
Searching by name performs a fuzzy search across game names and abbreviations.
Seaching by abbreviation performs an exact-match search.
Searching by released restricts to search to games released in that exact year.
All other search parameters must be an ID.
Possible values for order_by: "name.jap", "name.int", "abbreviation", "released", or "created", with the default being "name.int".
Possible values for sort_direction: "desc" or "asc", with the default being "asc".
NOTE As opposed to .find_by
it is very much feasible to get every game on speedrun.com
with this method.
Gets the categories belonging to the Game
given by its id or abbreviation.
Possible values for order_by: "name", "miscellaneous", or "pos", with the default being "pos".
Possible values for sort_direction: "desc" or "asc", with the default being "asc".
NOTE If miscellaneous is set to true
only miscellaneous categories will be returned.
If it is set to false
only non-miscellaneous categories will be returned.
If it is set to nil
both miscellaneous and non-miscellaneous categories will be returned.
Searches through all the derived games of the Game
given by its id or abbreviation
using the given query parameters (and gets all derived games if none of the filters are used).
Searching by name performs a fuzzy search across game names and abbreviations.
Seaching by abbreviation performs an exact-match search.
Searching by released restricts to search to games released in that exact year.
All other search parameters must be an ID.
Possible values for order_by: "name.jap", "name.int", "abbreviation", "released", or "created", with the default being "name.int".
Possible values for sort_direction: "desc" or "asc", with the default being "asc".
NOTE Since Game
s typically don't have too many derived games it is very much feasible to get
everything here.
Gets the Level
s belonging to the Game
given by its id or abbreviation.
Possible values for order_by: "name" or "pos", with the default being "pos".
Possible values for sort_direction: "desc" or "asc", with the default being "asc".
Gets every Leaderboard
with the top N runs for the Game
given by its id or abbreviation,
skipping over empty Leaderboard
s if skip_empty is true
.
If miscellaneous is set to false
, only Leaderboard
s for non-miscellaneous categories will
be returned. If it is set to true
Leaderboard
s for both miscellaneous and non-miscellaneous
categories will be returned.
NOTE This can result in more than N runs per Leaderboard
, as ties can occur.
Gets the Variable
s belonging to the Game
given by its id or abbreviation.
Possible values for order_by: "name", "mandatory", "pos" or "user-defined", with the default being "pos".
Possible values for sort_direction: "desc" or "asc", with the default being "asc".