Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Tritonio on September 29, 2010, 12:09:36 PM



Title: BTConvert
Post by: Tritonio on September 29, 2010, 12:09:36 PM
I don't think one existed so here it is!

BTConvert. A portable currency converter for BTC, USD, EUR, GBP, AUD, Linden$, Pecunix, RUB, CAD and PLN. It takes the exchange rates from the internet every 30 minutes. Nothing fancy, it just works. I think...

AutoIt3 sources are included. If you don't need them just keep the executable.

Suggestions, tips etc are welcome as always.  ::)

Also if anybody has missed it I've made a portable wrapper for Bitcoin: http://bitcointalk.org/index.php?topic=944.0 (http://bitcointalk.org/index.php?topic=944.0)

Changes so far:
v1 Initial version.
v2 Added AUD.
   Added refresh button.
v3 Some timers changed.
   Added link to bitcoin.org when someone clicks on his label.
v4 Users that click refresh too often are asked if they are sure.
   Added Linden dollar and Pecunix.
   All labels are links to related pages.
v5 Changed Lindel dollar source.
   Fixed a bug with manual refresh warning.
   Limited the decimal digits to something sensible.
v6 Added RUB and CAD.
   Fixed the LD label link.
   No more beeps. Instead it will show a persistent message that something went wrong.
v7 Andrzej added PLN. Thanks for that Andrzej. :-)
   Stores the last update time in the INI so that exiting and running the program soon won't cause an update.
v8 Docks in tray.
   No longer asks if you refresh the rates very often.
v9 Support for the new Mt Gox ticker data.
v10 Fixed last version because it broke.
   Data for most currencies is taken from: http://openexchangerates.org/latest.json
   Changed BTC decimals to 4. (0.0001


Title: Re: BTConvert
Post by: Tritonio on October 09, 2010, 02:28:56 PM
I've added some more currencies: Pecunix and Linden dollars.


Title: Re: BTConvert
Post by: BitLex on October 09, 2010, 03:44:04 PM
nice work,
would be cool if you could change the L$ source from LindeX to VirWox (https://www.virwox.com/),
cuz that's what all BitLex calculations are based on.


Title: Re: BTConvert
Post by: Drifter on October 09, 2010, 04:30:00 PM
Isn't working for me unfortunately. At first there is a loud beeping every couple seconds while saying "Failed to update USD/EUR". When I finally enter data (1000 BTC), it gives me this:


Title: Re: BTConvert
Post by: Tritonio on October 10, 2010, 10:14:25 PM
Drifter that would happen if you couldn't connect to Google or if Google was sending back unrecognized data. I looks like the only rates that weren't updated was the ones that Google is queried for. Are you using any proxies with Internet Explorer?

BitLex you mean I should change where the converter get's it's data or just just change the source in the about dialog? I suppose you meant the former. I will do it in the next version. :-)


Title: Re: BTConvert
Post by: mpkomara on October 11, 2010, 10:06:28 AM
can you reduce the precision of the exchange rate to only a few decimal places?  tip sent.


Title: Re: BTConvert
Post by: Tritonio on October 11, 2010, 12:02:19 PM
mpkomara I will do it today after I finish work. I will put something sensible for each currency. Thank you very much for the tip. :-)


EDIT: I made the two requested changes. Download it using the same download link. Here is the changelog so far:
v1 Initial version.
v2 Added AUD.
   Added refresh button.
v3 Some timers changed.
   Added link to bitcoin.org when someone clicks on his label.
v4 Users that click refresh too often are asked if they are sure.
   Added Linden dollar and Pecunix.
   All labels are links to related pages.
v5 Changed Lindel dollar source.
   Fixed a bug with manual refresh warning.
   Limited the decimal digits to something sensible.


Title: Re: BTConvert
Post by: Tritonio on October 27, 2010, 03:48:43 PM
I don't know if anyone else has noticed this but it often fails to update the BTC/$ rate. If you click refresh though it will update it normally.I guess it's Mt. Gox that delays to respond and some timeout expires. Anybody having this problem too?


