From 6100f9971b74ee4d3449155beb881a69017a296d Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sun, 24 Sep 2023 12:28:40 +0200 Subject: undo reactivated, object names without published date, find_object helper --- create.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'create.rb') diff --git a/create.rb b/create.rb index 0798ba1..dc1daab 100644 --- a/create.rb +++ b/create.rb @@ -37,15 +37,17 @@ post '/create' do when REPLY_REGEXP inReplyTo = line.sub(REPLY_REGEXP, '') when ATTACH_REGEXP - url = line.sub(ATTACH_REGEXP, '') + url, description = line.sub(ATTACH_REGEXP, '').split(/\s+/, 2) attachment << { 'type' => 'Document', 'mediaType' => media_type(url), - 'url' => url + 'url' => url, + 'name' => description } else # create links # single quotes in html invalidate digest, reason unknown line.split(/\s+/).each do |word| + word = word.gsub('

', '').gsub('

', '') case word when HASHTAG_REGEXP tag_url = File.join('https://social.pdp8.info', 'tags', word.sub('#', '')) -- cgit v1.2.3