<commit_before>Thumbnail Scraper
============

detect, fetch and generate a thumbnail for any url

Basic usage
-------------
```ruby
require 'thumbnail_scraper'

include ThumbnailScraper
scraper = ThumbnailScraper.new
image = scraper.image_to_thumbnail_url("http://www.monibuds.com/")
thumbnail_url = image.url
```

ThumbnailScraper#image_to_thumbnail_url method returns Image object, which contains its size and url.

Suggested usage
---------------

We encourage you to use it with delayed_job as jobs queue and dragonfly as image storage tool.<commit_msg>DelayedJob sample<commit_after>Thumbnail Scraper
============

detect, fetch and generate a thumbnail for any url

Basic usage
-------------
```ruby
require 'thumbnail_scraper'

include ThumbnailScraper
scraper = ThumbnailScraper.new
image = scraper.image_to_thumbnail_url("http://www.monibuds.com/")
thumbnail_url = image.url
```

ThumbnailScraper#image_to_thumbnail_url method returns Image object, which contains its size and url.

Suggested usage
---------------

We encourage you to use it with delayed_job as jobs queue and dragonfly as image storage tool. Your job could look like following:

```ruby
require 'thumbnail_scraper'

module Jobs
  class ScrapThumbnailJob < Struct.new(:page)
    def perform
      scraper = ::ThumbnailScraper::ThumbnailScraper.new
      image = scraper.image_to_thumbnail_for_url(page.url)
      page.thumbnail_url = image.url.to_s
      page.save!
    end 
  end 
end
```
{'fraction_non_alphanumeric': 0.11929107021131562, 'fraction_numerical': 0.0, 'mean_word_length': 4.079584775086505, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6211818', 'n_tokens_mistral': 471, 'n_tokens_neox': 456, 'n_words': 134}