manga-crawler 0.1.1 → 0.1.2

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.
@@ -1,11 +1,14 @@
1
1
  require 'nokogiri'
2
2
  require 'open-uri'
3
+ require 'time'
3
4
 
4
5
  module MangaCrawler
5
6
  class Crawler
6
7
 
7
8
  def get_mangas index_website
8
9
 
10
+ start_time = Time.now
11
+
9
12
  result = Array.new
10
13
 
11
14
  html_index = Nokogiri::HTML(open(index_website.params.current_url))
@@ -22,6 +25,11 @@ module MangaCrawler
22
25
  #if has a css_pagination, use recursion
23
26
  #example: result += get_mangas next_link, css_path, css_pagination
24
27
 
28
+ end_time = Time.now
29
+
30
+ puts "\nIndex completed!"
31
+ puts "Elapsed time: #{end_time-start_time} seconds."
32
+
25
33
  return result
26
34
  end
27
35
 
@@ -33,6 +41,8 @@ module MangaCrawler
33
41
 
34
42
  def get_pages chapter_website, css_image_path
35
43
 
44
+ start_time = Time.now
45
+
36
46
  result = Array.new
37
47
 
38
48
  pages_links = get_pages_links_from_chapter chapter_website
@@ -46,6 +56,11 @@ module MangaCrawler
46
56
  result.push( get_image_from_page Website::Page.new(params) )
47
57
  end
48
58
 
59
+ end_time = Time.now
60
+
61
+ puts "\mCollect pages completed!"
62
+ puts "Elapsed time: #{end_time-start_time} seconds."
63
+
49
64
  return result
50
65
 
51
66
  end
@@ -1,3 +1,3 @@
1
1
  module MangaCrawler
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manga-crawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler