ico_bench 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +14 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +126 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/ico_bench.gemspec +44 -0
- data/lib/ico_bench.rb +162 -0
- data/lib/ico_bench/version.rb +5 -0
- metadata +199 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 61b14f5bdd8782a62fa9632c6e55795f95598518
|
4
|
+
data.tar.gz: dfdce259a79b3483b01c75705e183f680feca7df
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9135dbc79edc3c9dadbf12fc5a31ad02d01ccc73d046b26e150fe7df9861b3d9f1d0b95d311d487aff1b7dfa54fedd066c856e85338ecf9a49583755c0e984d7
|
7
|
+
data.tar.gz: c7c4869a3b601f748162ff60e9ceb25656617aca2fb22c25a2a5b75490b82b689da877f9f7083126760fb3059f1d8b2cff39aca36654ea5d8976e5d3df8d4aa1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at ankitsamar@outlook.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Ankit Samarthya
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/ico_bench.svg)](https://badge.fury.io/rb/ico_bench)
|
2
|
+
|
3
|
+
# IcoBench
|
4
|
+
## WIP
|
5
|
+
Ruby Gem that parses ICO token information, ratings, and expert information from IcoBench.com.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'ico_bench', '~> 0.1.0'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install icobench
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
### ICO List
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
# @param params [Hash] Query params. See #filters
|
29
|
+
# @return [Hash]
|
30
|
+
IcoBench.icos
|
31
|
+
|
32
|
+
=> {:current_page=>1,
|
33
|
+
:total_pages=>146,
|
34
|
+
:response_time=>0.2552617e1,
|
35
|
+
:icos=>
|
36
|
+
[{:name=>"Acorn Collective",
|
37
|
+
:url=>"https://icobench.com/ico/acorn-collective",
|
38
|
+
:premium=>true,
|
39
|
+
:tag=>
|
40
|
+
"Acorn is building a blockchain based crowdfunding platform that's the first to be free and open to any legal project in any country.KYC: Yes | Whitelist: Yes | Restrictions: USA, China",
|
41
|
+
:start_date=>Mon, 29 Jan 2018,
|
42
|
+
:end_date=>Mon, 19 Feb 2018,
|
43
|
+
:rating=>4.1},
|
44
|
+
{:name=>"Gilgamesh Platform",
|
45
|
+
:url=>"https://icobench.com/ico/gilgamesh-platform",
|
46
|
+
:premium=>true,
|
47
|
+
:tag=>"Knowledge-sharing social network platform based on Ethereum Blockchain.KYC: Yes | Whitelist: No",
|
48
|
+
:start_date=>Mon, 15 Jan 2018,
|
49
|
+
:end_date=>Mon, 26 Mar 2018,
|
50
|
+
:rating=>4.1}]
|
51
|
+
}
|
52
|
+
```
|
53
|
+
|
54
|
+
#### Filters
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
# Optional query filters
|
58
|
+
# @param order_desc [String] Valid values: rating, start, end, raised, name
|
59
|
+
# @param order_asc [String] Valid values: rating, start, end, raised, name
|
60
|
+
# @param page [Integer] Pagination
|
61
|
+
# @param category [Integer] Category type via #filters response
|
62
|
+
# @param platform [String] List the ICOs supported by a certain platform, e.g. "Ethereum"
|
63
|
+
# @param accepting [String] List the ICOs those are accepting a certain currency, e.g. "BTC"
|
64
|
+
# @param country [String] List the ICOs located in a certain country, e.g. "Australia" or "UK"
|
65
|
+
# @param status [String] Valid values: active, ongoing, upcoming, ended
|
66
|
+
# @param search [String] List the ICOs those have a certain string in the name, token name, tagline or short description, e.g. "VIB" or "gaming"
|
67
|
+
# @param bonus [Boolean] List the ICOs that have a bonus
|
68
|
+
# @param bounty [Boolean] List the ICOs that have a bounty
|
69
|
+
# @param team [Boolean] List the ICOs that have a team
|
70
|
+
# @param expert [Boolean] List the ICOs that have a expert
|
71
|
+
# @param rating [Integer] List the ICOs that have rating 1-4+
|
72
|
+
# @param start_after [String] List the ICOs starting from selected date (YYYY-MM-DD format)
|
73
|
+
# @param before_after [String] List the ICOs ending before date (YYYY-MM-DD format)
|
74
|
+
# @param registration [Integer] List the ICOs based on registration type and requirements - KYC / Whitelist.
|
75
|
+
# 1 = With whitelist
|
76
|
+
# 2 = Without whitelist
|
77
|
+
# 3 = With KYC
|
78
|
+
# 4 = Without KYC
|
79
|
+
# 5 = With KYC and Whitelist
|
80
|
+
# 6 = None
|
81
|
+
# @param exclude_country [String] List the ICOs excluding all ICOs with restriction on that country
|
82
|
+
```
|
83
|
+
|
84
|
+
### ICO People/Person information
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
# @param type [String] Valid values: all, registered, experts
|
88
|
+
# @param page [Integer]
|
89
|
+
# @param search [String] Name search
|
90
|
+
# @return [Hash]
|
91
|
+
IcoBench.people(type: nil, page: nil, search: nil)
|
92
|
+
|
93
|
+
=> {:current_page=>1,
|
94
|
+
:total_pages=>1346,
|
95
|
+
:response_time=>0.2409899e1,
|
96
|
+
:people=>
|
97
|
+
[{:name=>"Simon Cocking",
|
98
|
+
:url=>"https://icobench.com/u/simon-cocking",
|
99
|
+
:tag=>"Editor in Chief, Cryptocoin.News",
|
100
|
+
:icos=>"Experty, Bitindia, ClearPoll, Jincor, and 20 more",
|
101
|
+
:ico_success_score=>82.182},
|
102
|
+
{:name=>"David Drake",
|
103
|
+
:url=>"https://icobench.com/u/david-drake",
|
104
|
+
:tag=>"Managing Partner",
|
105
|
+
:icos=>"Ambrosus, Swarm Fund, Setcoin, 1World, and 18 more",
|
106
|
+
:ico_success_score=>77.177}]
|
107
|
+
}
|
108
|
+
```
|
109
|
+
|
110
|
+
## Development
|
111
|
+
|
112
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
113
|
+
|
114
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
115
|
+
|
116
|
+
## Contributing
|
117
|
+
|
118
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kurt-smith/icobench. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
119
|
+
|
120
|
+
## License
|
121
|
+
|
122
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
123
|
+
|
124
|
+
## Code of Conduct
|
125
|
+
|
126
|
+
Everyone interacting in the IcoBench project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kurt-smith/icobench/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'icobench'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/ico_bench.gemspec
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'ico_bench/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'ico_bench'
|
9
|
+
spec.version = IcoBench::VERSION
|
10
|
+
spec.authors = ['Kurt Smith']
|
11
|
+
spec.email = ['zippydev@protonmail.com']
|
12
|
+
|
13
|
+
spec.summary = 'IcoBench ICO expert ratings and information'
|
14
|
+
spec.description = 'IcoBench.com data for the latest ICO token ratings and information'
|
15
|
+
spec.homepage = 'https://github.com/kurt-smith/ico_bench'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
19
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
20
|
+
if spec.respond_to?(:metadata)
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
|
+
else
|
23
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
24
|
+
end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = 'exe'
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ['lib']
|
32
|
+
|
33
|
+
spec.add_dependency 'activesupport', '~> 5.1'
|
34
|
+
spec.add_dependency 'http', '~> 3.0'
|
35
|
+
spec.add_dependency 'nokogiri', '~> 1.8'
|
36
|
+
|
37
|
+
spec.add_development_dependency 'bundler', '>= 1.14'
|
38
|
+
spec.add_development_dependency 'pry', '>= 0.11'
|
39
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
40
|
+
spec.add_development_dependency 'rspec', '~> 3.7'
|
41
|
+
spec.add_development_dependency 'rubocop', '>= 0.52'
|
42
|
+
spec.add_development_dependency 'simplecov', '>= 0.15'
|
43
|
+
spec.add_development_dependency 'webmock', '~> 3.2'
|
44
|
+
end
|
data/lib/ico_bench.rb
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_support/core_ext'
|
5
|
+
require 'ico_bench/version'
|
6
|
+
require 'http'
|
7
|
+
require 'nokogiri'
|
8
|
+
|
9
|
+
class IcoBench
|
10
|
+
BASE_URL = 'https://icobench.com'.freeze
|
11
|
+
|
12
|
+
class << self
|
13
|
+
# @param params [Hash] Query params. See #filters
|
14
|
+
# @return [Hash]
|
15
|
+
# @see https://icobench.com/icos
|
16
|
+
def icos(**params)
|
17
|
+
url = "#{BASE_URL}/icos"
|
18
|
+
query = filters(params)
|
19
|
+
url << query if query.present?
|
20
|
+
|
21
|
+
request_time = Time.now.to_f
|
22
|
+
response = HTTP.get(url)
|
23
|
+
html = Nokogiri::HTML(response.body.to_s)
|
24
|
+
rows = html.css('div.ico_list table tr')
|
25
|
+
return {} if rows.blank?
|
26
|
+
|
27
|
+
icos = []
|
28
|
+
|
29
|
+
rows.each_with_index do |row, index|
|
30
|
+
next if index.zero? # table header row
|
31
|
+
icos << parse_ico_row(row)
|
32
|
+
end
|
33
|
+
|
34
|
+
{
|
35
|
+
current_page: params[:page] || 1,
|
36
|
+
total_pages: html.css('div.pages a.num').last&.text&.to_i,
|
37
|
+
response_time: (Time.now.to_f - request_time.to_d),
|
38
|
+
icos: icos
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# @param type [String] Valid values: all, registered, experts
|
43
|
+
# @param page [Integer]
|
44
|
+
# @param search [String] Name search
|
45
|
+
# @return [Hash]
|
46
|
+
def people(type: nil, page: nil, search: nil)
|
47
|
+
url = "#{BASE_URL}/people"
|
48
|
+
params = {
|
49
|
+
page: page,
|
50
|
+
type: type,
|
51
|
+
s: search.presence
|
52
|
+
}.compact.to_param
|
53
|
+
|
54
|
+
url << "?#{params}" if params.present?
|
55
|
+
|
56
|
+
request_time = Time.now.to_f
|
57
|
+
response = HTTP.get(url)
|
58
|
+
html = Nokogiri::HTML(response.body.to_s)
|
59
|
+
rows = html.css('div.ico_list table tr')
|
60
|
+
return {} if rows.blank?
|
61
|
+
|
62
|
+
people = []
|
63
|
+
|
64
|
+
rows.each_with_index do |row, index|
|
65
|
+
next if index.zero? # table header row
|
66
|
+
people << parse_people_row(row)
|
67
|
+
end
|
68
|
+
|
69
|
+
{
|
70
|
+
current_page: page.presence || 1,
|
71
|
+
total_pages: html.css('div.pages a.num').last&.text&.to_i,
|
72
|
+
response_time: (Time.now.to_f - request_time.to_d),
|
73
|
+
people: people
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
# Optional query filters
|
80
|
+
# @param order_desc [String] Valid values: rating, start, end, raised, name
|
81
|
+
# @param order_asc [String] Valid values: rating, start, end, raised, name
|
82
|
+
# @param page [Integer] Pagination
|
83
|
+
# @param category [Integer] Category type via #filters response
|
84
|
+
# @param platform [String] List the ICOs supported by a certain platform, e.g. "Ethereum"
|
85
|
+
# @param accepting [String] List the ICOs those are accepting a certain currency, e.g. "BTC"
|
86
|
+
# @param country [String] List the ICOs located in a certain country, e.g. "Australia" or "UK"
|
87
|
+
# @param status [String] Valid values: active, ongoing, upcoming, ended
|
88
|
+
# @param search [String] List the ICOs those have a certain string in the name, token name, tagline or short description, e.g. "VIB" or "gaming"
|
89
|
+
# @param bonus [Boolean] List the ICOs that have a bonus
|
90
|
+
# @param bounty [Boolean] List the ICOs that have a bounty
|
91
|
+
# @param team [Boolean] List the ICOs that have a team
|
92
|
+
# @param expert [Boolean] List the ICOs that have a expert
|
93
|
+
# @param rating [Integer] List the ICOs that have rating 1-4+
|
94
|
+
# @param start_after [String] List the ICOs starting from selected date (YYYY-MM-DD format)
|
95
|
+
# @param before_after [String] List the ICOs ending before date (YYYY-MM-DD format)
|
96
|
+
# @param registration [Integer] List the ICOs based on registration type and requirements - KYC / Whitelist.
|
97
|
+
# 1 = With whitelist
|
98
|
+
# 2 = Without whitelist
|
99
|
+
# 3 = With KYC
|
100
|
+
# 4 = Without KYC
|
101
|
+
# 5 = With KYC and Whitelist
|
102
|
+
# 6 = None
|
103
|
+
# @param exclude_country [String] List the ICOs excluding all ICOs with restriction on that country
|
104
|
+
# @return [String]
|
105
|
+
def filters(**opts)
|
106
|
+
filter = {
|
107
|
+
orderDesc: opts[:order_desc],
|
108
|
+
orderAsc: opts[:order_asc],
|
109
|
+
page: opts[:page],
|
110
|
+
category: opts[:category],
|
111
|
+
platform: opts[:platform],
|
112
|
+
accepting: opts[:accepting],
|
113
|
+
country: opts[:country],
|
114
|
+
status: opts[:status],
|
115
|
+
s: opts[:search],
|
116
|
+
bonus: opts[:bonus].present? ? 'on' : nil,
|
117
|
+
bounty: opts[:bounty].present? ? 'on' : nil,
|
118
|
+
team: opts[:team].present? ? 'on' : nil,
|
119
|
+
expert: opts[:expert].present? ? 'on' : nil,
|
120
|
+
rating: opts[:rating],
|
121
|
+
startAfter: opts[:start_after],
|
122
|
+
endBefore: opts[:end_before],
|
123
|
+
registration: opts[:registration],
|
124
|
+
excludeRestrictedCountry: opts[:exclude_country]
|
125
|
+
}.compact.to_param
|
126
|
+
|
127
|
+
"?#{filter}" if filter.present?
|
128
|
+
end
|
129
|
+
|
130
|
+
# @param row [Nokogiri<HTML>]
|
131
|
+
# @return [Hash]
|
132
|
+
def parse_ico_row(row)
|
133
|
+
{
|
134
|
+
name: row.css('td')[0].css('.content a.name').children.last.text,
|
135
|
+
url: "#{BASE_URL}#{row.css('td')[0].css('.content a.name').attribute('href').text}",
|
136
|
+
premium: row.css('td')[0].css('.content a.name a.premium').present?,
|
137
|
+
tag: row.css('td')[0].css('.content p').text,
|
138
|
+
start_date: parse_date(row.css('td')[1].text),
|
139
|
+
end_date: parse_date(row.css('td')[2].text),
|
140
|
+
rating: row.css('td')[3]&.text&.to_f
|
141
|
+
}
|
142
|
+
end
|
143
|
+
|
144
|
+
# @param row [Nokogiri<HTML>]
|
145
|
+
# @return [Hash]
|
146
|
+
def parse_people_row(row)
|
147
|
+
{
|
148
|
+
name: row.css('td .people_content a').text,
|
149
|
+
url: "#{BASE_URL}#{row.css('td .people_content a').attribute('href').text}",
|
150
|
+
tag: row.css('td .people_content p').text,
|
151
|
+
icos: row.css('td.rmv')[0]&.text,
|
152
|
+
ico_success_score: row.css('td .iss_score').text.to_f
|
153
|
+
}
|
154
|
+
end
|
155
|
+
|
156
|
+
def parse_date(date)
|
157
|
+
Date.parse(date)
|
158
|
+
rescue StandardError
|
159
|
+
nil
|
160
|
+
end
|
161
|
+
end # self
|
162
|
+
end
|
metadata
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ico_bench
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kurt Smith
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-02-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: http
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.8'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.14'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.14'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.11'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.11'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.7'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.7'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.52'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.52'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.15'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.15'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: webmock
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.2'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.2'
|
153
|
+
description: IcoBench.com data for the latest ICO token ratings and information
|
154
|
+
email:
|
155
|
+
- zippydev@protonmail.com
|
156
|
+
executables: []
|
157
|
+
extensions: []
|
158
|
+
extra_rdoc_files: []
|
159
|
+
files:
|
160
|
+
- ".gitignore"
|
161
|
+
- ".rspec"
|
162
|
+
- ".rubocop.yml"
|
163
|
+
- ".travis.yml"
|
164
|
+
- CODE_OF_CONDUCT.md
|
165
|
+
- Gemfile
|
166
|
+
- LICENSE.txt
|
167
|
+
- README.md
|
168
|
+
- Rakefile
|
169
|
+
- bin/console
|
170
|
+
- bin/setup
|
171
|
+
- ico_bench.gemspec
|
172
|
+
- lib/ico_bench.rb
|
173
|
+
- lib/ico_bench/version.rb
|
174
|
+
homepage: https://github.com/kurt-smith/ico_bench
|
175
|
+
licenses:
|
176
|
+
- MIT
|
177
|
+
metadata:
|
178
|
+
allowed_push_host: https://rubygems.org
|
179
|
+
post_install_message:
|
180
|
+
rdoc_options: []
|
181
|
+
require_paths:
|
182
|
+
- lib
|
183
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
requirements: []
|
194
|
+
rubyforge_project:
|
195
|
+
rubygems_version: 2.6.11
|
196
|
+
signing_key:
|
197
|
+
specification_version: 4
|
198
|
+
summary: IcoBench ICO expert ratings and information
|
199
|
+
test_files: []
|