bookcrawler 0.1.0 → 0.3.0
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 +4 -4
 - data/.gitignore +1 -0
 - data/Gemfile.lock +1 -1
 - data/README.md +1 -1
 - data/bookcrawler.gemspec +1 -1
 - data/lib/bookcrawler/client.rb +4 -1
 - data/lib/bookcrawler/version.rb +1 -1
 - metadata +2 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8bd9096eda4b3be33dac09efa7f291254327265d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3e3fafca613b43993638771b3efc4c3b09a5a884
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b0630f182788833e053cbfafe3f688d22c3f24306c51b46b7574460cea78cc204bc9ea49e532db283ce6ce82e88b198aa4d631fbda009dc0b767d8dea578e58a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 996f20892dbdc0a6c1d4e8f25faced70e95a7da1923db39341592d1f17d62ad69921797965620234a5eb360bd635de00def20d41e9aa3b5cb93c446b3de9f92a
         
     | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -40,7 +40,7 @@ book = crawler.find_by_title('A Clash of Kings') 
     | 
|
| 
       40 
40 
     | 
    
         
             
            #   cover_url: "http://...">
         
     | 
| 
       41 
41 
     | 
    
         
             
            ```
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
            You can fetch the book cover  
     | 
| 
      
 43 
     | 
    
         
            +
            You can fetch the book cover at `cover_url`. Support for covers is not official in the [Amazon Product Advertising API](https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html). The url is generated according to [this article](http://aaugh.com/imageabuse.html).
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
            This gem uses [Vacuum](https://github.com/hakanensari/vacuum) under the hood.
         
     | 
| 
       46 
46 
     | 
    
         | 
    
        data/bookcrawler.gemspec
    CHANGED
    
    | 
         @@ -9,7 +9,7 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       9 
9 
     | 
    
         
             
              spec.authors       = ["Jorge Manrubia"]
         
     | 
| 
       10 
10 
     | 
    
         
             
              spec.email         = ["jorge.manrubia@gmail.com"]
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
              spec.summary       = %q{ 
     | 
| 
      
 12 
     | 
    
         
            +
              spec.summary       = %q{Fetch books metadata using Amazon Product Advertising API}
         
     | 
| 
       13 
13 
     | 
    
         
             
              spec.description   = %q{}
         
     | 
| 
       14 
14 
     | 
    
         
             
              spec.homepage      = "https://github.com/jorgemanrubia/bookcrawler"
         
     | 
| 
       15 
15 
     | 
    
         
             
              spec.license       = "MIT"
         
     | 
    
        data/lib/bookcrawler/client.rb
    CHANGED
    
    | 
         @@ -58,9 +58,12 @@ module Bookcrawler 
     | 
|
| 
       58 
58 
     | 
    
         
             
                def create_book_from_vacuum_entry(target_entry)
         
     | 
| 
       59 
59 
     | 
    
         
             
                  Book.new asin: target_entry['ASIN'],
         
     | 
| 
       60 
60 
     | 
    
         
             
                           title: target_entry['Title'],
         
     | 
| 
       61 
     | 
    
         
            -
                           author: target_entry['Author'],
         
     | 
| 
      
 61 
     | 
    
         
            +
                           author: process_author(target_entry['Author']),
         
     | 
| 
       62 
62 
     | 
    
         
             
                           detail_page_url: target_entry['DetailPageURL']
         
     | 
| 
       63 
63 
     | 
    
         
             
                end
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
      
 65 
     | 
    
         
            +
                def process_author(author_or_authors)
         
     | 
| 
      
 66 
     | 
    
         
            +
                  [author_or_authors].flatten.join(', ')
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
       65 
68 
     | 
    
         
             
              end
         
     | 
| 
       66 
69 
     | 
    
         
             
            end
         
     | 
    
        data/lib/bookcrawler/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: bookcrawler
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jorge Manrubia
         
     | 
| 
         @@ -153,6 +153,5 @@ rubyforge_project: 
     | 
|
| 
       153 
153 
     | 
    
         
             
            rubygems_version: 2.4.5
         
     | 
| 
       154 
154 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       155 
155 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       156 
     | 
    
         
            -
            summary:  
     | 
| 
       157 
     | 
    
         
            -
              API
         
     | 
| 
      
 156 
     | 
    
         
            +
            summary: Fetch books metadata using Amazon Product Advertising API
         
     | 
| 
       158 
157 
     | 
    
         
             
            test_files: []
         
     |