<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/21690" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2025-07-18T12:44:53-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/21690</id>

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2025-07-18T12:44:53-04:00</updated>

		<published>2025-07-18T12:44:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113335#p113335</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113335#p113335"/>
		<title type="html"><![CDATA[Re: DANGEROUS - coingecko.tcl - Crypto Price]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113335#p113335"><![CDATA[
See the solution given in <a href="https://forum.eggheads.org/viewtopic.php?t=21691" class="postlink">viewtopic.php?t=21691</a> and adapt it (no needs of -headers param in ::http::geturl)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Jul 18, 2025 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2025-07-18T04:11:18-04:00</updated>

		<published>2025-07-18T04:11:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113332#p113332</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113332#p113332"/>
		<title type="html"><![CDATA[Re: DANGEROUS - coingecko.tcl - Crypto Price]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113332#p113332"><![CDATA[
@CrazyCat, thanks — but rather than just editing the title to say “DANGEROUS,” could you please provide the correct version or an actual implementation here?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12858">nobody</a> — Fri Jul 18, 2025 4:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2025-04-24T05:08:43-04:00</updated>

		<published>2025-04-24T05:08:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113291#p113291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113291#p113291"/>
		<title type="html"><![CDATA[Re: coingecko.tcl - Crypto Price]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113291#p113291"><![CDATA[
WARNING: usage of exec in script, please adapt it to use http package.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Apr 24, 2025 5:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2025-04-13T18:52:17-04:00</updated>

		<published>2025-04-13T18:52:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113285#p113285</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113285#p113285"/>
		<title type="html"><![CDATA[DANGEROUS - coingecko.tcl - Crypto Price]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113285#p113285"><![CDATA[
Hi,<br><br>just a simple crypto tcl script - it fetches live prices from CoinGecko<br><br>Cheers!<br><div class="codebox"><p>Code: </p><pre><code>#\00300 - Black#\00301 - Dark Blue#\00302 - Dark Green#\00303 - Red#\00304 - Dark Red#\00305 - Dark Purple#\00306 - Orange#\00307 - Yellow#\00308 - Light Green#\00309 - Teal#\00310 - Light Blue#\00311 - Light Purple#\00312 - Light Yellow#\00313 - White#\00314 - Light Gray#\00315 - Dark Gray#\00316 - Pink#\00317 - Light Pinkpackage require jsonbind pub - "!coin" get_priceproc get_price {nick host hand chan args} {    # Ensure args is passed correctly    if {[llength $args] != 1} {        puthelp "PRIVMSG $chan :Usage: !coin &lt;crypto&gt;"        return    }    # Extract the coin name from the arguments    set coin [string tolower [lindex $args 0]]    # Fetch coin data from CoinGecko API (Simple Price API for better reliability)    set url "https://api.coingecko.com/api/v3/simple/price?ids=$coin&amp;vs_currencies=usd&amp;include_24hr_change=true"    set data [exec curl -s $url]        # Debugging: Print API response to ensure it's valid    putlog "API Response: $data"    # Parse JSON response    set json_data [json::json2dict $data]        # Check if coin exists in the response    if {[dict exists $json_data $coin]} {        set coin_data [dict get $json_data $coin]        # Extract values safely        set price [dict get $coin_data usd]        set change [expr {[dict exists $coin_data usd_24h_change] ? [dict get $coin_data usd_24h_change] : 0}]        # Get the coin's name and symbol from the coin details API        set coin_details_url "https://api.coingecko.com/api/v3/coins/$coin"        set coin_details_data [exec curl -s $coin_details_url]        set coin_details_json [json::json2dict $coin_details_data]                if {[dict exists $coin_details_json "name"] &amp;&amp; [dict exists $coin_details_json "symbol"]} {            set coin_name [dict get $coin_details_json "name"]            set coin_symbol [dict get $coin_details_json "symbol"]        } else {            set coin_name "Unknown"            set coin_symbol "Unknown"        }        # Format values        set formatted_price [format "%.2f" $price]        set formatted_change [format "%.2f" $change]        # Set the color and arrow based on the price change# Set the color and arrow based on the price changeset arrow ""set color ""if {$change &gt; 0} {    set arrow "▲"  ;# Bigger upward arrow    set color "\00303" ;# Green} elseif {$change &lt; 0} {    set arrow "▼"  ;# Bigger downward arrow    set color "\00304" ;# Red} else {    set arrow "➤"  ;# Neutral arrow    set color "\00307" ;# Gray}        # Send formatted message to the channel        puthelp "PRIVMSG $chan :\00304☢ ᴇxᴘʟᴏɪᴛᴇʀ ☢\003 \00302$coin_name \00306(\00304$coin_symbol\00306) -- \00302Price:\00305 \$${formatted_price} \00302USD -- $color$arrow $formatted_change%\003 -- \00302Last update:\00304 [clock format [clock seconds] -format {%a, %d-%b-%y %T %Z}] "    } else {        puthelp "PRIVMSG $chan :-☢- use a correct coin name  - !coin bitcoin -. \00308- ᴇxᴘʟᴏɪᴛᴇʀ - "    }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12858">nobody</a> — Sun Apr 13, 2025 6:52 pm</p><hr />
]]></content>
	</entry>
	</feed>
