From e77d691f4050c4c3bbff19431336f1ae70153c18 Mon Sep 17 00:00:00 2001 From: Ryan Hammett Date: Mon, 1 Feb 2016 16:07:13 -0500 Subject: [PATCH] Reverted to working split, need to regex numbers out of the url --- slack-pixiv/commands/pixiv.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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