Browse Source

Reverted to working split, need to regex numbers out of the url

master
Ryan Hammett 8 years ago
parent
commit
e77d691f40
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      slack-pixiv/commands/pixiv.rb

+ 3
- 4
slack-pixiv/commands/pixiv.rb View File

@ -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

Loading…
Cancel
Save