Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 4907 days ago | link | parent

A while ago I tried to get www.google.com using Anarki's web.arc (https://github.com/nex3/arc/blob/master/lib/web.arc). It appended a spurious "?&" to the end of the URL, but once I hacked in a fix to keep that from happening, it worked just fine. (Well, I think I encountered one more issue occasionally: If there's absolutely no response, even headers, 'parse-server-headers blocks forever.)

To read the response body, web.arc just says (tostring (whilet line (readline in) (prn line))). Apparently it there's EOF detection somewhere in this process....

Sorry I'm not providing working code, or even a reliable memory. XD I suppose I'll try things out again tonight and commit any fixes back to Anarki.



1 point by rocketnia 4906 days ago | link

Oh, web.arc already worked with Google. Since the last time I tried this, I think Google must have updated to accept http://www.google.com/?&; as a legitimate home page URL.

Still, that spurious "?&" would probably break other pages, so I committed a fix: https://github.com/nex3/arc/commit/ea05adec8235fe3713b05dd9f...

Here's how to use web.arc:

  (load "lib/web.arc")
  (google "foo")              ; It comes with its own Google demo. :-p
  (get-url "www.google.com")

-----

1 point by rocketnia 4906 days ago | link

Hmm, you should not see a semicolon at the end of this line: http://&;

It seems to be a bug in the Arc Forum right now.

-----