brand2csv 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/bin/brand2csv +3 -1
- data/lib/brand2csv.rb +5 -4
- data/lib/brand2csv/version.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/bin/brand2csv
CHANGED
@@ -18,11 +18,13 @@ Usage:
|
|
18
18
|
brand2csv 1.10.2005-31.10.2005 #this will work as well from version 0.1.9
|
19
19
|
The results are stored in the file <date_selected>.csv.
|
20
20
|
The trademark name is either a real brand name or a link to an image.
|
21
|
+
--swiss_only Fetch only trademarks from swiss owner
|
21
22
|
EOS
|
22
23
|
end
|
23
24
|
|
24
25
|
parser = OptionParser.new
|
25
26
|
opts = {}
|
27
|
+
parser.on('--swiss_only') {|v| opts[:swiss_only] = true }
|
26
28
|
parser.on_tail('-h', '--help') { puts help; exit }
|
27
29
|
|
28
30
|
args = ARGV.dup
|
@@ -42,7 +44,7 @@ unless args.size >= 1
|
|
42
44
|
end
|
43
45
|
|
44
46
|
begin
|
45
|
-
Brand2csv::run(args[0], args[1])
|
47
|
+
Brand2csv::run(args[0], args[1], opts[:swiss_only])
|
46
48
|
rescue Interrupt
|
47
49
|
puts "Unterbrochen. Breche mit Fehler ab"
|
48
50
|
exit 1
|
data/lib/brand2csv.rb
CHANGED
@@ -89,9 +89,10 @@ module Brand2csv
|
|
89
89
|
|
90
90
|
attr_accessor :marke, :results, :timespan
|
91
91
|
|
92
|
-
def initialize(timespan, marke = nil)
|
92
|
+
def initialize(timespan, marke = nil, swiss_only=false)
|
93
93
|
@timespan = timespan
|
94
94
|
@marke = marke
|
95
|
+
@swiss_only = swiss_only
|
95
96
|
@number = nil
|
96
97
|
@results = []
|
97
98
|
@all_trademark_numbers = []
|
@@ -182,7 +183,7 @@ module Brand2csv
|
|
182
183
|
["id_swissreg:mainContent:id_txf_app_no", ""], # Gesuch Nr.
|
183
184
|
["id_swissreg:mainContent:id_txf_tm_text", "#{marke}"],
|
184
185
|
["id_swissreg:mainContent:id_txf_applicant", ""], # Inhaber/in
|
185
|
-
["id_swissreg:mainContent:id_cbxCountry", '_ALL'],
|
186
|
+
["id_swissreg:mainContent:id_cbxCountry", @swiss_only ? 'CH' : '_ALL'],
|
186
187
|
["id_swissreg:mainContent:id_txf_agent", ""], # Vertreter/in
|
187
188
|
["id_swissreg:mainContent:id_txf_licensee", ""], # Lizenznehmer
|
188
189
|
["id_swissreg:mainContent:id_txf_nizza_class", ""], # Nizza Klassifikation Nr.
|
@@ -535,8 +536,8 @@ module Brand2csv
|
|
535
536
|
end
|
536
537
|
end # class Swissreg
|
537
538
|
|
538
|
-
def Brand2csv::run(timespan, marke = 'a*')
|
539
|
-
session = Swissreg.new(timespan, marke)
|
539
|
+
def Brand2csv::run(timespan, marke = 'a*', swiss_only = false)
|
540
|
+
session = Swissreg.new(timespan, marke, swiss_only)
|
540
541
|
begin
|
541
542
|
session.parse_swissreg
|
542
543
|
session.fetchresult
|
data/lib/brand2csv/version.rb
CHANGED