View previous topic :: View next topic |
Author |
Message |
marx2k Voice
Joined: 23 Jan 2011 Posts: 10
|
Posted: Fri Jun 10, 2011 8:23 am Post subject: BitCoin Market Exchange Rate |
|
|
It would be amazing if there was a script that would take the BitCoin market exchange rate from MtGox and provide a public trigger to display the data.
Their public API can be used here:
https://mtgox.com/support/tradeAPI
Speicifically, ticker JSON results can be attained from :
http://mtgox.com/code/data/ticker.php
Perhaps a public trigger such as: !bc
Information can look like:
BitCoin Last Trade Data -- High: 31.5, Low: 25.626, Vol: 44193, Buy: 26.6, Sell: 26.7899, Last: 26.79
Perhaps have it configurable for single or multi-line.
Also... colors!  |
|
Back to top |
|
 |
marx2k Voice
Joined: 23 Jan 2011 Posts: 10
|
Posted: Fri Jun 24, 2011 7:11 pm Post subject: |
|
|
?? nobody? |
|
Back to top |
|
 |
marx2k Voice
Joined: 23 Jan 2011 Posts: 10
|
Posted: Fri Jun 24, 2011 10:19 pm Post subject: |
|
|
Hm, never mind. I guess mtgox has crapped out and is no longer offering the API I linked to :/ |
|
Back to top |
|
 |
marx2k Voice
Joined: 23 Jan 2011 Posts: 10
|
|
Back to top |
|
 |
pitbull Voice
Joined: 12 Aug 2007 Posts: 13
|
Posted: Sat Dec 31, 2011 9:45 pm Post subject: |
|
|
Here's something I scratched together to do this in our chan. Thanks to speechless for the http/ssl part (the bulk of the code, really).
Code: | package require http
package require tls
http::register https 443 [list ::tls::socket -require 0 -request 1]
proc s:wget { url } {
http::config -useragent "Mozilla/EggdropWget"
catch {set token [http::geturl $url -binary 1 -timeout 10000]} error
if {![string match -nocase "::http::*" $error]} {
s:debug "Error: [string totitle [string map {"\n" " | "} $error]] \( $url \)"
return 0
}
if {![string equal -nocase [::http::status $token] "ok"]} {
s:debug "Http error: [string totitle [::http::status $token]] \( $url \)"
http::cleanup $token
return 0
}
if {[string match "*[http::ncode $token]*" "303|302|301" ]} {
upvar #0 $token state
foreach {name value} $state(meta) {
if {[regexp -nocase ^location$ $name]} {
if {![string match "http*" $value]} {
if {![string match "/" [string index $value 0]]} {
set value "[join [lrange [split $url "/"] 0 2] "/"]/$value"
} else {
set value "[join [lrange [split $url "/"] 0 2] "/"]$value"
}
}
s:wget $value
return
}
}
}
if {[string match 4* [http::ncode $token]] || [string match 5* [http::ncode $token]]} {
s:debug "Http resource is not evailable: [http::ncode $token] \( $url \)"
return 0
}
set data [http::data $token]
http::cleanup $token
return $data
}
bind pub - !btc get_bitcoin
proc get_bitcoin {nick uhost handle chan arg} {
set data2 [s:wget https://mtgox.com/api/0/data/ticker.php]
set btc [regexp {high\":(.*?),\"low\":(.*?),\"avg\":(.*?),\"vwap\":.*?,\"vol\":(.*?),\"last_all\":.*?,\"last_local\":.*?,\"last\":.*?,\"buy\":(.*?),\"sell\":(.*?)\}} $data2 match btchigh btclow btcavg btcvol btcbuy btcsell]
putserv "PRIVMSG $chan :\002Bitcoin Market Data\002 (MtGox): High: \$$btchigh Low: \$$btclow Volume: $btcvol Buy: \$$btcbuy Sell: \$$btcsell"
}
|
_________________ irc://irc.efnet.net/peakoil |
|
Back to top |
|
 |
khalidxpert Voice
Joined: 26 Jan 2008 Posts: 18
|
Posted: Fri Mar 23, 2018 12:24 pm Post subject: i am unable to install |
|
|
hi there
i am getting error tls please help me to install bitcoin.tcl how i can fix tls problem |
|
Back to top |
|
 |
khalidxpert Voice
Joined: 26 Jan 2008 Posts: 18
|
Posted: Wed Feb 12, 2020 8:10 am Post subject: Re: i am unable to install |
|
|
khalidxpert wrote: | hi there
i am getting error tls please help me to install bitcoin.tcl how i can fix tls problem |
i am also getting tls error any one will help ? |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3690 Location: Mint Factory
|
Posted: Thu Feb 13, 2020 1:37 am Post subject: |
|
|
There's nothing that can be fixed at this moment since mtgox.com is down. Find another website that offers this service and we can take it from there. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 227
|
Posted: Mon May 04, 2020 3:43 pm Post subject: |
|
|
hmm check out blackshadow's new currency.tcl _________________ ComputerTech
Last edited by ComputerTech on Mon Aug 10, 2020 11:22 pm; edited 1 time in total |
|
Back to top |
|
 |
Dominatez Voice

Joined: 14 Jan 2019 Posts: 36 Location: United Kingdom
|
Posted: Tue May 26, 2020 6:16 pm Post subject: |
|
|
caesar wrote: | There's nothing that can be fixed at this moment since mtgox.com is down. Find another website that offers this service and we can take it from there. |
https://www.coingecko.com
They don't even use an api because they say all info should be free. |
|
Back to top |
|
 |
|