Automatic conversion of prices on a web page to another currency

I’m interested in possible methods for automatically converting prices set when loading a web page from the currency specified in the specified currency. Ideally, the conversion will also use the current exchange rate to give actual prices.

For example, in my particular case, I would like to convert the prices indicated in euros (€) to this website into Sterling (£).

I am considering using a GreaseMonkey script for this conversion, but can anyone suggest other methods?

Thanks, MagicAndi.

+1
source share
3 answers

API: http://thecurrencygraph.com

Geo Location - . ,

, !

.

+1

AutoHotkey, , , -, . httpQuery library:

#Include httpQuery.ahk

InputBox, n, EUR to GBP, Enter the number., , 150, 120
if (ErrorLevel || !n)
    return
url :=  "http://www.xe.com/ucc/convert.cgi?Amount=" n "&From=EUR&To=GBP&image.x=55&image.y=8"
html := URLDownloadToVar(url)
Gui, Add, Edit, w125, % RegExMatch(html,"[\d\.]+(?= GBP)",m) ? m "£" : "The value could not be retrieved."
Gui, Show, AutoSize Center, GBP
VarSetCapacity(html,0)
Return

GuiClose: 
GuiEscape: 
Gui, Destroy
return

URLDownloadToVar(url){ 
    if !RegExMatch(url,"^http://") 
        url :=  "http://" url 
    httpQuery(html,url) 
    VarSetCapacity(html, -1) 
    Return html 
}

, , ( ) , , , .

+1

The quick and easy answer is to use the Firefox add-on. There are several currency converters available as add-ons, but I ended up using Exch as it best suited my needs.

0
source

Source: https://habr.com/ru/post/1737131/


All Articles