zeitungen 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16281c1f0f1c247e4f78c251d161b51fc8f34f68
4
- data.tar.gz: 5e80441f84d5a0b30ab64edc6ebf76ed74322776
3
+ metadata.gz: 3a846b2505bc2a7bf100f9b1f4a3c8641759ae3c
4
+ data.tar.gz: db99b50955e6b51b613381e4d01125ce24c5e6a3
5
5
  SHA512:
6
- metadata.gz: 06573ce06847aecad29821032f3e2f02d46378648c90c94adec967f65704d6dedf9e85fc591674ef0339de78483ceac302d840ff1eeefcec2879c4872d99b1fb
7
- data.tar.gz: e334fc59772934b99899cb1e4bc50398b66741f9efafdaf56818ed4382e31ffbeacb418bc541e6538c9bab2726d282c7eb0e39e6b5d7eef832d86b0338999935
6
+ metadata.gz: 63e38445c086d9db9852c7c1303ac76074586385a64b2b9d6c5db497751b1312712f6521e01b4dbaae8335cfa7d46c4a2da6f8a6b9cc5d8c0aea13876fd65fc6
7
+ data.tar.gz: f33fe04a75b4f3465a2cb1005857a799100c91ce6def1dcdae5f9757a1ab468be6897ad1fa6908ecdec1d002c9076f793bc7bd870f45a2f0ccfe7e352d4c7642
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
  /pkg/
10
10
  /spec/reports/
11
11
  /tmp/
12
+
13
+ execute.rb
@@ -14,6 +14,7 @@ module Zeitungen
14
14
 
15
15
  page = IndexPage.new(@url, @passwords)
16
16
  zeitungen_links = page.links(date)
17
+ # puts zeitungen_links.inspect
17
18
  queue = enqueue(zeitungen_links)
18
19
 
19
20
  if queue.size==0
@@ -35,7 +36,13 @@ module Zeitungen
35
36
  queue = Queue.new
36
37
  @zeitungen.each do |z|
37
38
  if link = zeitungen_links.find{|l| z.regexp.match l.text } # se c'è un link per il zeitungen corrente
38
- z.uri = link.uri+"\?directDownload\=true" # zeitungen.uri+"\?directDownload\=true"
39
+ uri = link.uri
40
+ if uri.host=="t.umblr.com"
41
+ h = Hash[uri.query.split("&").map{|e| e.split("=")}]
42
+ z.uri = URI(URI.unescape(h["z"])+"\?directDownload\=true")
43
+ else
44
+ z.uri = uri+"\?directDownload\=true" # zeitungen.uri+"\?directDownload\=true"
45
+ end
39
46
  filename = filename_w_date(z.final_name) # "Corriere della Sera - 2015-12-23.pdf"
40
47
 
41
48
  queue << z if !(@client.exist_in_public_dest?(filename) || @client.exist_in_private_dest?(filename))
@@ -53,7 +60,7 @@ module Zeitungen
53
60
  file = Tempfile.new('zeitungen')
54
61
  Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme=='https') do |http|
55
62
  request = Net::HTTP::Get.new(uri)
56
- puts "downloading #{z.final_name}..."
63
+ puts "downloading #{z.final_name} (#{z.uri})..."
57
64
  response = http.request request
58
65
  file.write(response.body)
59
66
  end
@@ -1,3 +1,3 @@
1
1
  module Zeitungen
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeitungen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iwan Buetti
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-07 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler