<?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/21689" />

	<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:45:25-04:00</updated>

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

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

		<published>2025-07-18T12:45:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113336#p113336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113336#p113336"/>
		<title type="html"><![CDATA[Re: DANGEROUS - weather tcl script snippet from http://wttr.in]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113336#p113336"><![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:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2025-07-18T04:10:58-04:00</updated>

		<published>2025-07-18T04:10:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113331#p113331</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113331#p113331"/>
		<title type="html"><![CDATA[Re: weather tcl script snippet from http://wttr.in]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113331#p113331"><![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:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2025-04-24T04:55:33-04:00</updated>

		<published>2025-04-24T04:55:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113289#p113289</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113289#p113289"/>
		<title type="html"><![CDATA[Re: weather tcl script snippet from http://wttr.in]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113289#p113289"><![CDATA[
<strong class="text-strong"><span style="color:#FF0040">Warning !</span></strong><br>mortmann noticed this script uses <em class="text-italics">exec</em> without sanytizing $location, so it's possible to inject bad code.<br><br>@nobody: you'd better use the http package rather than curl: you'll won't have to use exec anymore and the script can also work with windrop. Or with shell which haven't curl installed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Apr 24, 2025 4:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nobody]]></name></author>
		<updated>2025-04-13T18:46:36-04:00</updated>

		<published>2025-04-13T18:46:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113284#p113284</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113284#p113284"/>
		<title type="html"><![CDATA[DANGEROUS - weather tcl script snippet from http://wttr.in]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113284#p113284"><![CDATA[
Hi, <br>you might find this useful for your channel, feel free to modified/enhance it<br><br>-Thanks to chatgpt for some debugging issue<br><div class="codebox"><p>Code: </p><pre><code># part of my modified fzcommands.tcl by Opposing# just #nobody# feel free to enhance itset logo "\00304ᵉ̲\003ﾒ̲\00306ᵖ̲\00307ˡ̲\00308ᵒ̲\00309ᶦ̲\00310ᵗ̲\00311ᵉ̲\00313ʳ\003"set trigger "`"proc xpl {} {  global logo  return $logo}proc xplx {} {  global trigger  return $trigger}proc message {who what} {puthelp "PRIVMSG $who :$what"}proc notice {who what} {puthelp "NOTICE $who :$what"}bind pub - [xplx]w fz:weatherbind pub - [xplx]weather fz:weatherproc get_weather_report {location} {    # Fetch weather data (including location and ASCII art) from wttr.in    ### DANGEROUS USE OF EXEC ###    set weather_data [exec curl -s "http://wttr.in/$location?0"]    # Check if data was returned    if {[string length $weather_data] == 0} {        return "Error: Unable to fetch weather data for $location."    }    return $weather_data}# Function to handle the weather command in the chanproc fz:weather {nick uhost hand chan arg} {    global botnick    # Get location from the argument (default to "Brisbane" if not provided)    set location [string trim [lindex [split $arg] 0]]    if {[string length $location] == 0} {        set location "Brisbane"    }    # Fetch weather report for the location (with ASCII art)    set weather_report [get_weather_report $location]    if {[string first "Error" $weather_report] == 0} {        message $chan "$nick: $weather_report [xpl]"        return    }    # Clean up color codes if necessary (optional)    set cleaned_weather_report [remove_color_codes $weather_report]    # Split and send the weather report in multiple lines to the chan    set weather_lines [split $cleaned_weather_report "\n"]    foreach line $weather_lines {        # Send each line as a separate message to avoid IRC message length limits        message $chan "$line"    }    return 1}# Function to remove color codes (if necessary)proc remove_color_codes {input} {    regsub -all {\x1b\[[0-9;]*m} $input "" output    return $output}</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:46 pm</p><hr />
]]></content>
	</entry>
	</feed>
