busgogo 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/executable.rb +26 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b9fd186d60bfba40aa0a95aa6d48c3d385cd9c3
|
4
|
+
data.tar.gz: e3443ee21cd1e6dc12c71fb20f7920f2b33ddcb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2dd08708527e1c1a3769803289a8fa821caef1dec21219a060adc84188260a2c4223cdb091118f3ee9a8d99e02fd7ea88a7e51a153ef57d9c763b45e1ca30d8
|
7
|
+
data.tar.gz: 5ffd9c2491c068e02c1f39d776e21528fecaa00c466e80cac96a3f7ce89ae3fe90f4042e850c983a5cf6df5438a11c61bb333fe9018795137a6c19b1a68ab34a
|
data/bin/executable.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../lib/scraper.rb'
|
2
|
+
usage = []
|
3
|
+
usage << "\n Usage : executable [number] .\n"
|
4
|
+
usage << "\nNumber 1 : Hsinchu bus\' stations."
|
5
|
+
usage << "\n Number 2 : Get bus stataion names."
|
6
|
+
usage << "\n Number 3 : Get bus stataion information in detail."
|
7
|
+
usage << "\n Number 4 : Get file (bus stataion information)bus."
|
8
|
+
fail ArgumentError, usage if ARGV.count != 1
|
9
|
+
number = ARGV[0]
|
10
|
+
scmachine = WebScraper.new
|
11
|
+
structure_output = scmachine.getwebstructure('http://www.hcbus.com.tw')
|
12
|
+
bus_station = scmachine.busstation
|
13
|
+
information = scmachine.tmp_selectstation
|
14
|
+
case number
|
15
|
+
when '1'
|
16
|
+
File.write('Structure.txt', structure_output)
|
17
|
+
when '2'
|
18
|
+
bus_station.each { |value| puts value }
|
19
|
+
when '3'
|
20
|
+
puts information
|
21
|
+
when '4'
|
22
|
+
File.write('Output.txt', information)
|
23
|
+
puts 'Please check data in Output.txt file'
|
24
|
+
else
|
25
|
+
puts '(1~4) Error input : you key in No ' << number.to_s
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: busgogo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mavis Cheng (Cheng SyunWei), Yen Wei ,Wu ChiaChun
|
@@ -12,13 +12,16 @@ date: 2014-10-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description: We use Hsinzhu Bus Website because we often take hsinzhu bus to somewhere. Everytime we are heading for somewhere, we go to their website(http://www.hcbus.com.tw/) to get information about their service station, time, and route. Therefore, we think it will be convenience for us to use web scraper to get specific information we want.
|
14
14
|
email: wei.yen.0718@gmail.com
|
15
|
-
executables:
|
15
|
+
executables:
|
16
|
+
- executable.rb
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
19
|
files:
|
19
20
|
- lib/scraper.rb
|
21
|
+
- bin/executable.rb
|
20
22
|
homepage: http://rubygems.org/gems/busgogo
|
21
|
-
licenses:
|
23
|
+
licenses:
|
24
|
+
- WEI
|
22
25
|
metadata: {}
|
23
26
|
post_install_message:
|
24
27
|
rdoc_options: []
|
@@ -36,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
39
|
version: '0'
|
37
40
|
requirements: []
|
38
41
|
rubyforge_project:
|
39
|
-
rubygems_version: 2.
|
42
|
+
rubygems_version: 2.1.9
|
40
43
|
signing_key:
|
41
44
|
specification_version: 4
|
42
45
|
summary: BusGoGo
|