Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/flatfish/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def prep
field = ''
else
# sub tokens and gnarly MS Quotes
field = @doc.css(selector).to_s.gsub("%5BFLATFISH", '[').gsub("FLATFISH%5D", ']').gsub(/[”“]/, '"').gsub(/[‘’]/, "'")
field = @doc.css(selector).to_s.gsub("%5BFLATFISH", '[').gsub("FLATFISH%5D", ']')
end
html[@schema[i]] += field
end
Expand All @@ -95,7 +95,7 @@ def update_hrefs(css_selector)

#TODO finalize list of supported file types
href = Flatfish::Url.absolutify(a['href'], @cd)
valid_exts = ['.doc', '.docx', '.pdf', '.pptx', '.ppt', '.xls', '.xlsx']
valid_exts = ['.doc', '.docx', '.pdf', '.ppt', '.xls', '.xlsx']
if href =~ /#{@host}/ && valid_exts.include?(File.extname(href))
media = get_media(href)
href = "[FLATFISHmedia:#{media.id}FLATFISH]"
Expand Down
2 changes: 1 addition & 1 deletion lib/flatfish/pleuronectiformes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def parse(k)
begin
break if @cnt == @config['max_rows']
@cnt += 1
page = @klass.find_or_create_by_url(row[0])
page = @klass.find_or_create_by_url(row[0]) or break;
puts "Processing #{k}.#{page.id} with URL #{row[0]}"
page.setup(row, @config, @schema, @host)
page.process
Expand Down