utopian_ruby_api 0.0.3 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/beneficiary.rb +6 -0
- data/lib/moderator.rb +5 -0
- data/lib/post.rb +55 -0
- data/lib/utopian_ruby_helper.rb +44 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24027cdbfafb9a7ca52773431e65ed382faa7d1b2f0e1d4318003ebb7d7f8da9
|
4
|
+
data.tar.gz: 9483702c82435399b7a88046974032b757517b9c645e584bb45cece0a72cf162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a26dd6daf9faaddb2f0fe328708522147e5acd11dfe2fd9e788f4f8aa3380cab30c4f1a3fe43e4e8a33b1c1a8c4f80fd578464ae8fd353788fe122b0b4da92fb
|
7
|
+
data.tar.gz: 4b63a96873283bfd412ae0562094ef95c66fac014907caf3544c8b1d2ef0d1bd2cce0574f05ef4e3d92ae89cdebc75cf30c02088aabaee1e28ccc1aa8a68a5fc
|
data/lib/beneficiary.rb
ADDED
data/lib/moderator.rb
ADDED
data/lib/post.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
module UtopianRuby
|
2
|
+
class Post
|
3
|
+
attr_accessor :_id,
|
4
|
+
:id,
|
5
|
+
:author,
|
6
|
+
:flagged,
|
7
|
+
:reviewed,
|
8
|
+
:pending,
|
9
|
+
:moderator,
|
10
|
+
:permlink,
|
11
|
+
:category,
|
12
|
+
:parent_author,
|
13
|
+
:parent_permlink,
|
14
|
+
:title,
|
15
|
+
:body,
|
16
|
+
:created,
|
17
|
+
:last_update,
|
18
|
+
:active,
|
19
|
+
:last_payout,
|
20
|
+
:depth,
|
21
|
+
:children,
|
22
|
+
:net_rshares,
|
23
|
+
:abs_rshares,
|
24
|
+
:vote_rshares,
|
25
|
+
:children_abs_rshares,
|
26
|
+
:cashout_time,
|
27
|
+
:max_cashout_time,
|
28
|
+
:total_vote_weight,
|
29
|
+
:reward_weight,
|
30
|
+
:total_payout_value,
|
31
|
+
:curator_payout_value,
|
32
|
+
:author_rewards,
|
33
|
+
:net_votes,
|
34
|
+
:root_comment,
|
35
|
+
:max_accepted_payout,
|
36
|
+
:percent_steem_dollars,
|
37
|
+
:allow_replies,
|
38
|
+
:allow_votes,
|
39
|
+
:allow_curation_rewards,
|
40
|
+
:url,
|
41
|
+
:root_title,
|
42
|
+
:pending_payout_value,
|
43
|
+
:total_pending_payout_value,
|
44
|
+
:author_reputation,
|
45
|
+
:promoted,
|
46
|
+
:body_length,
|
47
|
+
:__v,
|
48
|
+
:reserved,
|
49
|
+
:json_metadata,
|
50
|
+
:replies,
|
51
|
+
:reblogged_by,
|
52
|
+
:beneficiaries,
|
53
|
+
:active_votes
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'utopian_ruby_api'
|
2
|
+
|
3
|
+
module UtopianRuby
|
4
|
+
class UtopianRubyHelper
|
5
|
+
# get posts by type
|
6
|
+
def self.get_posts_by_type(type,params)
|
7
|
+
if params.nil?
|
8
|
+
params = {"limit":1}
|
9
|
+
end
|
10
|
+
params["type"]=type
|
11
|
+
UtopianRuby::UtopianRubyAPI.get_posts(params)
|
12
|
+
end
|
13
|
+
|
14
|
+
# get posts object by type
|
15
|
+
def self.get_posts_obj_by_type(type,params)
|
16
|
+
if params.nil?
|
17
|
+
params = {"limit":1}
|
18
|
+
end
|
19
|
+
params["type"]=type
|
20
|
+
UtopianRuby::UtopianRubyAPI.get_posts_obj(params)
|
21
|
+
end
|
22
|
+
|
23
|
+
# get posts by moderator
|
24
|
+
def self.get_posts_obj_by_moderator(moderator,params)
|
25
|
+
if params.nil?
|
26
|
+
params = {"limit":1}
|
27
|
+
end
|
28
|
+
posts = Set.new
|
29
|
+
UtopianRuby::UtopianRubyAPI.get_posts(params)["results"].each do |p|
|
30
|
+
if p["moderator"]==moderator
|
31
|
+
posts << UtopianRuby::UtopianRubyAPI.j_to_p(p)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
posts
|
35
|
+
end
|
36
|
+
|
37
|
+
# get post github repository
|
38
|
+
def self.get_post_repository(author,permlink)
|
39
|
+
p = UtopianRuby::UtopianRubyAPI.get_post(author,permlink)
|
40
|
+
p["json_metadata"]["repository"]["html_url"]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopian_ruby_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3
|
4
|
+
version: 0.0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuxi
|
@@ -59,7 +59,11 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- lib/beneficiary.rb
|
63
|
+
- lib/moderator.rb
|
64
|
+
- lib/post.rb
|
62
65
|
- lib/utopian_ruby_api.rb
|
66
|
+
- lib/utopian_ruby_helper.rb
|
63
67
|
homepage: http://rubygems.org/gems/utopian_ruby_api
|
64
68
|
licenses:
|
65
69
|
- MIT
|