cosgrove 0.0.1rc7 → 0.0.1rc8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5843bf0c639c5f36039db3cd729c9dd081571dc4
4
- data.tar.gz: ff7a430fe1013201e3ff4018d7c10cf8d4bc07f4
3
+ metadata.gz: 58000a80263e9eb3910eaf1fd713b9da5b5450f4
4
+ data.tar.gz: f3be14ecc49996ece63386500f0da69edc56df3e
5
5
  SHA512:
6
- metadata.gz: c28bfcf611a16d891248b4abf5c1110c010a2f602d45adebc8c51ea6f8fb8b830a6734319c317b7ec4eb566e87d4601575969ec37d7bce1462a3afd05694b254
7
- data.tar.gz: fa97afa5b24ec0e142cf423c936497878bf21b518a29b5488022527fb8a431205e1936e40e22862a8ac552db08d732b92f6fe8bad33470451dcfb99dfd064b28
6
+ metadata.gz: 6111f7a45fdc1b9fb3f36563eb3e31835c3b95e62accfe2170cdda187a1846dccdce4a95d00059a18e446f5e01517689843435c7129bdf1f18199f3de8e73e87
7
+ data.tar.gz: 28653a27fad89dccc66f0e9a4d15b3279953a023a07a9942f8c7b507f738fcb35f97b6fc11173a69cb94c71c1b3abd14b4ecd795dfc18f718b1116de4cef89c9
@@ -17,14 +17,14 @@ GIT
17
17
  PATH
18
18
  remote: .
19
19
  specs:
20
- cosgrove (0.0.1rc7)
20
+ cosgrove (0.0.1rc8)
21
21
  activesupport (~> 5.1, >= 5.1.1)
22
22
  ai4r (~> 1.13, >= 1.13)
23
23
  discordrb (~> 3.2, >= 3.2.1)
24
24
  mechanize (~> 2.7, >= 2.7.5)
25
25
  mongoid (~> 6.1, >= 6.1.0)
26
26
  phantomjs (~> 2.1, >= 2.1.1.0)
27
- radiator (~> 0.2, >= 0.2.2)
27
+ radiator (~> 0.2, >= 0.2.3rc2)
28
28
  railties (~> 5.1, >= 5.1.1)
29
29
  rdiscount (~> 2.2, >= 2.2.0.1)
30
30
  rmagick (~> 2.16, >= 2.16.0)
@@ -56,8 +56,8 @@ GEM
56
56
  i18n (~> 0.7)
57
57
  minitest (~> 5.1)
58
58
  tzinfo (~> 1.1)
59
- addressable (2.5.1)
60
- public_suffix (~> 2.0, >= 2.0.2)
59
+ addressable (2.5.2)
60
+ public_suffix (>= 2.0.2, < 4.0)
61
61
  ai4r (1.13)
62
62
  awesome_print (1.8.0)
63
63
  bitcoin-ruby (0.0.10)
@@ -137,11 +137,11 @@ GEM
137
137
  coderay (~> 1.1.0)
138
138
  method_source (~> 0.8.1)
139
139
  slop (~> 3.4)
140
- public_suffix (2.0.5)
140
+ public_suffix (3.0.0)
141
141
  rack (2.0.3)
142
142
  rack-test (0.6.3)
143
143
  rack (>= 1.0)
144
- radiator (0.2.2)
144
+ radiator (0.2.3rc2)
145
145
  bitcoin-ruby (= 0.0.10)
146
146
  ffi (= 1.9.18)
147
147
  hashie (~> 3.5, >= 3.5.5)
data/README.md CHANGED
@@ -12,8 +12,10 @@ Many (not all) features work on Golos as well.
12
12
  * `dynamic` - uses the bot's current voting recharge percent as the upvote percent.
13
13
  * `upvote_rules` - uses channel specific rules.
14
14
  * `100.00 %` - can be any valid voting percentage.
15
+ * `disable_comment_voting` - only posts can get votes.
15
16
  * Added `CommentJob` for creating automated replies.
16
17
  * Added callback `on_success_upvote_job` which can be used to, for example, reply to the post after being upvoted.
18
+ * Market data now uses Bittrex instead of Poloniex.
17
19
 
18
20
  ## Features
19
21
 
@@ -45,7 +47,7 @@ Add a config file to your `ruby` project called `config.yml`:
45
47
  :cosgrove:
46
48
  :token:
47
49
  :client_id:
48
- :secret: set this
50
+ :secure: set this
49
51
  :upvote_weight: upvote_rules
50
52
  :upvote_rules:
51
53
  :channels:
@@ -54,6 +56,7 @@ Add a config file to your `ruby` project called `config.yml`:
54
56
  :general_text:
55
57
  :channel_id: <Your Favorite Channel ID>
56
58
  :upvote_weight: 100.00 %
59
+ :disable_comment_voting: true
57
60
  :chain:
58
61
  :steem_account:
