lobbyliste 0.1.7 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82d4a07c31c7516b42ab77361dd6c1f50f0adddc
4
- data.tar.gz: f18023bf426686008c110f8d2ca76374be54ba2e
3
+ metadata.gz: 73c003d58cccb7ccc80e72ec7f849c52aa6e178a
4
+ data.tar.gz: b5105fe902c64a771190e62697b18f1a3fee2a67
5
5
  SHA512:
6
- metadata.gz: e7082d9a10afd459b288d0099406a076cee03f3b3f37a00cc115c45ff776ad8dfd3a341cbaa7a213726adee4f5ebf6ba8d4246bf3b4088157af8d305fa4fab37
7
- data.tar.gz: 670c75d2d93f2892bff54b0e12a53b5ae7a70add8e7fcb0c5bbb75e1a4fe1be6e0bb06820553716f503d4dc57e41f8712f11850dd7f16d18dbff8bc2c1f4b250
6
+ metadata.gz: cf2df6717d00db0e6827f355551f58f0f2455405602b9805281116267c8d3bc11a59ee013c0e234adc95543e690b28569fcc4a6acc853dd1a08fe2169fa74dc4
7
+ data.tar.gz: d55faa49852d8b9c25906b12439449710e416e50369b5a3cf32a6e8fd61f0bdb47bb5153343276b55ae4aa22ce6e45e22ffea0736c89847365cfc98cb87c0ac8
@@ -37,18 +37,20 @@ module Lobbyliste
37
37
  @pdf_link
38
38
  end
39
39
 
40
- private
41
-
42
- # Since this link changes with every new version we download the Lobbyliste website and try to extract the link
40
+ # Since the link to the PDF changes with every new version we download the Lobbyliste website and extract the link
41
+ # Use this method to extract link from different page if the bundestag website structure is changed again
42
+ # @param [String] page that will be used to extract the PDF link. May change from time to time.
43
43
  # @return [String] the link to the Lobbyliste pdf
44
- def fetch_pdf_link
45
- website = Nokogiri::HTML(open("https://www.bundestag.de/dokumente/lobbyliste"))
44
+ def fetch_pdf_link(bundestag_page = "https://www.bundestag.de/parlament/lobbyliste")
45
+ website = Nokogiri::HTML(open(bundestag_page))
46
46
  link = website.css("a[title^='Aktuelle Fassung']").first
47
47
 
48
48
  raise NoPdfLinkFound.new("Could not find link to the Lobbyist PDF on the bundestag website!") unless link
49
49
  @pdf_link = "https://bundestag.de#{link['href']}"
50
50
  end
51
51
 
52
+ private
53
+
52
54
  def http_version_of_url(url)
53
55
  url.gsub('https://', 'http://')
54
56
  end
@@ -1,3 +1,3 @@
1
1
  module Lobbyliste
2
- VERSION = "0.1.7"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lobbyliste
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthMax
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-09 00:00:00.000000000 Z
11
+ date: 2017-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.4.8
167
+ rubygems_version: 2.6.11
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Ruby crawler for the list of lobbyists published by German Bundestag