Skip to content

Instantly share code, notes, and snippets.

@note103
Last active September 13, 2018 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save note103/c187beb6dd21e1868b11a6a8fa93c990 to your computer and use it in GitHub Desktop.
Save note103/c187beb6dd21e1868b11a6a8fa93c990 to your computer and use it in GitHub Desktop.
#!/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