planetarium: google-earth-requests: Replace open-input-gfile.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Mon, 4 Nov 2013 23:19:05 +0000 (16:19 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Mon, 4 Nov 2013 23:19:05 +0000 (16:19 -0700)
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
src/planetarium/mit-3d.pkg

index f5a79d4c1bebe5693acfac6ba597b3ae9c84750f..8f0c91326a8b089da427da27eaae6a67baf29d98 100644 (file)
@@ -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)))
index 0723c545d72ecba78107d44d384092dcdbd5adcd..67b93d90c9c98a0262b70700a6ba7c031a1dfe6e 100644 (file)
@@ -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