wayback_machine_downloader 0.1.1 → 0.1.2

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: 91eec0342f87b1dc0dfe58b56a337b0199ed7758
4
- data.tar.gz: 6a4d3ff5684145537c80f10e1de37bc09053dc05
3
+ metadata.gz: 77db4ae324d457ea724d2316c75e2221b4971279
4
+ data.tar.gz: f274b7de7e8b2948a5eb2b9bd207ecd5da5bf832
5
5
  SHA512:
6
- metadata.gz: 66ced8f29f58235cfc7b0452a17322f31c3bef0efaa0037747684363089e81041b6231a3549a94300e21d3feb80a9e85bd4903cddca51a25610b010a63f039de
7
- data.tar.gz: cdb6adec100845044a0d8b3c67c4f8155309aa7423f67f376bb56ff312fc34c375249ae60698b7d570c5017b0fe928215010c04b0af9fe7d9c81ab2340e07544
6
+ metadata.gz: f78bf1585bb402a71e6970b084085369c836168379003555d61525eb19bb35ed7acb34510e36ea52611cf417b600e175f345ce1317e1db4c8c53684414d37557
7
+ data.tar.gz: f2f14bf88f8e8726c48e850ec91eea1a9055e8aabf6a569e1972cd3b67cc69a094ba1c7603b4178378d3a7cd3fdec99930382c5396c4ad2fbcb21c9b45a73e03
@@ -1,5 +1,28 @@
1
+ require 'open-uri'
2
+
1
3
  class WaybackMachineDownloader
2
- def self.hi name
3
- puts "Hello world! #{name}"
4
+
5
+ attr_accessor :base_url
6
+
7
+ def initialize params
8
+ @base_url = params[:base_url]
9
+ end
10
+
11
+ def file_list_curated
12
+ file_list_raw = open "http://web.archive.org/web/*/#{@base_url}/*"
13
+ file_list_curated = Hash.new
14
+ file_list_raw.each_line do |line|
15
+ line = line.split(' ')
16
+ timestamp = line[1].to_i
17
+ file_url = line[2]
18
+ if file_list_curated[file_url]
19
+ unless file_list_curated[file_url] > timestamp
20
+ file_list_curated[file_url] = timestamp
21
+ end
22
+ else
23
+ file_list_curated[file_url] = timestamp
24
+ end
25
+ end
26
+ file_list_curated
4
27
  end
5
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wayback_machine_downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - hartator
@@ -9,7 +9,35 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-07-25 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry-rescue
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry-stack_explorer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.4'
13
41
  description: Download any website from the Wayback Machine. Wayback Machine by Internet
14
42
  Archive (archive.org) is an awesome tool to view any website at any point of time
15
43
  but lacks an export feature. Wayback Machine Downloader brings exactly this.