Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
added bin tab
Browse files Browse the repository at this point in the history
  • Loading branch information
mberlanda committed Mar 21, 2016
1 parent df8e20d commit 74f9e53
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_BIN: bin
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ DEPENDENCIES
byebug
nokogiri
test-unit

BUNDLED WITH
1.10.6
16 changes: 16 additions & 0 deletions bin/bundler
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('bundler', 'bundler')
16 changes: 16 additions & 0 deletions bin/byebug
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'byebug' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('byebug', 'byebug')
16 changes: 16 additions & 0 deletions bin/nokogiri
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'nokogiri' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('nokogiri', 'nokogiri')
9 changes: 5 additions & 4 deletions lib/agenzia_entrate/ae_scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ class AeScraper
HOME_URL = 'https://telematici.agenziaentrate.gov.it/VerificaCF/Scegli.do?parameter=verificaCfPf'
USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0'
BASE_URL = 'https://telematici.agenziaentrate.gov.it/VerificaCF/AjaxOptionListComuni.do?prov='

class << self

def execute
cities = []
province_list.each do |prov, name|
cities << cities_list(prov, name)
end

cities
end

def province_list
Expand All @@ -37,13 +38,13 @@ def province_list
def cities_list prov, prov_name
result = []
url = BASE_URL + prov
cities = open(HOME_URL, "User-Agent" => USER_AGENT ){|f| f.read}
cities = open(url, "User-Agent" => USER_AGENT ){|f| f.read}
doc = Nokogiri::XML(cities)
doc.css('comuneImpl').each do |comune|
result << AeCity.new(comune.css(name="dizione").text, comune.css(name="codCat").text, prov, prov_name)
end
result
end


end
end
2 changes: 1 addition & 1 deletion lib/istat/parse_from_log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class CapLog

attr_reader :list
ROOT = File.expand_path("..", File.join(File.dirname(__FILE__)))
ROOT = File.expand_path("../..", File.join(File.dirname(__FILE__)))

def initialize file_name
file = File.open(File.join(ROOT, 'data', file_name)).read
Expand Down

0 comments on commit 74f9e53

Please sign in to comment.