Lazarus

Programming => General => Topic started by: Ericktux on November 28, 2021, 04:32:50 am

Title: get the value of the dollar in each currency of each country
Post by: Ericktux on November 28, 2021, 04:32:50 am
good night brothers, does anyone know how to get the updated price of the dollar in the currency of each country?
for example to obtain the public IP I have seen that a website is consulted and a result is received.
If someone has any idea please help me.
Title: Re: get the value of the dollar in each currency of each country
Post by: trev on November 29, 2021, 01:35:11 am
Be aware that the terms of use for all the currency websites I've used explicitly forbid the automatic or manual systematic extraction of their data.
Title: Re: get the value of the dollar in each currency of each country
Post by: kapibara on November 29, 2021, 05:30:47 am
Maybe it's overkill, but using Python within Lazarus is a very powerful way of getting and updating any kind of data from the web. You could install Python4Lazarus (maintained by Alexey), write a python script and run it within a Lazarus application. From Python you could even have the script start a (headless, invisible) browser that manages logins, and then saves your data to disk. Some components in Python4Lazarus have events so you can get a notice when certain things has taken place within the script while it is running. https://github.com/Alexey-T/Python-for-Lazarus

There is a learning curve for doing this, but if the data is difficult to get it could be worth it. I use Spyder 4.0 to write and test scripts, it has code-completion. If you go this route, I suggest installing something like Spyder, write a python script that successfully grabs data and then run it from Lazarus. You probably want to parse, check and save the data in a database and being a beginner in Python I prefer doing that using Lazarus and Object Pascal.
Title: Re: get the value of the dollar in each currency of each country
Post by: wp on November 29, 2021, 07:00:47 pm
does anyone know how to get the updated price of the dollar in the currency of each country?
I have a small program for this on my github: https://github.com/wp-xyz/ExchangeRates
Title: Re: get the value of the dollar in each currency of each country
Post by: Ericktux on December 02, 2021, 03:57:12 am
Thank you all very much, especially to WP, your example runs perfect, I already believe my "APP ID" and the program works very well, thank you very much.   :) :)
TinyPortal © 2005-2018