From aa59bc9c083acd696778e76d5ffe3483d311ec70 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 4 Nov 2013 16:19:05 -0700 Subject: [PATCH] planetarium: google-earth-requests: Replace open-input-gfile. Open-input-gfile hangs when DISPLAY is not set -- when a cron job. Replace it with (open-input-string (http-response-body (http-get... --- src/planetarium/google-earth-requests.scm | 5 +++-- src/planetarium/mit-3d.pkg | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/planetarium/google-earth-requests.scm b/src/planetarium/google-earth-requests.scm index f5a79d4c1..8f0c91326 100644 --- a/src/planetarium/google-earth-requests.scm +++ b/src/planetarium/google-earth-requests.scm @@ -79,8 +79,9 @@ USA. (number->string (latitude location)) ","(number->string (longitude location)))) request-locations))))) - (let* ((port (open-input-gfile url) - #;(open-input-file "reply.txt")) + (let* ((port #;(open-input-gfile url) + #;(open-input-file "reply.txt") + (open-input-string (http-response-body (http-get url '())))) (reply (read-xml port))) (close-input-port port) (let ((root (xml-document-root reply))) diff --git a/src/planetarium/mit-3d.pkg b/src/planetarium/mit-3d.pkg index 0723c545d..67b93d90c 100644 --- a/src/planetarium/mit-3d.pkg +++ b/src/planetarium/mit-3d.pkg @@ -55,7 +55,9 @@ USA. string->universal-time universal-time->global-time-string load-option - open-input-gfile read-xml xml->string + open-input-gfile + http-get http-response-body open-input-string + read-xml xml->string xml-document-root xml-element? xml-element-content xml-element-name) (export (planetarium) request-google-elevation)) \ No newline at end of file -- 2.25.1