wayback_machine_downloader 0.1.14 → 0.1.15

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: f1881209fc71899da6aaca40f4236ede10fe97e2
4
- data.tar.gz: 1ec42d7e677b4f483f2082acf27ead35f02dd6ae
3
+ metadata.gz: 1c75d1b38ffdde3e772978f2edeb21361de0b9b8
4
+ data.tar.gz: 56740a8edd14d39ac03c2096323ccbdd35487c3d
5
5
  SHA512:
6
- metadata.gz: 90961f854c102cb2f20374bf98c0e6952ef86e314ee3d1bd576a700cd824cc7180004ece354809f6a2b1f24631948eecf468fe2ae3182adda3d53ae6ad56318f
7
- data.tar.gz: 82f426b368677b4744abc4dc4aa94799c2493f9b1c3ed8fe5f369c1d208034dc6d6ba4277d0ecf9f5d76b53e2a3e78d4a73ab442d8999d9f9bac87989e86bcd7
6
+ metadata.gz: 858b0a193b31618c9ece58b00158494d2bc2b6921ffa197f4b33d35427a223d55b9c2891458621071fbe7f92096c0a42697f3a13f88a9fdac1480c7fe2c3072f
7
+ data.tar.gz: b49b27bd0065c8d5fc40af979386c9645b1d367db18c0089108f5185eb3f196f3b61058af37017287f111327054809fade9fce0a8f85ee76d94d49806de80416
@@ -16,11 +16,17 @@ option_parser = OptionParser.new do |opts|
16
16
  opts.on("-t", "--timestamp TIMESTAMP", Integer, "Only files on or before timestamp supplied (ie. 20150806225358)") do |t|
17
17
  options[:timestamp] = t
18
18
  end
19
+
20
+ opts.on("-v", "--version", "Display version") do |t|
21
+ options[:version] = t
22
+ end
19
23
  end.parse!
20
24
 
21
25
  if base_url = ARGV[0]
22
26
  wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp]
23
27
  wayback_machine_downloader.download_files
28
+ elsif options[:version]
29
+ puts WaybackMachineDownloader::VERSION
24
30
  else
25
31
  puts "You need to specify a website to backup. (e.g., http://example.com)"
26
32
  puts "Run `wayback_machine_downloader --help` for more help."
@@ -4,7 +4,7 @@ require_relative 'wayback_machine_downloader/tidy_bytes'
4
4
 
5
5
  class WaybackMachineDownloader
6
6
 
7
- VERSION = "0.1.14"
7
+ VERSION = "0.1.15"
8
8
 
9
9
  attr_accessor :base_url, :timestamp
10
10
 
@@ -79,8 +79,8 @@ class WaybackMachineDownloader
79
79
  file_path = backup_path + file_path_elements[0..-1].join('/')
80
80
  end
81
81
  unless File.exists? file_path
82
- structure_dir_path dir_path
83
82
  begin
83
+ structure_dir_path dir_path
84
84
  open(file_path, "wb") do |file|
85
85
  begin
86
86
  open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
@@ -102,7 +102,7 @@ class WaybackMachineDownloader
102
102
  end
103
103
  end
104
104
  puts
105
- puts "Download complete, saved in #{backup_path}. (#{file_list_curated.size} files)"
105
+ puts "Download complete, saved in #{backup_path} (#{file_list_curated.size} files)"
106
106
  end
107
107
 
108
108
  def structure_dir_path dir_path
@@ -116,7 +116,7 @@ class WaybackMachineDownloader
116
116
  FileUtils::mv file_already_existing, file_already_existing_temporary
117
117
  FileUtils::mkdir_p file_already_existing
118
118
  FileUtils::mv file_already_existing_temporary, file_already_existing_permanent
119
- puts "#{file_already_existing} -> #{file_already_existing_permanent}"
119
+ puts "#{file_already_existing} -> #{file_already_existing_permanent}"
120
120
  structure_dir_path dir_path
121
121
  end
122
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wayback_machine_downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - hartator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-22 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry-rescue