asset_bot 0.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/asset_bot.rb +23 -0
  3. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4bf5c38ec05452d2ba1e78e952880309a2d5b39ddf2fed5af5ad09d187daf9b4
4
+ data.tar.gz: 8b5c8515b2ff1b872ddcec09971d78a8d7211dfa9b5e30a41b4b1db2e5b4c122
5
+ SHA512:
6
+ metadata.gz: 92abb7a4b601e2984bbc523bac000ef4937615d0932197b25570cca1d67a7d801a201519bbb0cee8acc3aa2d778e2e5fcd59c6ddbc7f5db89a9bb2fafb1df872
7
+ data.tar.gz: 89581a68a8f01ca30b34a61e9aa183d3ba1df99c36fd2d6af5bd0c67576947247bd334894247061d2ccdfe53b4da51e41dec49732c2741c52a296f96213fc648
data/lib/asset_bot.rb ADDED
@@ -0,0 +1,23 @@
1
+ # Sahanon Phisetpakasit
2
+ # 6210546030
3
+ require 'net/http'
4
+ require 'uri'
5
+ require 'nokogiri'
6
+ class AssetBot
7
+ def self.asset
8
+ url = URI('https://www.set.or.th/set/commonslookup.do')
9
+ source = Net::HTTP.get(url)
10
+ parsed_data = Nokogiri::HTML.parse(source)
11
+ (0..200).step(3) do |n|
12
+ temp = URI('https://www.set.or.th/set/companyhighlight.do?symbol='+(parsed_data.css('td')[n].text))
13
+ temp_source = Net::HTTP.get(temp)
14
+ temp_data = Nokogiri::HTML.parse(temp_source)
15
+ print temp_data.css('h3').text,": ",temp_data.css('td')[6].text
16
+ puts
17
+ end
18
+ end
19
+ end
20
+
21
+
22
+
23
+
metadata ADDED
@@ -0,0 +1,42 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asset_bot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sahanon Phisetpakasit
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Prototype version of webscarping at SET website
14
+ email: sahanon.p@ku.th
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/asset_bot.rb
20
+ homepage:
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubygems_version: 3.1.4
39
+ signing_key:
40
+ specification_version: 4
41
+ summary: Print out the asset of stock in SET website
42
+ test_files: []