figured out phantom?
This commit is contained in:
parent
c90721ad5c
commit
7e182b8beb
1 changed files with 1 additions and 6 deletions
|
@ -1,14 +1,9 @@
|
||||||
require 'phantomjs'
|
|
||||||
|
|
||||||
# app/workers/grab_map_screenshot_worker.rb
|
# app/workers/grab_map_screenshot_worker.rb
|
||||||
class GrabMapScreenshotWorker
|
class GrabMapScreenshotWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
def perform(map_id)
|
def perform(map_id)
|
||||||
imgBase64 = ''
|
imgBase64 = `phantomjs ./script/phantomjs-save-screenshot.js #{map_id}`
|
||||||
Phantomjs.run('./script/phantomjs-save-screenshot.js', map_id.to_s) { |line|
|
|
||||||
imgBase64 << line
|
|
||||||
}
|
|
||||||
map = Map.find(map_id)
|
map = Map.find(map_id)
|
||||||
map.decode_base64(imgBase64)
|
map.decode_base64(imgBase64)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue