-
-
Save note103/c187beb6dd21e1868b11a6a8fa93c990 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'uri' | |
require 'date' | |
prj = ARGV[0] | |
msg = ARGV[1] | |
exit if ARGV.length == 0 | |
msg = msg.gsub(/ /, ' ') | |
msg = URI.encode(msg) | |
d = Date.today.to_s | |
url = 'https://scrapbox.io/' + prj + '/' + d + '?body=' + msg | |
url.gsub!(/\(/, '\(') | |
url.gsub!(/\)/, '\)') | |
url.gsub!(/\</, '\<') | |
url.gsub!(/\>/, '\>') | |
url.gsub!(/\&/, '%26') | |
system("open " + url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment