Skip to content

Instantly share code, notes, and snippets.

@gn-spawn
Created November 8, 2017 09:31
Show Gist options
  • Save gn-spawn/fcdd13c7c38b18b7d9db78a22de2048e to your computer and use it in GitHub Desktop.
Save gn-spawn/fcdd13c7c38b18b7d9db78a22de2048e to your computer and use it in GitHub Desktop.
require 'crowi'
require 'sinatra'
require 'date'
client = Crowi::Client.new(base_url: "http://crowi.mlab.im.dendai.ac.jp/", access_token: "HOGE")
# Create page
post '/create' do
page = client.create_page("/日誌/#{Date.today}", params[:markdown]).body['page']
puts page
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment