Browse Source

Testing the Member iOS Link

master
Ryan Hammett 8 years ago
parent
commit
e536e926dd
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      slack-pixiv/commands/pixiv.rb

+ 6
- 2
slack-pixiv/commands/pixiv.rb View File

@ -11,10 +11,14 @@ 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
# Create iOS Illustration URL
ios_url = "pixiv://illusts/" + pixiv_url.split('=')[-1] ios_url = "pixiv://illusts/" + pixiv_url.split('=')[-1]
puts ios_url puts ios_url
# Create iOS Member URL
ios_mem_url = "pixiv://member/" + pixiv_url.split('=')[0..-1]
puts ios_mem_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
@ -29,7 +33,7 @@ module SlackMathbot
attachments: [ attachments: [
{ {
fallback: title + " - " + pixiv_url, fallback: title + " - " + pixiv_url,
text: "<" + ios_url + "|Open in App>",
text: "<" + ios_url + "|Open Illustration in App > <" + ios_mem_url + "|Open Member in App>",
title: title, title: title,
title_link: pixiv_url, title_link: pixiv_url,
image_url: image_url, image_url: image_url,

Loading…
Cancel
Save