summaryrefslogtreecommitdiff
path: root/create.rb
diff options
context:
space:
mode:
Diffstat (limited to 'create.rb')
-rw-r--r--create.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/create.rb b/create.rb
index 8e221c8..40e1357 100644
--- a/create.rb
+++ b/create.rb
@@ -4,6 +4,7 @@ ATTACH_REGEXP = /^attach:\s+/i
URL_REGEXP = %r{\Ahttps?://\S+\Z}
MENTION_REGEXP = /\A@\w+@\S+\Z/
HASHTAG_REGEXP = /\A#\w+\Z/
+# COMMENT_REGEXP = /^<!*--/
post '/create' do
protected!
@@ -18,6 +19,10 @@ post '/create' do
request.body.read.each_line do |line|
line.chomp!
case line
+ when /^<!--$/
+ next
+ when /^-->$/
+ next
when TO_REGEXP
line.sub(TO_REGEXP, '').split(/\s+/).each do |word|
case word
@@ -71,9 +76,10 @@ post '/create' do
object['inReplyTo'] = inReplyTo unless inReplyTo.empty?
object['attachment'] = attachment unless attachment.empty?
object['tag'] = tag unless tag.empty?
- jj object
+ # p to
+ # jj object
- # create_activity 'Create', object, to
+ create_activity 'Create', object, to
200
end