Archive of UserLand's first discussion group, started October 5, 1998.

Getting currency rates

Author:Emmanuel M. Décarie
Posted:12/13/1999; 10:55:24 AM
Topic:Getting currency rates
Msg #:13596
Prev/Next:13595 / 13597

Anyone know the FXP/1.1 protocol?

http://america.oanda.com/site/fxp/protocol.html

http://www.oanda.com/site/fxp/index.shtml

It look like a very simple protocol to query currency rates, and if I understand it well, its free, but you have to provide a link telling you are using their service. http://www.oanda.com/cgi-bin/fxp_client

I have a hell of a time to make a query from Frontier.

I used a patched version of tcp.httpClient because the server will not allow any lines in the header other than what its accepted by the protocol. So I had to get rid in tcp.httpClient of code adding the host, user-agent, http 1.0... in the header. Maybe I'm not using the appropriate verb.

local (s);
s = workspace.httpClient (method: "fxp/1.1\r\nQuotecurrency: CAD\r\nBasecurrency: EUR", server: "america.oanda.com", port: 5011, debug: true);
dialog.notify (s)

But Frontier hang there (Can't read stream because TCP/IP error code 60 - Connection timed out), even if I receive the result (using OT Watcher on my Mac I get this).

send 51 octets.
<00000000< fxp/1.1  
<00000009< Quotecurrency: CAD  
<0000001D< Basecurrency: EUR   
<00000031<   

receive 46 octets. >00000000> fxp/1.1 200 ok >00000010> Content-lines: 1 >00000022> >00000024> 0.6677 >0000002C>

Anyone know a similar service where I can get the result in XML instead?

TIA


There are responses to this message:


This page was archived on 6/13/2001; 4:53:44 PM.

© Copyright 1998-2001 UserLand Software, Inc.