cosgrove 0.0.1rc9 → 0.0.1rc10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/cosgrove/config.rb +4 -0
- data/lib/cosgrove/upvote_job.rb +3 -1
- data/lib/cosgrove/utils.rb +25 -0
- data/lib/cosgrove/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5db05419a8720ff473a7f01e8aa64af87dc480a
|
4
|
+
data.tar.gz: a936f0ca8e7aee5d1631f0aed3b3e473bcb6605a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0275f836bc4aa9a39fd0b6a964ee1c648f2ee664da166e01172712b0d448d9de67bf934ddfa0efc3e77e55a39e1ad0869ab923dbe5a4eb7e2b64b0a8b9e5f43b
|
7
|
+
data.tar.gz: 61ea924f0b9494f84c72cfe49006a06f621260b5e09359f096780c01b80eddd58c3254e2a6aade6272ebd45832e2708000a62aa6236c7115fac173d3b5130f6d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -16,6 +16,7 @@ Many (not all) features work on Golos as well.
|
|
16
16
|
* Added `CommentJob` for creating automated replies.
|
17
17
|
* Added callback `on_success_upvote_job` which can be used to, for example, reply to the post after being upvoted.
|
18
18
|
* Market data now uses Bittrex instead of Poloniex.
|
19
|
+
* Added `operators` to keep track of steem accounts that can do things like block upvotes (by blockchain mute).
|
19
20
|
|
20
21
|
## Features
|
21
22
|
|
@@ -48,6 +49,7 @@ Add a config file to your `ruby` project called `config.yml`:
|
|
48
49
|
:token:
|
49
50
|
:client_id:
|
50
51
|
:secure: set this
|
52
|
+
:operators: <account names seperated by space>
|
51
53
|
:upvote_weight: upvote_rules
|
52
54
|
:upvote_rules:
|
53
55
|
:channels:
|
data/lib/cosgrove/config.rb
CHANGED
data/lib/cosgrove/upvote_job.rb
CHANGED
@@ -18,7 +18,9 @@ module Cosgrove
|
|
18
18
|
discord_id = event.author.id
|
19
19
|
cb_account = Cosgrove::Account.find_by_discord_id(discord_id)
|
20
20
|
registered = !!cb_account
|
21
|
-
|
21
|
+
muters = cosgrove_operators
|
22
|
+
muters << steem_account
|
23
|
+
muted = muted by: muters, chain: :steem
|
22
24
|
|
23
25
|
posts = SteemData::Post.root_posts.where(author: author_name, permlink: permlink)
|
24
26
|
votes_today = SteemData::AccountOperation.type('vote').where(voter: steem_account).today
|
data/lib/cosgrove/utils.rb
CHANGED
@@ -151,5 +151,30 @@ module Cosgrove
|
|
151
151
|
|
152
152
|
[]
|
153
153
|
end
|
154
|
+
|
155
|
+
def find_comment(slug)
|
156
|
+
author_name, permlink = parse_slug slug
|
157
|
+
comment = nil
|
158
|
+
|
159
|
+
begin
|
160
|
+
comment = SteemData::Post.where(author: author_name, permlink: permlink).first
|
161
|
+
rescue => e
|
162
|
+
ap e
|
163
|
+
end
|
164
|
+
|
165
|
+
if comment.nil?
|
166
|
+
begin
|
167
|
+
# Fall back to RPC
|
168
|
+
response = api(:steem).get_content(author_name, permlink)
|
169
|
+
unless response.result.author.empty?
|
170
|
+
comment = response.result
|
171
|
+
end
|
172
|
+
rescue => e
|
173
|
+
ap e
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
comment
|
178
|
+
end
|
154
179
|
end
|
155
180
|
end
|
data/lib/cosgrove/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cosgrove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1rc10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|