Title: Re: BTConvert
Post by: LZ on October 29, 2010, 02:53:22 PM
I will be happy if it will also show RUB (https://web.archive.org/web/2010/http://bitcoinwatch.com/) exchange rate. ;)


Title: Re: BTConvert
Post by: BitLex on October 29, 2010, 03:46:52 PM
thanks for switching to virwox-data, you missed the Func LDlabelClick() though, it still points to the LindeX Market, no big deal but might confuse people, cuz it shows different prices.

virwox got a json-api too, btw, you might want to check that instead of the main-website,
never used AutoIT myself, but this is what i do in php
Code:
#### VirWox - Data
$url = 'http://api.virwox.com/api/json.php';
$data = '{ "method": "getMarketDepth", "params": { "symbols": ["EUR\/SLL", "USD\/SLL"], "buyDepth": 1, "sellDepth": 1 }, "id":1 }';
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  $output = curl_exec($ch); 
  $obj = json_decode($output);
  curl_close($ch);
#echo $output."\n\r";



Title: Re: BTConvert
Post by: Tritonio on October 30, 2010, 08:36:52 PM
I will be happy if it will also show RUB (http://bitcoinwatch.com/) exchange rate. ;)

I will add it in the next version along with Canadian $. :-) But I will use Google for the $/RUB rate since ALL conversions in BTConvert go through US$.  ::)


Title: Re: BTConvert
Post by: Tritonio on October 30, 2010, 08:38:54 PM
thanks for switching to virwox-data, you missed the Func LDlabelClick() though, it still points to the LindeX Market, no big deal but might confuse people, cuz it shows different prices.

virwox got a json-api too, btw, you might want to check that instead of the main-website,
never used AutoIT myself, but this is what i do in php
Code:
#### VirWox - Data
$url = 'http://api.virwox.com/api/json.php';
$data = '{ "method": "getMarketDepth", "params": { "symbols": ["EUR\/SLL", "USD\/SLL"], "buyDepth": 1, "sellDepth": 1 }, "id":1 }';
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  $output = curl_exec($ch); 
  $obj = json_decode($output);
  curl_close($ch);
#echo $output."\n\r";

OK Bitlex I'll use the json URL instead. It should be a little faster after all. Oh and I will change the label too... I thought I had. :)

I'll post the new version before Monday.


Title: Re: BTConvert
Post by: Tritonio on November 01, 2010, 10:37:30 AM
Version 6 is out.
*Added RUB and CAD.
*Fixed the LD label link.
*No more beeps. Instead it will show a persistent message that something went wrong.

I didn't change the JSON thing yet...  ::) I was a bit bored.  ;D


Title: Re: BTConvert
Post by: Anonymous on November 01, 2010, 11:26:16 AM
Oh cool,you even have Aus dollars.
 ;D


Title: Re: BTConvert
Post by: Tritonio on November 01, 2010, 02:30:02 PM
Glad you liked it. :-) BTW thanks to whoever sent some coins!  ;)


Title: Re: BTConvert
Post by: LZ on November 03, 2010, 05:29:58 PM
Thanks for v6! I am happy now! :D


Title: Re: BTConvert
Post by: Anonymous on November 06, 2010, 01:35:48 PM
In a related thread I started a bounty to get a web based converter done.

http://bitcointalk.org/index.php?topic=1675.0 (http://bitcointalk.org/index.php?topic=1675.0)

Some people dont like apps apparently  ::)



Title: Re: BTConvert
Post by: Tritonio on March 29, 2011, 07:10:51 PM
Wow. Great work. I really like it. Keep it up. :)

Hey thank you! If you need anything added to the program just say it...  :D


Title: Re: BTConvert
Post by: Garrett Burgwardt on March 29, 2011, 08:43:24 PM
Wow. Great work. I really like it. Keep it up. :)

Hey thank you! If you need anything added to the program just say it...  :D

Sorry to say that that is a spambot... forum has had some problems with them lately :/


Title: Re: BTConvert
Post by: Tritonio on April 27, 2011, 12:54:53 PM
Wow. Great work. I really like it. Keep it up. :)
Hey thank you! If you need anything added to the program just say it...  :D
Sorry to say that that is a spambot... forum has had some problems with them lately :/

Haha really? In any case I released version 7.
Changelog:
  • Andrzej added PLN. Thanks for that Andrzej. :-)
  • Stores the last update time in the INI so that exiting and running the program soon won't cause an update.


Title: Re: BTConvert
Post by: Tritonio on June 27, 2011, 12:45:12 PM
Version 9 supports the new Mt Gox ticker format so it should now be able to update the BTC/USD rate.


Title: Re: BTConvert
Post by: Tritonio on February 25, 2012, 12:53:09 AM
Version 9 broke at some point because of updates in the sites I used to take the exchange rates. I switches to new urls that should last longer and it should also be MUCH faster when updating prices. So v10 is out and can finally use my converter again...