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

	<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>2023-12-27T08:16:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Henkie2]]></name></author>
		<updated>2023-12-27T08:16:40-04:00</updated>

		<published>2023-12-27T08:16:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112340#p112340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112340#p112340"/>
		<title type="html"><![CDATA[Re: Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112340#p112340"><![CDATA[
@CrazyCat thanks for all your useful info en support. Much appreciated, thanks once more.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12567">Henkie2</a> — Wed Dec 27, 2023 8:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-12-27T07:37:28-04:00</updated>

		<published>2023-12-27T07:37:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112339#p112339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112339#p112339"/>
		<title type="html"><![CDATA[Re: Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112339#p112339"><![CDATA[
You have set a variable with the chan you want to announce and to create a new proc, called by your bind time, which will call your main proc itself:<br><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark-reasonable.min.css"> <strong>script</strong>  <strong>script</strong> <div class="codebox"><pre><code class="language-tcl">set gichan "#mychan"proc gameinformertimed {min hour day month dow} {   ::gameinformerprocp $::botnick * "$::botnick@127.0.0.1" $::gichan ""}bind time - "00 00 * * *" gameinformertimed</code></pre></div> <strong>script</strong> <p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Dec 27, 2023 7:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Henkie2]]></name></author>
		<updated>2023-12-27T07:14:40-04:00</updated>

		<published>2023-12-27T07:14:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112338#p112338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112338#p112338"/>
		<title type="html"><![CDATA[Re: Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112338#p112338"><![CDATA[
<blockquote class="uncited"><div>I didn't modify your binds, but the bind time won't work, because the proc is done for binds pub.<br><br>And actually, <a href="https://www.gameinformer.com/this-week" class="postlink">https://www.gameinformer.com/this-week</a> is empty, so the script can't display anything.</div></blockquote>Ohw but how can i combine the bind time on the proc? Because i got other scripts with bind times and bind pubs and they are using same proc. <br>Need to set the $chan? or add min hour etc on proc? or make a extra proc?<br>And added extra line on if {[llength $blocks] to get a msg about empy list <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12567">Henkie2</a> — Wed Dec 27, 2023 7:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-12-26T12:26:00-04:00</updated>

		<published>2023-12-26T12:26:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112337#p112337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112337#p112337"/>
		<title type="html"><![CDATA[Re: Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112337#p112337"><![CDATA[
I didn't modify your binds, but the bind time won't work, because the proc is done for binds pub.<br><br>And actually, <a href="https://www.gameinformer.com/this-week" class="postlink">https://www.gameinformer.com/this-week</a> is empty, so the script can't display anything.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Dec 26, 2023 12:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Henkie2]]></name></author>
		<updated>2023-12-26T08:15:09-04:00</updated>

		<published>2023-12-26T08:15:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112336#p112336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112336#p112336"/>
		<title type="html"><![CDATA[Re: Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112336#p112336"><![CDATA[
<blockquote class="uncited"><div>This is due to the -all flag in combination with the -inline:<blockquote class="uncited"><div>When using -inline, match variables may not be specified. If used with -all, the list will be concatenated at each iteration, such that a flat list is always returned. For each match iteration, the command will append the overall match data, plus one element for each subexpression in the regular expression.</div></blockquote>I think you may not work like that, because you'll have 3 arrays of datas which are independant.<br>You can probably do something like:<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark-reasonable.min.css"> <strong>script</strong>  <strong>script</strong> <div class="codebox"><pre><code class="language-tcl">package require httppackage require tlsproc gameinformerprocp {nick host hand chan txt} {   ::http::register https 443 [list ::tls::socket -servername gameinformer.com]    # Get page data   set url "https://www.gameinformer.com/this-week"    set token [::http::geturl $url -timeout 1000]   set page [::http::data $token]   upvar 0 $token state   if {$state(status) ne "ok"} {      putserv "PRIVMSG $chan :\00303GAMEINFORMER:\003 $state(url) made $state(status) error"      return   }   ::http::cleanup $token   ::http::unregister https      set blocks [regexp -all -inline -- {&lt;h3 class="page-title"&gt;.+?&lt;\/time&gt;} $page]   if {[llength $blocks]&gt;0} {      putserv "PRIVMSG $chan :\00303GAMES:\003 This week's Game releases:"      foreach block $blocks {         regexp {hreflang="en"&gt;(.+?)&lt;\/a&gt;.+class="field__item"&gt;(.+?)&lt;\/div&gt;.+?&lt;time datetime="(.+?)"} $block -&gt; title item date         set date [clock format [clock scan $date] -format {%d-%m-%Y}]         putserv "PRIVMSG $chan :$date $title (Rating: n/a) - Platform: $platform"      }   }}bind pub - !newgames gameinformerprocpbind pub - !thisweek gameinformerprocpbind time - "00 00 * * *" gameinformerprocp</code></pre></div> <strong>script</strong> I extract all interesting blocks (begins which &lt;h3 class="page_title", ends at &lt;/time&gt;) and for each, I use a regexp to extract the 3 interesting fields.</div></blockquote>Ah that explains a lot, i tried to to start with "while {[regexp and use extra regsubs" is that also works like some kind of block than as well right?<br>And tried your one, it's not showing any data. Thx again CrazyCat, best wishes ^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12567">Henkie2</a> — Tue Dec 26, 2023 8:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-12-24T11:05:48-04:00</updated>

		<published>2023-12-24T11:05:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112332#p112332</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112332#p112332"/>
		<title type="html"><![CDATA[Re: Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112332#p112332"><![CDATA[
This is due to the -all flag in combination with the -inline:<blockquote class="uncited"><div>When using -inline, match variables may not be specified. If used with -all, the list will be concatenated at each iteration, such that a flat list is always returned. For each match iteration, the command will append the overall match data, plus one element for each subexpression in the regular expression.</div></blockquote>I think you may not work like that, because you'll have 3 arrays of datas which are independant.<br>You can probably do something like:<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark-reasonable.min.css"> <strong>script</strong>  <strong>script</strong> <div class="codebox"><pre><code class="language-tcl">package require httppackage require tlsproc gameinformerprocp {nick host hand chan txt} {   ::http::register https 443 [list ::tls::socket -servername gameinformer.com]    # Get page data   set url "https://www.gameinformer.com/this-week"    set token [::http::geturl $url -timeout 1000]   set page [::http::data $token]   upvar 0 $token state   if {$state(status) ne "ok"} {      putserv "PRIVMSG $chan :\00303GAMEINFORMER:\003 $state(url) made $state(status) error"      return   }   ::http::cleanup $token   ::http::unregister https      set blocks [regexp -all -inline -- {&lt;h3 class="page-title"&gt;.+?&lt;\/time&gt;} $page]   if {[llength $blocks]&gt;0} {      putserv "PRIVMSG $chan :\00303GAMES:\003 This week's Game releases:"      foreach block $blocks {         regexp {hreflang="en"&gt;(.+?)&lt;\/a&gt;.+class="field__item"&gt;(.+?)&lt;\/div&gt;.+?&lt;time datetime="(.+?)"} $block -&gt; title item date         set date [clock format [clock scan $date] -format {%d-%m-%Y}]         putserv "PRIVMSG $chan :$date $title (Rating: n/a) - Platform: $platform"      }   }}bind pub - !newgames gameinformerprocpbind pub - !thisweek gameinformerprocpbind time - "00 00 * * *" gameinformerprocp</code></pre></div> <strong>script</strong> I extract all interesting blocks (begins which &lt;h3 class="page_title", ends at &lt;/time&gt;) and for each, I use a regexp to extract the 3 interesting fields.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sun Dec 24, 2023 11:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Henkie2]]></name></author>
		<updated>2023-12-23T20:58:29-04:00</updated>

		<published>2023-12-23T20:58:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112331#p112331</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112331#p112331"/>
		<title type="html"><![CDATA[Need some help on announce data]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112331#p112331"><![CDATA[
Hi all, i'm learning some basic tcl/regexp /json and right now i'm trying to get some data from web site and it all works.<br>Only it announce everything to 2times., One good and one include the regexp lines.<br><br>What i'm doing wrong? (trying to get data and announce that as list to chan)<br>And the bind time is also not working, how can i fix that?<br><br>Can anyone help or give me some advice. Thx<br><div class="codebox"><p>Code: </p><pre><code># -----------------------------------# This week games from gameinformer.com# -----------------------------------bind pub - !newgames gameinformerprocpbind pub - !thisweek gameinformerprocpbind time - "00 00 * * *" gameinformerprocppackage require httppackage require tlsproc gameinformerprocp {nick host hand chan txt} { ::http::register https 443 [list ::tls::socket -servername gameinformer.com]  # Get page data set url "https://www.gameinformer.com/this-week"  set token [::http::geturl $url -timeout 1000] set page [::http::data $token] upvar 0 $token state if {$state(status) ne "ok"} { putserv "PRIVMSG $chan :\00303GAMEINFORMER:\003 $state(url) made $state(status) error"  return } ::http::cleanup $token ::http::unregister https  # REGEXP page set regex_title {hreflang="en"&gt;(.*?)&lt;/a&gt;}  set titles [regexp -all -line -inline $regex_title $page]  set regex_platform {class="field__item"&gt;(.+?)&lt;\/div&gt;} set platforms [regexp -all -line $regex_platform $page]  set regex_date {class="datetime"&gt;(.*?)&lt;/time&gt;}    set dates [regexp -all -line $regex_date $page]  # Change date lay-out set date [clock format [clock scan $dates] -format {%d-%m-%Y}] # Announce to Chan putserv "PRIVMSG $chan :\00303GAMES:\003 This week's Game releases:" foreach (date $dates regex_title $titles regex_platform $platforms) {  putserv "PRIVMSG $chan :$date $regex_title (Rating: n/a) - Platform: $regex_platform"   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12567">Henkie2</a> — Sat Dec 23, 2023 8:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
