Bitcoin Forum
September 03, 2024, 07:22:11 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Project Development / Opencart bitcoin plugin for Coinbase prices on: June 10, 2014, 06:53:44 PM
This is a dirty hack but i thought i would share. It is based on the btcgear plugin with the MtGox code swapped for Coinbase

1a. Download code from https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart and extract somewhere.
1b. Download code from https://github.com/coinbase/coinbase-php and copy the 'lib' folder to \upload\catalog\controller\common\ in above dir.
2. Edit the file \upload\catalog\controller\common\bitcoin_update.php as follows; Replace everything after public function runUpdate() { (line 60) with;

Code:
require_once(dirname(__FILE__) . '/lib/Coinbase.php');
$default_currency_code = $this->config->get('config_currency');

// API settings
$_API_KEY = "YourCoinbaseApiKey";
$_API_SECRET = "YourCoinbaseApiSecret";

// run the query
$coinbase = Coinbase::withApiKey($_API_KEY, $_API_SECRET);
$currency = "BTC";
$value = $coinbase->getSpot();


if ((float)$value) {
$value = 1/$value;
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '" . (float)$value . "', date_modified = '" .  $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($currency) . "'");
}

$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '1.00000', date_modified = '" .  $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($this->config->get('config_currency')) . "'");
$this->cache->delete('currency');
}
}
?>

3. Install code as per instructions in instructions.txt

Please let me know if you need any help or something, or can make the code better - or fork it on Git for me!
2  Other / Beginners & Help / Re: Why did I not get a reward for almost 3 hours of mining? on: December 17, 2013, 07:34:39 PM
Maybe the block you found was invalid and discarded?
3  Other / Beginners & Help / Re: dogecoin on: December 17, 2013, 07:26:55 PM
Hey guys.

What would you guys say is a good pool for mining dogecoin. and is it worth it?

Thx

/ chezze

Have a look at www.reddit.com/r/dogecoin/ also.
Such pool links in sidebar
Wow
Many hash
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!