Class: DBio
- Inherits:
-
Object
- Object
- DBio
- Defined in:
- lib/dbio.rb
Overview
All DBio functionality, whether extended or just here.
Defined Under Namespace
Classes: DiscordConnection, DiscordProfile, SearchResult, User, UserConnection
Instance Method Summary collapse
-
#initialize ⇒ DBio
constructor
Initialize the API.
-
#search(user) ⇒ Array<SearchResult>
Searches for a user This API is not publicly documented and can break at any time.
-
#top_likes ⇒ Array<SearchResult>
Returns the users by most likes.
-
#user(id) ⇒ User
Load a user.
Constructor Details
#initialize ⇒ DBio
Initialize the API. Not much here really.
8 |
# File 'lib/dbio.rb', line 8 def initialize; end |
Instance Method Details
#search(user) ⇒ Array<SearchResult>
Searches for a user This API is not publicly documented and can break at any time. Be careful!
31 32 33 |
# File 'lib/dbio.rb', line 31 def search(user) JSON.parse(RestClient.get("https://api.discord.bio/user/search/#{user}"))['payload'].map { |e| SearchResult.new(e) } end |
#top_likes ⇒ Array<SearchResult>
Returns the users by most likes. Their data is short, so it's not really worth storing a lot of data
24 25 26 |
# File 'lib/dbio.rb', line 24 def top_likes JSON.parse(RestClient.get("https://api.discord.bio/topLikes"))['payload'].map { |e| SearchResult.new(e) } end |