Module: Wayback::API::Archive
Instance Method Summary collapse
-
#list(url, options = {}) ⇒ Wayback::Archive
Return a list of archived pages.
-
#page(url, date = 0, options = {}) ⇒ Wayback::Page
Returns the HTML contents of an archive page, fetched by date.
Instance Method Details
#list(url, options = {}) ⇒ Wayback::Archive
Return a list of archived pages
17 18 19 |
# File 'lib/wayback/api/archive.rb', line 17 def list(url, ={}) object_from_response(Wayback::Archive, :get, "/list/timemap/link/#{url}", ) end |
#page(url, date = 0, options = {}) ⇒ Wayback::Page
Returns the HTML contents of an archive page, fetched by date
33 34 35 36 37 38 |
# File 'lib/wayback/api/archive.rb', line 33 def page(url, date=0, ={}) date = 0 if date == :first date = Time.now if date == :last date = Time.parse(date).to_i unless [Fixnum,Time,Integer].include?(date.class) object_from_response(Wayback::Page, :get, "/memento/#{date.to_i}/#{url}", ) end |