Permalink
Browse files

Revert "[bc_*] Added Bitcoin-Central.net"

This reverts commit 88367a4.
  • Loading branch information...
1 parent afc9083 commit 99a87a2ff1b273cc3143b9915d348bca157cee8c @xHire committed Apr 2, 2013
Showing with 3 additions and 42 deletions.
  1. +1 −21 plugins/bc_market.rb
  2. +2 −21 plugins/bc_rate.rb
View
22 plugins/bc_market.rb
@@ -123,25 +123,6 @@ def run channel, params = ''
sell[:b24] ||= 0.0
end
- threads << Thread.start do
- begin
- # obtain bitcoin-central info
- ticker = open('https://bitcoin-central.net/api/v1/ticker').readline.strip
- buy[:bc] = ActiveSupport::JSON.decode(ticker)['bid'].to_f
- sell[:bc] = ActiveSupport::JSON.decode(ticker)['ask'].to_f
- rescue Errno::ETIMEDOUT
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central doesn't respond."
- rescue OpenURI::HTTPError => err
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central shouts HTTP error: #{err}"
- rescue Errno::ECONNRESET
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central reset the connection"
- rescue OpenSSL::SSL::SSLError
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central has some SSL difficulties"
- end
- buy[:bc] ||= 0.0
- sell[:bc] ||= 0.0
- end
-
# wait for all threads
threads.each do |t|
t.join
@@ -151,8 +132,7 @@ def run channel, params = ''
$bot.put "PRIVMSG #{channel} :buy/sell: " +
"[MtGox] #{round(buy[:mtgox])}/#{round(sell[:mtgox])} | " +
"[Bitstamp] #{round(buy[:bs])}/#{round(sell[:bs])} | " +
- "[BTC24] #{round(buy[:b24])}/#{round(sell[:b24])} | " +
- "[B-C] #{round(buy[:bc])}/#{round(sell[:bc])}"
+ "[BTC24] #{round(buy[:b24])}/#{round(sell[:b24])}"
rescue Timeout::Error => e
$bot.put "PRIVMSG #{channel} :Sorry, timeout :c("
puts "[TRH] Exception was raised: #{e.inspect}"
View
23 plugins/bc_rate.rb
@@ -116,23 +116,6 @@ def run channel, params = ''
btc[:b24_eur] ||= 0.0
end
- threads << Thread.start do
- begin
- # obtain EUR/BTC rate -- bitcoin-central
- ticker = open('https://bitcoin-central.net/api/v1/ticker')
- btc[:bc_eur] = ActiveSupport::JSON.decode(ticker.readline.strip)['price'].to_f
- rescue Errno::ETIMEDOUT
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central doesn't respond."
- rescue OpenURI::HTTPError => err
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central shouts HTTP error: #{err}"
- rescue Errno::ECONNRESET
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central reset the connection"
- rescue OpenSSL::SSL::SSLError
- $bot.put "PRIVMSG #{channel} :Sorry, bitcoin-central has some SSL difficulties"
- end
- btc[:bc_eur] ||= 0.0
- end
-
# wait for all threads
threads.each do |t|
t.join
@@ -145,15 +128,13 @@ def run channel, params = ''
$bot.put "PRIVMSG #{channel} :#{c.to_s.upcase}: " +
"[MtGox] #{round(btc[:mtgox_usd] * rate[:usd] / rate[c])} | " +
"[Bitstamp] #{round(btc[:bs_usd] * rate[:usd] / rate[c])} | " +
- "[BTC24] #{round(btc[:b24_eur] * rate[:eur] / rate[c])} | " +
- "[B-C] #{round(btc[:bc_eur] * rate[:eur] / rate[c])}"
+ "[BTC24] #{round(btc[:b24_eur] * rate[:eur] / rate[c])}"
end
unless any
$bot.put "PRIVMSG #{channel} :USD/CZK: " +
"[MtGox] #{round(btc[:mtgox_usd])}/#{round(btc[:mtgox_usd] * rate[:usd])} | " +
"[Bitstamp] #{round(btc[:bs_usd])}/#{round(btc[:bs_usd] * rate[:usd])} | " +
- "[BTC24] #{round(btc[:b24_eur] * rate[:eur] / rate[:usd])}/#{round(btc[:b24_eur] * rate[:eur])} | " +
- "[B-C] #{round(btc[:bc_eur] * rate[:eur] / rate[:usd])}/#{round(btc[:bc_eur] * rate[:eur])}"
+ "[BTC24] #{round(btc[:b24_eur] * rate[:eur] / rate[:usd])}/#{round(btc[:b24_eur] * rate[:eur])}"
end
rescue Timeout::Error => e
$bot.put "PRIVMSG #{channel} :Sorry, timeout :c("

0 comments on commit 99a87a2

Please sign in to comment.