rulethu_stock_exchange 0.1.0 → 0.1.1
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/README.md +9 -5
- data/lib/rulethu_stock_exchange/exchanges.rb +17 -17
- data/lib/rulethu_stock_exchange/version.rb +1 -1
- metadata +1 -2
- data/rulethu_stock_exchange.gemspec +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 295bf21bc8c77a701152c0db5471607c3b982f1dc9f1ce246c349adfa810be20
|
4
|
+
data.tar.gz: f39b27e07eb89a65613be71513be934777de2e13c4d4705488e23a8691a90c12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd622fdee23971082c6e50485e47859c86eca64fc2495c225a67f514d9337081c665615beaf8bfcea567d5e84228aa592c45e0990c5e6d796777a49668292f3
|
7
|
+
data.tar.gz: cd2d92f0e66e183e21b3092e6a087db23bce94cf7fa4a0d0e53c7c2966565ef1ce5a45e3bc806d9f7530edb528c76ab0752b2d49dd2a52c35c8d38545f67e6a0
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# RulethuStockExchange
|
2
2
|
|
3
3
|
This gem allows you to scrape stock exchange data from the following exchanges:
|
4
|
-
* Zimbabwe Stock Exchange
|
5
|
-
* Johannesburg Stock Exchange
|
6
|
-
* London Stock Exchange
|
4
|
+
* Zimbabwe Stock Exchange (ZSE)
|
5
|
+
* Johannesburg Stock Exchange (JSE)
|
6
|
+
* London Stock Exchange (LSE)
|
7
7
|
|
8
8
|
|
9
9
|
## Installation
|
@@ -19,8 +19,12 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
19
19
|
## Usage
|
20
20
|
|
21
21
|
### Example 1: Scraping Data From London Stock Exchange
|
22
|
+
Require the gem
|
23
|
+
```ruby
|
24
|
+
require 'rulethu_stock_exchange'
|
25
|
+
```
|
22
26
|
|
23
|
-
Get
|
27
|
+
Get the stock exchange. (Currently available stock exchanges are ZSE, JSE and LSE)
|
24
28
|
|
25
29
|
```ruby
|
26
30
|
exchange = RulethuStockExchange::Exchanges::LSE
|
@@ -47,7 +51,7 @@ data = parser.parse()
|
|
47
51
|
|
48
52
|
Write the data to JSON file
|
49
53
|
```ruby
|
50
|
-
filename
|
54
|
+
filename = RulethuStockExchange::IO.write_to_json_file data, 'lse'
|
51
55
|
```
|
52
56
|
|
53
57
|
Convert the JSON file to CSV
|
@@ -1,21 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module RulethuStockExchange::Exchanges
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
ALL = [
|
5
|
+
LSE = {
|
6
|
+
name: 'London Stock Exchange',
|
7
|
+
url: 'https://www.londonstockexchange.com/indices?tab=ftse-indices',
|
8
|
+
selector: 'section#indices-table-IntradayValues > table'
|
9
|
+
},
|
10
|
+
JSE = {
|
11
|
+
name: 'Johannesburg Stock Exchange',
|
12
|
+
url: 'https://www.jse.co.za/indices',
|
13
|
+
selector: 'table'
|
14
|
+
},
|
15
|
+
ZSE = {
|
16
|
+
name: 'Zimbabwe Stock Exchange',
|
17
|
+
url: 'https://www.zse.co.zw/price-sheet/',
|
18
|
+
selector: 'table'
|
19
|
+
}
|
20
|
+
]
|
21
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rulethu_stock_exchange
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blessed Sibanda
|
@@ -50,7 +50,6 @@ files:
|
|
50
50
|
- lib/rulethu_stock_exchange/parser.rb
|
51
51
|
- lib/rulethu_stock_exchange/scraper.rb
|
52
52
|
- lib/rulethu_stock_exchange/version.rb
|
53
|
-
- rulethu_stock_exchange.gemspec
|
54
53
|
- sig/rulethu_stock_exchange.rbs
|
55
54
|
homepage: https://github.com/rulethu/rulethu_stock_exchange.git
|
56
55
|
licenses:
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/rulethu_stock_exchange/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "rulethu_stock_exchange"
|
7
|
-
spec.version = RulethuStockExchange::VERSION
|
8
|
-
spec.authors = ["Blessed Sibanda"]
|
9
|
-
spec.email = ["blessed@rulethu.com"]
|
10
|
-
|
11
|
-
spec.summary = "Get Stock Exchange Data"
|
12
|
-
spec.description = "Get Stock Exchange Data Needed by Rulethu from the Web"
|
13
|
-
spec.homepage = "https://github.com/rulethu/rulethu_stock_exchange.git"
|
14
|
-
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 3.0.0"
|
16
|
-
|
17
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
-
|
19
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
-
spec.metadata["source_code_uri"] = "https://github.com/rulethu/rulethu_stock_exchange.git"
|
21
|
-
spec.metadata["changelog_uri"] = "https://github.com/rulethu/rulethu_stock_exchange/blob/main/CHANGELOG.md"
|
22
|
-
|
23
|
-
# Specify which files should be added to the gem when it is released.
|
24
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
-
spec.files = Dir.chdir(__dir__) do
|
26
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
-
(File.expand_path(f) == __FILE__) ||
|
28
|
-
f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
|
29
|
-
end
|
30
|
-
end
|
31
|
-
spec.bindir = "exe"
|
32
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
33
|
-
spec.require_paths = ["lib"]
|
34
|
-
|
35
|
-
# Uncomment to register a new dependency of your gem
|
36
|
-
spec.add_dependency "selenium-webdriver", "~> 4.18"
|
37
|
-
|
38
|
-
# For more information and examples about making a new gem, check out our
|
39
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
40
|
-
end
|