|
@ -11,6 +11,10 @@ module SlackMathbot |
|
|
pixiv_url = "http://www.pixiv.net" + _match[:url][0..-2] |
|
|
pixiv_url = "http://www.pixiv.net" + _match[:url][0..-2] |
|
|
puts pixiv_url |
|
|
puts pixiv_url |
|
|
|
|
|
|
|
|
|
|
|
# Create iOS URL |
|
|
|
|
|
ios_url = "pixiv://illusts" + pixiv_url.split('=')[-1] |
|
|
|
|
|
puts ios_url |
|
|
|
|
|
|
|
|
# Scrape page title |
|
|
# Scrape page title |
|
|
title = Mechanize.new.get(pixiv_url).title |
|
|
title = Mechanize.new.get(pixiv_url).title |
|
|
puts title |
|
|
puts title |
|
@ -25,6 +29,7 @@ module SlackMathbot |
|
|
attachments: [ |
|
|
attachments: [ |
|
|
{ |
|
|
{ |
|
|
fallback: title + " - " + pixiv_url, |
|
|
fallback: title + " - " + pixiv_url, |
|
|
|
|
|
text: "<" + ios_url + "/|iOSTest" |
|
|
title: title, |
|
|
title: title, |
|
|
title_link: pixiv_url, |
|
|
title_link: pixiv_url, |
|
|
image_url: image_url, |
|
|
image_url: image_url, |
|
|