kaopun-search 0.0.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 +7 -0
- data/lib/kaopun_search.rb +36 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4c495c20c6656e03c36b631c9f306aa89df108ac9376843d4bcb94b61efb0d94
|
4
|
+
data.tar.gz: 5b846cbf6340690efa6aa3684e4c4778294357a41b6851f5157950da5f35868f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 58d43dedd7083282490ca94f1d8cdb1f1038108a61bc4442cf0d75a6056a273969ad0fe9361fb82c63e7bc650e391f86570523a6f671bd8f05b0716bb2c93103
|
7
|
+
data.tar.gz: 81b91fe100fb483dbc215e64a4e953b7208f8ef3c909f46817e96098ae6c2452a183b9e6ce08bb3dde83bf272eb87bc7148ede04bd897c475cb6c88be0de6460
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Chayapol Chaipongsawalee
|
2
|
+
# 6210545947
|
3
|
+
require "Nokogiri"
|
4
|
+
require "open-uri"
|
5
|
+
|
6
|
+
|
7
|
+
class KaopunSearch
|
8
|
+
|
9
|
+
#search only delta
|
10
|
+
def self.get_delta
|
11
|
+
doc = Nokogiri::HTML(URI.open("https://www.set.or.th/set/companyprofile.do?symbol=DELTA"))
|
12
|
+
doc.css("h3").each do |link|
|
13
|
+
puts link.content
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# search all link
|
18
|
+
def self.get_all_link
|
19
|
+
all_letter = (10...36).map{ |i| i.to_s 36 }
|
20
|
+
link = "https://www.set.or.th/set/commonslookup.do?"
|
21
|
+
all_letter.insert(0,"NUMBER")
|
22
|
+
all_letter.each do |letter|
|
23
|
+
link = "https://www.set.or.th/set/commonslookup.do?language=th&country=TH&prefix=#{letter}"
|
24
|
+
doc = Nokogiri::HTML(URI.open(link))
|
25
|
+
doc.css("tr a").each do |element|
|
26
|
+
a_tag = element["href"]
|
27
|
+
a_tag["profile"] = "highlight"
|
28
|
+
link_to_each_page = "https://www.set.or.th/#{a_tag}"
|
29
|
+
page = Nokogiri::HTML(URI.open(link_to_each_page))
|
30
|
+
asset_tri_3 = page.css("tr")[2].css("td")[-2].text
|
31
|
+
name = page.css("h3").text
|
32
|
+
puts "#{name} : #{asset_tri_3}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kaopun-search
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chayapol
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: software specification lab3 searching asset in set.or.th
|
14
|
+
email: chayapol.cha@ku.th
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/kaopun_search.rb
|
20
|
+
homepage: https://rubygems.org/gems/kaopun-search
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubygems_version: 3.2.8
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: searching!
|
43
|
+
test_files: []
|