embed_html 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/embed_html.gemspec +1 -1
- data/lib/embed_html/embeder.rb +2 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'rake'
|
4
4
|
require 'echoe'
|
5
5
|
|
6
|
-
Echoe.new('embed_html', '0.2.
|
6
|
+
Echoe.new('embed_html', '0.2.2') do |p|
|
7
7
|
p.description = "Download and embed images in html using base64 data encoding"
|
8
8
|
p.summary = "Download or process a HTML page, find images there, download them and embed it into the HTML using Base64 data encoding"
|
9
9
|
p.url = "http://github.com/siuying/embed_html"
|
data/embed_html.gemspec
CHANGED
data/lib/embed_html/embeder.rb
CHANGED
@@ -3,6 +3,7 @@ require 'open-uri'
|
|
3
3
|
require 'hpricot'
|
4
4
|
require 'uri'
|
5
5
|
require 'base64'
|
6
|
+
require 'typhoeus'
|
6
7
|
|
7
8
|
module EmbedHtml
|
8
9
|
class Embeder
|
@@ -18,7 +19,7 @@ module EmbedHtml
|
|
18
19
|
|
19
20
|
def process
|
20
21
|
@logger.info "downloading url: #{@url}"
|
21
|
-
html =
|
22
|
+
html = Typhoeus::Request.get(@url.to_s).body
|
22
23
|
doc = Hpricot(html)
|
23
24
|
|
24
25
|
hydra = Typhoeus::Hydra.new(:max_concurrency => MAX_CONCURRENCY)
|