59
62
  :steem_posting_wif:
@@ -69,7 +72,7 @@ You will need to request a `token` and `client_id` from Discord (see below).
69
72
 
70
73
  Provide the accounts and `wif` private postings keys if you want your bot to upvote posts.
71
74
 
72
- You should change the `secret` key using the output of:
75
+ You should change the `secure` key using the output of:
73
76
 
74
77
  ```ruby
75
78
  SecureRandom.hex(32)
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'pry', '~> 0.10', '>= 0.10.3'
34
34
  spec.add_development_dependency 'awesome_print', '~> 1.7', '>= 1.7.0'
35
35
 
36
- spec.add_dependency 'radiator', '~> 0.2', '>= 0.2.2'
36
+ spec.add_dependency 'radiator', '~> 0.2', '>= 0.2.3rc2'
37
37
  spec.add_dependency 'steemdata-rb', '~> 0.0', '>= 0.0.1f'
38
38
  spec.add_dependency 'discordrb', '~> 3.2', '>= 3.2.1'
39
39
  spec.add_dependency 'ai4r', '~> 1.13', '>= 1.13'
@@ -3,6 +3,7 @@ require 'digest/bubblebabble'
3
3
  module Cosgrove
4
4
  class Account
5
5
  include Cosgrove::Config
6
+ include Cosgrove::Utils
6
7
 
7
8
  ACCOUNTS_FILE ||= "#{Cosgrove::PWD}/accounts.yml".freeze
8
9
  DISCORD_IDS = 'discord_ids'.freeze
@@ -89,7 +90,7 @@ module Cosgrove
89
90
  def self.save_yml!
90
91
  return unless !!@yml
91
92
 
92
- File.open(ACCOUNTS_FILE, 'w') do |f|
93
+ File.open(ACCOUNTS_FILE, 'w+') do |f|
93
94
  f.write @yml.to_yaml
94
95
  end
95
96
  end
@@ -110,9 +110,9 @@ module Cosgrove
110
110
  if !!response.error
111
111
  'Unable to vote right now. Maybe I already voted on that. Try again later.'
112
112
  elsif !!response.result.id
113
- if created > 30.minutes.ago
114
- event.respond "*#{SteemSlap.slap(event.author.display_name)}*"
115
- end
113
+ # if created > 30.minutes.ago
114
+ # event.respond "*#{SteemSlap.slap(event.author.display_name)}*"
115
+ # end
116
116
 
117
117
  if !!@on_success
118
118
  begin
@@ -43,6 +43,24 @@ module Cosgrove
43
43
  end
44
44
  end
45
45
 
46
+ def reset_stream
47
+ @steem_stream = @golos_stream = @test_stream = nil
48
+ @steem_folow_stream = @golos_follow_stream = @test_folow_stream = nil
49
+ @cycle_stream_at = nil
50
+ end
51
+
52
+ def stream(chain)
53
+ reset_stream if @cycle_stream_at.nil? || @cycle_stream_at < 15.minutes.ago
54
+
55
+ @cycle_stream_at ||= Time.now
56
+
57
+ case chain
58
+ when :steem then @steem_stream ||= Radiator::Stream.new(url: steem_api_url)
59
+ when :golos then @golos_stream ||= Radiator::Stream.new(url: golos_api_url)
60
+ when :test then @test_stream ||= Radiator::Stream.new(url: test_api_url)
61
+ end
62
+ end
63
+
46
64
  def steem_data_head_block_number
47
65
  [SteemData::Setting.last.last_block, SteemData::AccountOperation.last.block].min
48
66
  end
@@ -55,7 +73,7 @@ module Cosgrove
55
73
  properties(chain)['head_block_number']
56
74
  end
57
75
 
58
- def last_irreversible_block_num(chain)
76
+ def last_irreversible_block_num(chain = :steem)
59
77
  properties(chain)['last_irreversible_block_num']
60
78
  end
61
79
 
@@ -1,4 +1,4 @@
1
1
  module Cosgrove
2
- VERSION = '0.0.1rc7'
2
+ VERSION = '0.0.1rc8'
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.1rc7
4
+ version: 0.0.1rc8
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-08-28 00:00:00.000000000 Z
11
+ date: 2017-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -293,7 +293,7 @@ dependencies:
293
293
  version: '0.2'
294
294
  - - ">="
295
295
  - !ruby/object:Gem::Version
296
- version: 0.2.2
296
+ version: 0.2.3rc2
297
297
  type: :runtime
298
298
  prerelease: false
299
299
  version_requirements: !ruby/object:Gem::Requirement
@@ -303,7 +303,7 @@ dependencies:
303
303
  version: '0.2'
304
304
  - - ">="
305
305
  - !ruby/object:Gem::Version
306
- version: 0.2.2
306
+ version: 0.2.3rc2
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: steemdata-rb
309
309
  requirement: !ruby/object:Gem::Requirement