Difference between revisions of "BitcoinPrice (Gnome extension)"

From Organic Design wiki
(the python one-liner)
(no need for python cronjob now)
Line 1: Line 1:
This is my first [[Gnome]] extension which collects the current Mt Gox [[Bitcoin]] price and displays it next to the clock in the main Gnome panel. The code is available in our extensions repository [http://svn.organicdesign.co.nz/listing.php?repname=extensions&path=%2FBitcoinPrice%2F here].
+
This is my first [[Gnome]] extension which collects the current Mt Gox [[Bitcoin]] price and displays it next to the clock in the main Gnome panel. The code is available in our extensions repository [http://svn.organicdesign.co.nz/listing.php?repname=extensions&path=%2FBitcoinPrice%2F here]. It checks the [http://mtgox.com/api/1/BTCUSD/ticker Mt. Gox BTCUSD ticker] every two minutes which returns about 1KB of JSON encoded data from which the script extracts the current price from and places onto the status bar by the clock.
 
 
First the code needs to be placed into your extensions directory in the path '''~/.local/share/gnome-shell/extensions/''', and the extension directory should be renamed from '''BitcoinPrice''' to '''BitcoinPrice@organicdesign.co.nz'''. This is probably the wrong way to go about installing it, but I'm a total noob at Gnome extensions, so haven't figured out the right ways of doing things yet!
 
 
 
Also I didn't know how to make it check the Mt Gox API URL on a regular interval, so currently you have to call a [http://svn.organicdesign.co.nz/filedetails.php?repname=extensions&path=%2FBitcoinPrice%2Fmtgox-price.py Python one-liner] on a cron job using something like the command below in '''/etc/crontab'''. The extension expects the price to be in a file called '''.btcprice.txt''' in your home directory.
 
{{code|<pre>*/5 * * * * nad /home/nad/.local/share/gnome-shell/extensions/BitcoinPrice@organicdesign.co.nz/mtgox-price.py > /home/nad/.btcprice.txt</pre>}}
 
  
 +
The code needs to be placed into your extensions directory in the path '''~/.local/share/gnome-shell/extensions/''', and the extension directory should be renamed from '''BitcoinPrice''' to '''BitcoinPrice@organicdesign.co.nz'''. This is probably the wrong way to go about installing it, but I'm a total noob at Gnome extensions, so haven't figured out the right ways of doing things yet!
  
 
Here's what it looks like when it's running:
 
Here's what it looks like when it's running:

Revision as of 17:56, 20 November 2013

This is my first Gnome extension which collects the current Mt Gox Bitcoin price and displays it next to the clock in the main Gnome panel. The code is available in our extensions repository here. It checks the Mt. Gox BTCUSD ticker every two minutes which returns about 1KB of JSON encoded data from which the script extracts the current price from and places onto the status bar by the clock.

The code needs to be placed into your extensions directory in the path ~/.local/share/gnome-shell/extensions/, and the extension directory should be renamed from BitcoinPrice to BitcoinPrice@organicdesign.co.nz. This is probably the wrong way to go about installing it, but I'm a total noob at Gnome extensions, so haven't figured out the right ways of doing things yet!

Here's what it looks like when it's running:

Btc price extension.png