apollo-crawler 0.1.3 → 0.1.4
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 +8 -8
 - data/bin/apollo-crawler +405 -404
 - data/lib/apollo_crawler.rb +20 -20
 - data/lib/apollo_crawler/cache.rb +34 -34
 - data/lib/apollo_crawler/caches/factory.rb +30 -18
 - data/lib/apollo_crawler/caches/filesystem_cache.rb +34 -30
 - data/lib/apollo_crawler/caches/memory_cache.rb +43 -43
 - data/lib/apollo_crawler/caches/null_cache.rb +30 -30
 - data/lib/apollo_crawler/crawler.rb +127 -128
 - data/lib/apollo_crawler/crawler_template.rb +24 -24
 - data/lib/apollo_crawler/crawlers/alexa_com/alexa.rb +26 -26
 - data/lib/apollo_crawler/crawlers/firmy_cz/firmy.rb +26 -26
 - data/lib/apollo_crawler/crawlers/google_com/google.rb +26 -26
 - data/lib/apollo_crawler/crawlers/slashdot_org/slashdot.rb +26 -26
 - data/lib/apollo_crawler/crawlers/stackoverflow_com/stackoverflow.rb +26 -26
 - data/lib/apollo_crawler/crawlers/xkcd_com/xkcd.rb +35 -35
 - data/lib/apollo_crawler/crawlers/ycombinator_com/hacker_news.rb +26 -26
 - data/lib/apollo_crawler/formatter.rb +6 -6
 - data/lib/apollo_crawler/formatters/formatter_json.rb +17 -17
 - data/lib/apollo_crawler/formatters/formatter_plain.rb +17 -17
 - data/lib/apollo_crawler/formatters/formatter_table.rb +33 -33
 - data/lib/apollo_crawler/version.rb +2 -2
 - metadata +13 -13
 
| 
         @@ -1,17 +1,17 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'json'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            require File.join(File.dirname(__FILE__), '..', 'formatter') 
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            module Apollo
         
     | 
| 
       6 
     | 
    
         
            -
            	module Formatters
         
     | 
| 
       7 
     | 
    
         
            -
            		class Json < Formatter
         
     | 
| 
       8 
     | 
    
         
            -
            			def format(obj)
         
     | 
| 
       9 
     | 
    
         
            -
            				return Json.format(obj)
         
     | 
| 
       10 
     | 
    
         
            -
            			end
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            			def self.format(obj)
         
     | 
| 
       13 
     | 
    
         
            -
            				 return JSON.pretty_generate(obj)
         
     | 
| 
       14 
     | 
    
         
            -
            			end
         
     | 
| 
       15 
     | 
    
         
            -
            		end
         
     | 
| 
       16 
     | 
    
         
            -
            	end # Formatters
         
     | 
| 
       17 
     | 
    
         
            -
            end # Apollo
         
     | 
| 
      
 1 
     | 
    
         
            +
            require 'json'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require File.join(File.dirname(__FILE__), '..', 'formatter') 
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module Apollo
         
     | 
| 
      
 6 
     | 
    
         
            +
            	module Formatters
         
     | 
| 
      
 7 
     | 
    
         
            +
            		class Json < Formatter
         
     | 
| 
      
 8 
     | 
    
         
            +
            			def format(obj)
         
     | 
| 
      
 9 
     | 
    
         
            +
            				return Json.format(obj)
         
     | 
| 
      
 10 
     | 
    
         
            +
            			end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            			def self.format(obj)
         
     | 
| 
      
 13 
     | 
    
         
            +
            				 return JSON.pretty_generate(obj)
         
     | 
| 
      
 14 
     | 
    
         
            +
            			end
         
     | 
| 
      
 15 
     | 
    
         
            +
            		end
         
     | 
| 
      
 16 
     | 
    
         
            +
            	end # Formatters
         
     | 
| 
      
 17 
     | 
    
         
            +
            end # Apollo
         
     | 
| 
         @@ -1,17 +1,17 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'awesome_print'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            require File.join(File.dirname(__FILE__), '..', 'formatter') 
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            module Apollo
         
     | 
| 
       6 
     | 
    
         
            -
            	module Formatters
         
     | 
| 
       7 
     | 
    
         
            -
            		class Plain < Formatter
         
     | 
| 
       8 
     | 
    
         
            -
            			def format(obj)
         
     | 
| 
       9 
     | 
    
         
            -
            				return Plain.format(obj)
         
     | 
| 
       10 
     | 
    
         
            -
            			end
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            			def self.format(obj)
         
     | 
| 
       13 
     | 
    
         
            -
            				 return obj.inspect
         
     | 
| 
       14 
     | 
    
         
            -
            			end
         
     | 
| 
       15 
     | 
    
         
            -
            		end
         
     | 
| 
       16 
     | 
    
         
            -
            	end # Formatters
         
     | 
| 
       17 
     | 
    
         
            -
            end # Apollo
         
     | 
| 
      
 1 
     | 
    
         
            +
            require 'awesome_print'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require File.join(File.dirname(__FILE__), '..', 'formatter') 
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module Apollo
         
     | 
