diff --git a/slack-pixiv/commands/pixiv.rb b/slack-pixiv/commands/pixiv.rb index 08fad2d..e8f5f5c 100644 --- a/slack-pixiv/commands/pixiv.rb +++ b/slack-pixiv/commands/pixiv.rb @@ -11,10 +11,9 @@ module SlackMathbot pixiv_url = "http://www.pixiv.net" + _match[:url][0..-2] puts pixiv_url - # Create iOS Illustration URL - splitter = "pixiv://illusts/" + pixiv_url.split("illust_id=")[-1] - puts splitter.to_s - ios_url = splitter.slice(/(^[0-9]+$)/) + # Create iOS Illustration URL, regex pixiv_url to + # extract numbers only, such as /^[0-9]+$/ + ios_url = "pixiv://illusts/" + pixiv_url.split("illust_id=")[-1] puts ios_url