From a509c55faca368709044133199f71fb862b1e605 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Mon, 24 Jul 2023 02:46:05 +0200 Subject: html output removed --- helpers.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'helpers.rb') 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 -- cgit v1.2.3