| 
      
 6 
     | 
    
         
            +
            	module Formatters
         
     | 
| 
      
 7 
     | 
    
         
            +
            		class Plain < Formatter
         
     | 
| 
      
 8 
     | 
    
         
            +
            			def format(obj)
         
     | 
| 
      
 9 
     | 
    
         
            +
            				return Plain.format(obj)
         
     | 
| 
      
 10 
     | 
    
         
            +
            			end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            			def self.format(obj)
         
     | 
| 
      
 13 
     | 
    
         
            +
            				 return obj.inspect
         
     | 
| 
      
 14 
     | 
    
         
            +
            			end
         
     | 
| 
      
 15 
     | 
    
         
            +
            		end
         
     | 
| 
      
 16 
     | 
    
         
            +
            	end # Formatters
         
     | 
| 
      
 17 
     | 
    
         
            +
            end # Apollo
         
     | 
| 
         @@ -1,33 +1,33 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'terminal-table'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            require File.join(File.dirname(__FILE__), '..', 'formatter') 
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            module Apollo
         
     | 
| 
       6 
     | 
    
         
            -
            	module Formatters
         
     | 
| 
       7 
     | 
    
         
            -
            		class Table < Formatter
         
     | 
| 
       8 
     | 
    
         
            -
            			def format(obj)
         
     | 
| 
       9 
     | 
    
         
            -
            				return Table.format(obj)
         
     | 
| 
       10 
     | 
    
         
            -
            			end
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            			def self.format(obj)
         
     | 
| 
       13 
     | 
    
         
            -
            				headings = []
         
     | 
| 
       14 
     | 
    
         
            -
            				if(obj[:data].length > 0)
         
     | 
| 
       15 
     | 
    
         
            -
            					headings = obj[:data][0].keys
         
     | 
| 
       16 
     | 
    
         
            -
            				end
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
            				rows = []
         
     | 
| 
       19 
     | 
    
         
            -
            				obj[:data].each do |line|
         
     | 
| 
       20 
     | 
    
         
            -
            					data = []
         
     | 
| 
       21 
     | 
    
         
            -
            					headings.each do |column|
         
     | 
| 
       22 
     | 
    
         
            -
            						data << line[column]
         
     | 
| 
       23 
     | 
    
         
            -
            					end
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            					rows << data
         
     | 
| 
       26 
     | 
    
         
            -
            				end
         
     | 
| 
       27 
     | 
    
         
            -
            				
         
     | 
| 
       28 
     | 
    
         
            -
            				table = Terminal::Table.new :headings => headings, :rows => rows
         
     | 
| 
       29 
     | 
    
         
            -
            				return table
         
     | 
| 
       30 
     | 
    
         
            -
            			end
         
     | 
| 
       31 
     | 
    
         
            -
            		end
         
     | 
| 
       32 
     | 
    
         
            -
            	end # Formatters
         
     | 
| 
       33 
     | 
    
         
            -
            end # Apollo
         
     | 
| 
      
 1 
     | 
    
         
            +
            require 'terminal-table'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require File.join(File.dirname(__FILE__), '..', 'formatter') 
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module Apollo
         
     | 
| 
      
 6 
     | 
    
         
            +
            	module Formatters
         
     | 
| 
      
 7 
     | 
    
         
            +
            		class Table < Formatter
         
     | 
| 
      
 8 
     | 
    
         
            +
            			def format(obj)
         
     | 
| 
      
 9 
     | 
    
         
            +
            				return Table.format(obj)
         
     | 
| 
      
 10 
     | 
    
         
            +
            			end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            			def self.format(obj)
         
     | 
| 
      
 13 
     | 
    
         
            +
            				headings = []
         
     | 
| 
      
 14 
     | 
    
         
            +
            				if(obj[:data].length > 0)
         
     | 
| 
      
 15 
     | 
    
         
            +
            					headings = obj[:data][0].keys
         
     | 
| 
      
 16 
     | 
    
         
            +
            				end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            				rows = []
         
     | 
| 
      
 19 
     | 
    
         
            +
            				obj[:data].each do |line|
         
     | 
| 
      
 20 
     | 
    
         
            +
            					data = []
         
     | 
| 
      
 21 
     | 
    
         
            +
            					headings.each do |column|
         
     | 
| 
      
 22 
     | 
    
         
            +
            						data << line[column]
         
     | 
| 
      
 23 
     | 
    
         
            +
            					end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            					rows << data
         
     | 
| 
      
 26 
     | 
    
         
            +
            				end
         
     | 
| 
      
 27 
     | 
    
         
            +
            				
         
     | 
| 
      
 28 
     | 
    
         
            +
            				table = Terminal::Table.new :headings => headings, :rows => rows
         
     | 
| 
      
 29 
     | 
    
         
            +
            				return table
         
     | 
| 
      
 30 
     | 
    
         
            +
            			end
         
     | 
| 
      
 31 
     | 
    
         
            +
            		end
         
     | 
| 
      
 32 
     | 
    
         
            +
            	end # Formatters
         
     | 
| 
      
 33 
     | 
    
         
            +
            end # Apollo
         
     | 
| 
         @@ -1,3 +1,3 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            module Apollo
         
     | 
