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
|
||||
class GrabMapScreenshotWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform(map_id)
|
||||
imgBase64 = ''
|
||||
Phantomjs.run('./script/phantomjs-save-screenshot.js', map_id.to_s) { |line|
|
||||
imgBase64 << line
|
||||
}
|
||||
imgBase64 = `phantomjs ./script/phantomjs-save-screenshot.js #{map_id}`
|
||||
map = Map.find(map_id)
|
||||
map.decode_base64(imgBase64)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue