create account

RE: How to Find Hidden Gems with Ruby by inertia

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @deradministrator/re-inertia-how-to-find-hidden-gems-with-ruby-20180218t210649989z

· @inertia ·
Yep, I think there's a mistake in that script that nobody ever noticed.

```ruby
  next if (created = (Time.now - Time.parse(comment.created + ' UTC')).to_i / 60) < 30
```

Should be:

```ruby
  next if (created = (Time.now - Time.parse(comment.created + ' UTC')).to_i / 60) > 30
```

You can use this to do the same thing instead:

http://steem-ganymede.herokuapp.com/discussions?vote_ready=true

The code for that is here, which is correct:

https://github.com/steem-third-party/ganymede/blob/master/app/controllers/discussions_controller.rb#L176
👍  
properties (23)
authorinertia
permlinkre-deradministrator-re-inertia-how-to-find-hidden-gems-with-ruby-20180218t214944488z
categoryradiator
json_metadata{"tags":["radiator"],"links":["http://steem-ganymede.herokuapp.com/discussions?vote_ready=true","https://github.com/steem-third-party/ganymede/blob/master/app/controllers/discussions_controller.rb#L176"],"app":"steemit/0.1"}
created2018-02-18 21:49:45
last_update2018-02-18 21:49:45
depth2
children3
last_payout2018-02-25 21:49:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length548
author_reputation346,568,901,399,561
root_title"How to Find Hidden Gems with Ruby"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id38,619,521
net_rshares3,940,570,684
author_curate_reward""
vote details (1)
@deradministrator ·
Worked flawless now =) Thank you, couldnt find the error.  Alright, seems like my customizing works somehow. Can you explain me this part with the argv?:
 options[:tag] = @ARGV if ARGV.any? 

I m trying to wrap my head around ruby as a begginer, buts its kinda hard. Thank you for all your effort with your tutorials. They help me a lot :D
properties (22)
authorderadministrator
permlinkre-inertia-re-deradministrator-re-inertia-how-to-find-hidden-gems-with-ruby-20180218t224627108z
categoryradiator
json_metadata{"tags":["radiator"],"users":["argv"],"app":"steemit/0.1"}
created2018-02-18 22:46:27
last_update2018-02-18 22:46:27
depth3
children2
last_payout2018-02-25 22:46:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length339
author_reputation1,084,361,388,464
root_title"How to Find Hidden Gems with Ruby"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id38,628,897
net_rshares0
@inertia ·
$0.02
There's a typo too.  It should be:

```ruby
options[:tag] = ARGV.first if ARGV.any?
```

The `ARGV` constant is created by the ruby interpreter and just gives you access to the parameters passed when you launch.  So, once you apply that fix, this command will work:

```bash
ruby vote_ready.rb dmania
```

And that will narrow down the query to the `dmania` tag.
👍  
properties (23)
authorinertia
permlinkre-deradministrator-re-inertia-re-deradministrator-re-inertia-how-to-find-hidden-gems-with-ruby-20180218t234943240z
categoryradiator
json_metadata{"tags":["radiator"],"app":"steemit/0.1"}
created2018-02-18 23:49:42
last_update2018-02-18 23:49:42
depth4
children1
last_payout2018-02-25 23:49:42
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length362
author_reputation346,568,901,399,561
root_title"How to Find Hidden Gems with Ruby"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id38,638,711
net_rshares4,201,104,283
author_curate_reward""
vote details (1)
@deradministrator · (edited)
Got that, makes sense now.
Will try it at home. You received a quest reward via memo ;)

Edit: WORKED!
properties (22)
authorderadministrator
permlinkre-inertia-re-deradministrator-re-inertia-re-deradministrator-re-inertia-how-to-find-hidden-gems-with-ruby-20180219t061956523z
categoryradiator
json_metadata{"tags":["radiator"],"app":"steemit/0.1"}
created2018-02-19 06:19:57
last_update2018-02-19 17:32:30
depth5
children0
last_payout2018-02-26 06:19:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length102
author_reputation1,084,361,388,464
root_title"How to Find Hidden Gems with Ruby"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id38,708,584
net_rshares0