cosgrove 0.0.1rc9 → 0.0.1rc10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 700a9b0197550bb9b546a781f5099a5e0f5ff60f
4
- data.tar.gz: 0870c5e7886a7f90c8b13aaccfcf77ce4f617776
3
+ metadata.gz: d5db05419a8720ff473a7f01e8aa64af87dc480a
4
+ data.tar.gz: a936f0ca8e7aee5d1631f0aed3b3e473bcb6605a
5
5
  SHA512:
6
- metadata.gz: 7548e147a3faa74678ba48c74fdeb4305b841ea5efe0cdf08ff33da9c651f1125558daa036292e0a10b3762b6defabdcb46aecfb5a57ef324556bd5df97e78d0
7
- data.tar.gz: ce21995134edf4170ce27e68d3b4c5f9cdbcdc675279d4d30132d4a192b9096ccd2b4ac6fff77c2fa372f8b1df7d682db06a73406e47a4d34d0d863f69c2bd51
6
+ metadata.gz: 0275f836bc4aa9a39fd0b6a964ee1c648f2ee664da166e01172712b0d448d9de67bf934ddfa0efc3e77e55a39e1ad0869ab923dbe5a4eb7e2b64b0a8b9e5f43b
7
+ data.tar.gz: 61ea924f0b9494f84c72cfe49006a06f621260b5e09359f096780c01b80eddd58c3254e2a6aade6272ebd45832e2708000a62aa6236c7115fac173d3b5130f6d
data/Gemfile.lock CHANGED
@@ -17,7 +17,7 @@ GIT
17
17
  PATH
18
18
  remote: .
19
19
  specs:
20
- cosgrove (0.0.1rc9)
20
+ cosgrove (0.0.1rc10)
21
21
  activesupport (~> 5.1, >= 5.1.1)
22
22
  ai4r (~> 1.13, >= 1.13)
23
23
  discordrb (~> 3.2, >= 3.2.1)
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:
@@ -12,6 +12,10 @@ module Cosgrove
12
12
  yml[:cosgrove][:client_id]
13
13
  end
14
14
 
15
+ def cosgrove_operators
16
+ (yml[:cosgrove][:operators] || '').split(' ')
17
+ end
18
+
15
19
  def cosgrove_upvote_weight
16
20
  yml[:cosgrove][:upvote_weight]
17
21
  end
@@ -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
- muted = muted by: steem_account, chain: :steem
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
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Cosgrove
2
- VERSION = '0.0.1rc9'
2
+ VERSION = '0.0.1rc10'
3
3
  AGENT_ID = "cosgrove/#{VERSION}"
4
4
  end
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.1rc9
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-07 00:00:00.000000000 Z
11
+ date: 2017-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler