Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created March 16, 2014 08:00
Show Gist options
  • Save ssig33/9579935 to your computer and use it in GitHub Desktop.
Save ssig33/9579935 to your computer and use it in GitHub Desktop.
diff --git app/models/ameblo_image.rb app/models/ameblo_image.rb
index 0c4c737..40e70fc 100644
--- app/models/ameblo_image.rb
+++ app/models/ameblo_image.rb
@@ -47,7 +47,7 @@ class AmebloImage < ActiveRecord::Base
unless a = self.where(url: url).first
alice = Mechanize.new
page = alice.get url
- image = page.root.xpath("//*[@id=\"mainPhotoInner\"]/img").first[:src]
+ image = page.root.xpath('//*[@id="post_image"]').first[:src]
m = Magick::Image.from_blob(open(image).read).first
m.format = 'PNG'
img = gyazo m.to_blob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment