dbiorb 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dbio.rb +4 -4
- data/lib/dbio/user.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cae1aa9e8607edfa6f1ff02b5056eaab95b1b66af9896e1105244cf9e5a19c3c
|
4
|
+
data.tar.gz: '0793b113d72388a91d1cdad4bb3f23bba928831075d1d568c4bb515bfba0e42b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5522919bb6d1eecb37d64ffc4a31e8611584a216c6d713b0e5c7f807ff9ee2b7a9c3afc74307d324a661b2384cd92547f3439fe47d2fa10a6337a18d42612f07
|
7
|
+
data.tar.gz: 3b5cdb68e2fdf06e01272e0fd597d564cd4130e173b4b308535f869f694004c03279a40069f73fbda1e617c55df69b16f78e14a4cb9292c5ce2029e54223892d
|
data/lib/dbio.rb
CHANGED
@@ -17,16 +17,16 @@ class DBio
|
|
17
17
|
User.new(user['payload'])
|
18
18
|
end
|
19
19
|
|
20
|
-
# Returns the
|
20
|
+
# Returns the users by most likes.
|
21
21
|
# Their data is short, so it's not really worth storing a lot of data
|
22
22
|
# @see [SearchResult#user]
|
23
23
|
# @return [Array<SearchResult>] the response
|
24
|
-
def
|
25
|
-
JSON.parse(RestClient.get("https://api.discord.bio/v1/
|
24
|
+
def top_likes
|
25
|
+
JSON.parse(RestClient.get("https://api.discord.bio/v1/topLikes"))['payload'].map { |e| SearchResult.new(e) }
|
26
26
|
end
|
27
27
|
|
28
28
|
# Searches for a user
|
29
|
-
# This API is not
|
29
|
+
# This API is not publicly documented and can break at any time. Be careful!
|
30
30
|
# @return [Array<SearchResult>] the response
|
31
31
|
def search(user)
|
32
32
|
JSON.parse(RestClient.get("https://api.discord.bio/v1/user/search/#{user}"))['payload'].map { |e| SearchResult.new(e) }
|
data/lib/dbio/user.rb
CHANGED
@@ -32,11 +32,16 @@ class DBio::User
|
|
32
32
|
@user['user_id'].to_i
|
33
33
|
end
|
34
34
|
|
35
|
-
# @return [Integer] the amount of
|
36
|
-
def
|
37
|
-
@user['
|
35
|
+
# @return [Integer] the amount of likes this user has.
|
36
|
+
def likes
|
37
|
+
@user['likes']
|
38
38
|
end
|
39
39
|
|
40
|
+
# This simply returns the likes, switch to likes.
|
41
|
+
# @deprecated
|
42
|
+
# @see [likes]
|
43
|
+
alias_method :upvotes, :likes
|
44
|
+
|
40
45
|
# The oauth flags for this user. Not useful on their own.
|
41
46
|
# @see DBio::DiscordProfile#public_flags
|
42
47
|
# @return [Integer] the flags for this user
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbiorb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chew
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|