| 
       2 
     | 
    
         
            -
            	VERSION = '0.1. 
     | 
| 
      
 1 
     | 
    
         
            +
            module Apollo
         
     | 
| 
      
 2 
     | 
    
         
            +
            	VERSION = '0.1.4'
         
     | 
| 
       3 
3 
     | 
    
         
             
            end # Apollo
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: apollo-crawler
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Tomas Korcak
         
     | 
| 
         @@ -199,25 +199,25 @@ executables: 
     | 
|
| 
       199 
199 
     | 
    
         
             
            extensions: []
         
     | 
| 
       200 
200 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       201 
201 
     | 
    
         
             
            files:
         
     | 
| 
       202 
     | 
    
         
            -
            - ./lib/apollo_crawler/ 
     | 
| 
      
 202 
     | 
    
         
            +
            - ./lib/apollo_crawler/formatters/formatter_plain.rb
         
     | 
| 
      
 203 
     | 
    
         
            +
            - ./lib/apollo_crawler/formatters/formatter_json.rb
         
     | 
| 
      
 204 
     | 
    
         
            +
            - ./lib/apollo_crawler/formatters/formatter_table.rb
         
     | 
| 
      
 205 
     | 
    
         
            +
            - ./lib/apollo_crawler/version.rb
         
     | 
| 
       203 
206 
     | 
    
         
             
            - ./lib/apollo_crawler/caches/factory.rb
         
     | 
| 
       204 
     | 
    
         
            -
            - ./lib/apollo_crawler/caches/filesystem_cache.rb
         
     | 
| 
       205 
     | 
    
         
            -
            - ./lib/apollo_crawler/caches/memory_cache.rb
         
     | 
| 
       206 
207 
     | 
    
         
             
            - ./lib/apollo_crawler/caches/null_cache.rb
         
     | 
| 
      
 208 
     | 
    
         
            +
            - ./lib/apollo_crawler/caches/memory_cache.rb
         
     | 
| 
      
 209 
     | 
    
         
            +
            - ./lib/apollo_crawler/caches/filesystem_cache.rb
         
     | 
| 
      
 210 
     | 
    
         
            +
            - ./lib/apollo_crawler/crawler_template.rb
         
     | 
| 
       207 
211 
     | 
    
         
             
            - ./lib/apollo_crawler/crawler.rb
         
     | 
| 
       208 
     | 
    
         
            -
            - ./lib/apollo_crawler/crawlers/alexa_com/alexa.rb
         
     | 
| 
       209 
     | 
    
         
            -
            - ./lib/apollo_crawler/crawlers/firmy_cz/firmy.rb
         
     | 
| 
       210 
     | 
    
         
            -
            - ./lib/apollo_crawler/crawlers/google_com/google.rb
         
     | 
| 
       211 
     | 
    
         
            -
            - ./lib/apollo_crawler/crawlers/slashdot_org/slashdot.rb
         
     | 
| 
       212 
212 
     | 
    
         
             
            - ./lib/apollo_crawler/crawlers/stackoverflow_com/stackoverflow.rb
         
     | 
| 
       213 
213 
     | 
    
         
             
            - ./lib/apollo_crawler/crawlers/xkcd_com/xkcd.rb
         
     | 
| 
      
 214 
     | 
    
         
            +
            - ./lib/apollo_crawler/crawlers/google_com/google.rb
         
     | 
| 
      
 215 
     | 
    
         
            +
            - ./lib/apollo_crawler/crawlers/slashdot_org/slashdot.rb
         
     | 
| 
      
 216 
     | 
    
         
            +
            - ./lib/apollo_crawler/crawlers/firmy_cz/firmy.rb
         
     | 
| 
      
 217 
     | 
    
         
            +
            - ./lib/apollo_crawler/crawlers/alexa_com/alexa.rb
         
     | 
| 
       214 
218 
     | 
    
         
             
            - ./lib/apollo_crawler/crawlers/ycombinator_com/hacker_news.rb
         
     | 
| 
       215 
     | 
    
         
            -
            - ./lib/apollo_crawler/crawler_template.rb
         
     | 
| 
       216 
219 
     | 
    
         
             
            - ./lib/apollo_crawler/formatter.rb
         
     | 
| 
       217 
     | 
    
         
            -
            - ./lib/apollo_crawler/ 
     | 
| 
       218 
     | 
    
         
            -
            - ./lib/apollo_crawler/formatters/formatter_plain.rb
         
     | 
| 
       219 
     | 
    
         
            -
            - ./lib/apollo_crawler/formatters/formatter_table.rb
         
     | 
| 
       220 
     | 
    
         
            -
            - ./lib/apollo_crawler/version.rb
         
     | 
| 
      
 220 
     | 
    
         
            +
            - ./lib/apollo_crawler/cache.rb
         
     | 
| 
       221 
221 
     | 
    
         
             
            - ./lib/apollo_crawler.rb
         
     | 
| 
       222 
222 
     | 
    
         
             
            - bin/apollo-crawler
         
     | 
| 
       223 
223 
     | 
    
         
             
            homepage: https://github.com/korczis/apollo-crawler
         
     |