summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-07-24 02:46:05 +0200
committerpdp8 <pdp8@pdp8.info>2023-07-24 02:46:05 +0200
commita509c55faca368709044133199f71fb862b1e605 (patch)
tree9c53d06a4f26e6ccf8635278b8eb56c4a62403f3 /helpers.rb
parent3c38f81b8a145778d4329c6be4c91baa00ca0d48 (diff)
html output removed
Diffstat (limited to 'helpers.rb')
-rw-r--r--helpers.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/helpers.rb b/helpers.rb
index 0db6566..94ec2e1 100644
--- a/helpers.rb
+++ b/helpers.rb
@@ -24,6 +24,8 @@ helpers do
def save_object(object, box)
object = fetch(object) if object.is_a? String and object.match(/^http/)
+ return unless object
+
object['@context'] = 'https://www.w3.org/ns/activitystreams'
basename = "#{object['published']}_#{mention(object['attributedTo'])}.json"
object_rel_path = File.join 'object', object['type'].downcase, basename
@@ -71,8 +73,7 @@ helpers do
def curl(ext, url)
p url
- # p "/run/current-system/sw/bin/curl --fail-with-body -sSL #{ext} #{url}"
- response = `/run/current-system/sw/bin/curl --fail-with-body -sSL #{ext} #{url}`
+ response = `/run/current-system/sw/bin/curl -H 'Content-Type: #{CONTENT_TYPE}' -H 'Accept: #{CONTENT_TYPE}' --fail-with-body -sSL #{ext} #{url}`
if $CHILD_STATUS.success?
response
else