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

	<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>2010-04-11T17:47:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-11T17:47:33-04:00</updated>

		<published>2010-04-11T17:47:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92809#p92809</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92809#p92809"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92809#p92809"><![CDATA[
I would like to adapt the script with the rss I tried but it fails :s thanks <a href="http://www.zdnet.fr/feeds/rss/" class="postlink">http://www.zdnet.fr/feeds/rss/</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Sun Apr 11, 2010 5:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-09T04:12:33-04:00</updated>

		<published>2010-04-09T04:12:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92760#p92760</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92760#p92760"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92760#p92760"><![CDATA[
Well I set the timer on each twenty minute 00 * 30 * and then one .restart the result is <div class="codebox"><p>Code: </p><pre><code>[23:31:29] *** Eggy (lamestxpa@network.org) has left #test (Left all channels)[23:31:45] *** Eggy (lamestxih@network.org) has joined #test [23:35:03] (Eggy): [Russie - USA : Moscou et Washington déterminés à adopter de nouvelles sanctions contre l'Iran] http://www.casafree.com/modules/news/article.php?storyid=44370[23:35:06] (Eggy): Le président américain Barack Obama et son homologue russe Dimitri Medvedev ont réaffirmé jeudi à Prague leur détermination à adopter une nouvelle série de sanctions contre l'Iran si ce pays refusait de mettre fin à son programme nucléaire.[23:35:12] (Eggy): [France : La COPEAM veut avancer dans la concrétisation de ses projets pour l'émergence d'un paysage audiovisuel méditerranéen] http://www.casafree.com/modules/news/article.php?storyid=44369[23:35:15] (Eggy): La 17ème Conférence Permanente de l'Audiovisuel Méditerranéen (COPEAM) s'ouvre jeudi à Paris avec l'ambition "d'aller plus loin" dans la concrétisation de ses projets phares destinés à contribuer à l'émergence d'un paysage audiovisuel méditerranéen.[08:14:38] (neoclust): huh</code></pre></div>when I'm gone again what happens on the channel after 6 hours, there was not no big thing after the first action when he connected.. it gets stuck somewhere you do not?<br><br>See this code : <a href="http://paste.tclhelp.net?id=6g1" class="postlink">http://paste.tclhelp.net?id=6g1</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Fri Apr 09, 2010 4:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-04-08T16:57:28-04:00</updated>

		<published>2010-04-08T16:57:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92754#p92754</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92754#p92754"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92754#p92754"><![CDATA[
My bad. Here's a version that should behave correctly.<br><br><a href="http://ereader.kiczek.com/puhrum.tcl" class="postlink">click here</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Apr 08, 2010 4:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-08T03:57:51-04:00</updated>

		<published>2010-04-08T03:57:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92741#p92741</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92741#p92741"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92741#p92741"><![CDATA[
u have missing } at the end, and i waited that the timer automatically launches a news but nothing happens<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Thu Apr 08, 2010 3:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-04-07T20:43:04-04:00</updated>

		<published>2010-04-07T20:43:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92740#p92740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92740#p92740"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92740#p92740"><![CDATA[
<blockquote class="uncited"><div>thanks man, i changed the time by 5 minutes to see if the timer will trigger the action to automatically publish the news on the channel but in vain</div></blockquote>Oh ho ho.. perhaps I should've tested that timer part. I realize the problem, and to make up for it I've added full configuration into the script. Check out the new config below:<div class="codebox"><p>Code: </p><pre><code>namespace eval news {   # config - make your changes here   # trigger character   set ary(pref) "!"   # command used to reply to user   # this can be a list of space delimited commands   set ary(commands) "news"   # amount user can issue before throttle   set ary(throttle) 2   # throttle time   set ary(throttle_time) 30   # time to announce new news items   # this can be a list of space delimited time binds.   # the one you wish to use for bind_time uncommented.   # set ary(bind_time) "00* 15* 30* 45*" ; # every 15 minutes   # set ary(bind_time) "00* 30*" ; # every 30 minutes   set ary(bind_time) "00*" ; # every 60 minutes at exactly the start of the hour   # url to news page   set ary(page) http://www.casafree.com/modules/news/   # parsing regex used to gather news   set ary(regex) {&lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;}   # max amount of news items to announce   set ary(max_bot) 5   # max amount of news items for users   set ary(max_user) 5   # display format for news messages, variables are: %description, %title, %url    # these can be used and will be replaced with actual values, newline (\n) will   # let you span multiple lines if you wish. If something is too long it will   # be cut off, be aware of this... use colors, bold, but remember to \escape any   # special tcl characters.    set ary(display_format) "\[\002%title\002\] %url\n%description"   # script version   set ary(version) "2.2"}</code></pre></div>Here is samples of how this looks on irc.<blockquote class="uncited"><div>&lt;speechles&gt; !news<br>&lt;sp33chy&gt; [<strong class="text-strong">Grande-Bretagne : L'économie britannique progresserait plus rapidement que la majorité des pays du G7 selon l'OCDE</strong>] <a href="http://www.casafree.com/modules/news/article.php?storyid=44326" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44326</a><br>[5:17pm] [sp33chy] L'économique britannique devrait enregistrer au premier semestre de 2010, une croissance plus rapide que la majorité des pays du G7, a indiqué un rapport de l'Organisation de coopération et de développement économiques (OCDE) relayé par la presse britannique.<br>&lt;sp33chy&gt; [<strong class="text-strong">Israël est la principale menace à la paix au Moyen-Orient , dit le PM turc</strong>] <a href="http://www.casafree.com/modules/news/article.php?storyid=44328" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44328</a><br>&lt;sp33chy&gt; Israël est la principale menace pour la paix au Moyen-Orient, a indiqué mercredi le Premier ministre turc Recep Tayyip Erdogan, qui est actuellement en visite à Paris.<br>&lt;sp33chy&gt; [<strong class="text-strong">UE - Afrique : : Les compagnies aériennes de 11 pays africains interdites de vol en Europe</strong>] <a href="http://www.casafree.com/modules/news/article.php?storyid=44327" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44327</a><br>&lt;sp33chy&gt; La Commission européenne a décidé d'interdire de vol en Europe 278 compagnies aériennes dont celles de 11 pays africains, annonce un communiqué publié mercredi à Bruxelles.<br><br>..a short while later..<br><br>&lt;sp33chy&gt; [<strong class="text-strong">Maroc : Plus de 1200 personnes ont bénéficié des services du Samusocial Casablanca en 2009</strong>] <a href="http://www.casafree.com/modules/news/article.php?storyid=44329" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44329</a><br>&lt;sp33chy&gt; 1217 personnes recueillies dans la rue ont bénéficié, en 2009, des services du Centre d'hébergement du service d'aide mobile d'urgence social (Samusocial) de Casablanca.</div></blockquote>Get the new script <a href="http://ereader.kiczek.com/puhrum.tcl" class="postlink">HERE</a> and have a fun. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Apr 07, 2010 8:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-07T19:47:30-04:00</updated>

		<published>2010-04-07T19:47:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92739#p92739</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92739#p92739"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92739#p92739"><![CDATA[
thanks man, i changed the time by 5 minutes to see if the timer will trigger the action to automatically publish the news on the channel but in vain<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Wed Apr 07, 2010 7:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-04-07T16:49:28-04:00</updated>

		<published>2010-04-07T16:49:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92731#p92731</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92731#p92731"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92731#p92731"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>Cannot post the code, this forum renders the html elements even within [c o d e] tags.. quite lame</code></pre></div>Get it <a href="http://ereader.kiczek.com/puhrum.tcl" class="postlink">HERE</a> instead.<br><br>To make it auto-post new news items every hour, instead of every 30 minutes.<div class="codebox"><p>Code: </p><pre><code>#change thisset ary(bind_time) "30*"#to thisset ary(bind_time) "00*"</code></pre></div>I've also commented the config section more thorough so you can understand what each setting does. Enjoy <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Apr 07, 2010 4:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-07T10:32:39-04:00</updated>

		<published>2010-04-07T10:32:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92722#p92722</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92722#p92722"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92722#p92722"><![CDATA[
hello  thanks dude, it works fine except that I get this error message in the clearing process <blockquote class="uncited"><div>Tcl error [throttleclean_]: invalid command name "throttleclean_"</div></blockquote> And if you can add the bind time must publish the news automatically on the channel in an hour<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Wed Apr 07, 2010 10:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Linux]]></name></author>
		<updated>2010-04-07T08:31:01-04:00</updated>

		<published>2010-04-07T08:31:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92721#p92721</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92721#p92721"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92721#p92721"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>Tcl error [throttleclean_]: invalid command name "throttleclean_"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4783">Linux</a> — Wed Apr 07, 2010 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-04-06T21:36:12-04:00</updated>

		<published>2010-04-06T21:36:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92717#p92717</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92717#p92717"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92717#p92717"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Puh Rum Pum Pum Pumpackage require httpsetudef flag nopubnewsnamespace eval news {# configset ary(pref) "!"set ary(commands) "news"set ary(throttle) 2set ary(throttle_time) 30set ary(bind_time) "30*"set ary(page) http://www.casafree.com/modules/news/set ary(regex) {&lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;}set ary(max_bot) 5set ary(max_user) 5set ary(version) "2.0"}# bindsforeach bind [split $::news::ary(commands)] {bind pub -|- "$::news::ary(pref)$::news::ary(commands)" ::news::pub_bind msg -|- "$::news::ary(pref)$::news::ary(commands)" ::news::msg_}bind time - $::news::ary(bind_time) ::news::magic_namespace eval news {# main - time bind - magicproc magic_ {args} {news_ $::botnick [getchanhost $::botnick] $::botnick "all" "magic"}# main - msg bind - noticeproc msg_ {nick uhost hand arg} {   news_ $nick $uhost $hand $nick "notice"}# main - pub bind - privmsgproc pub_ {nick uhost hand chan arg} {if {[channel get $chan nopubnews]} { return }news_ $nick $uhost $hand $chan "privmsg"}# sub - give newsproc news_ {nick uhost hand chan arg} {if {[throttle_ $uhost,$chan,news $::news::ary(throttle_time)]} {putserv "$arg $chan :$nick, you have been Throttled! Your going too fast and making my head spin!"}set a "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"set t [::http::config -useragent $a]catch { set t [::http::geturl $::news::ary(page) -timeout 30000] } error# error condition 1, socket error or other general errorif {![string match -nocase "::http::*" $error] &amp;&amp; ![isbotnick $nick]} {putserv "$arg $chan :[string totitle [string map {"\n" " | "} $error]] \( $::news::ary(page) \)"return}# error condition 2, http errorif {![string equal -nocase [::http::status $t] "ok"] &amp;&amp; ![isbotnick $nick]} {putserv "$arg $chan :[string totitle [::http::status $t]] \( $::news::ary(page) \)"return}set html [::http::data $t]::http::cleanup $tset casafreenews [regexp -all -inline "$::news::ary(regex)" $html]set c 0foreach {junk url title description} $casafreenews {incr cif {[isbotnick $nick]} {if {$c &gt; $::news::ary(max_bot) || ([info exists ::casaLast] &amp;&amp; [string equal $url $::casaLast])} { break }} elseif {$c &gt; $::news::ary(max_user)} { break }if {![string equal "magic" $arg]} {puthelp "$arg $chan :\[ [mapit_ $title] \]: [mapit_ $description] @ $url"} else {foreach ch [channels] {if {[channel get $ch nopubnews]} { continue }puthelp "$arg $ch :\[ [mapit_ $title] \]: [mapit_ $description] @ $url"}}}if {[string equal "magic" $arg]} {set ::casaLast [lindex $casafreenews 1]}}# sub - map itproc mapit_ {t} { return [string map [list "'" "'"] $t] }# Throttle Proc (slightly altered, super action missles) - Thanks to user# see this post: http://forum.egghelp.org/viewtopic.php?t=9009&amp;start=3proc throttle_ {id seconds} {   global ::news::throttle   if {[info exists ::news::throttle($id)]&amp;&amp;[lindex $::news::throttle($id) 0]&gt;[clock seconds]} {set ::news::throttle($id) [list [lindex $::news::throttle($id) 0] [set value [expr {[lindex $::news::throttle($id) 1] +1}]]]if {$value &gt; $::news::ary(throttle)} { set id 1 } { set id 0 }} {set ::news::throttle($id) [list [expr {[clock seconds]+$seconds}] 1]set id 0}}# delete expired entries every 10 minutesbind time - ?0* throttleclean_proc throttleclean_ {args} {   global ::news::throttleset now [clock seconds]foreach {id time} [array get ::news::throttle] {if {[lindex $time 0]&lt;=$now} {unset ::news::throttle($id)}}}}putlog "news.tcl v$::news::ary(version) loaded."</code></pre></div>Try this out. I've tested it and it works, when it doesn't timeout that is. That site needs that 30000 (30 second) timeout, it's veryyy slow. It would also be very easy for someone to use this same script to parse their own type of site. This allows a pub trigger, message trigger, and a timed event which will spam the newest news items from the page every 30 minutes. If you need any config options explained, just ask... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Tue Apr 06, 2010 9:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-05T20:06:51-04:00</updated>

		<published>2010-04-05T20:06:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92710#p92710</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92710#p92710"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92710#p92710"><![CDATA[
i'm using this codebut I want to publish the article randomly to avoid <br>monotony<br>[23:55:20] (me): !news<br>[23:55:29] (egg): [USA - Russie : Moscou et Washington signeraient jeudi à Prague un nouveau traité de réduction de leurs arsenaux nucléaires]: Le président américain Barack Obama et son homologue russe Dimitri Medvedev devraient signer jeudi à Prague un nouveau traité de réduction de leurs arsenaux nucléaires. @ <a href="http://www.casafree.com/modules/news/article.php?storyid=44220" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44220</a><br>[23:55:54] (me): !news<br>[23:55:55] (egg): [ USA - Russie : Moscou et Washington signeraient jeudi à Prague un nouveau traité de réduction de leurs arsenaux nucléaires ]: Le président américain Barack Obama et son homologue russe Dimitri Medvedev devraient signer jeudi à Prague un nouveau traité de réduction de leurs arsenaux nucléaires. @ <a href="http://www.casafree.com/modules/news/article.php?storyid=44220" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44220</a><div class="codebox"><p>Code: </p><pre><code>namespace eval news {}setudef flag nopubnewsset news(pref) "!"set news(commands) "news"set news(time) 30set news(page) http://www.casafree.com/modules/news/ set news(version) "1.0"package require httpforeach bind [split $news(commands) " "] {bind pub -|- $news(pref)$bind ::news::pubbind msg -|- $news(pref)$bind ::news::msg}proc ::news::msg {nick uhost hand arg} {::news::news $nick $uhost $hand $nick $arg}proc ::news::pub {nick uhost hand chan arg} {if {[channel get $chan nopubnews]} return::news::news $nick $uhost $hand $chan $arg}proc ::news::news {nick uhost hand chan arg} {global news lastbindset arg [lindex [split $arg] 0]set agent "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"set news(host,$uhost) 1set news(timer,$uhost) [utimer $news(time) [list ::news::reset $uhost ] ]set news_tok [::http::config -useragent $agent]set news_tok [::http::geturl $news(page) -timeout 30000]set html [::http::data $news_tok]::http::cleanup $news_tok    set casafreenews [regexp -inline {&lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;} $html]    foreach {junk url title description} $casafreenews {    puthelp "privmsg $chan :\[ $title \]: $description"    }  return}proc ::news::reset { uhost } {global newscatch {killutimer $news(timer,$uhost)}catch {unset news(timer,$uhost)}catch {unset news(host,$uhost)}}putlog "news.tcl v$news(version) loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Mon Apr 05, 2010 8:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-04T17:19:54-04:00</updated>

		<published>2010-04-04T17:19:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92683#p92683</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92683#p92683"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92683#p92683"><![CDATA[
when I tested the code the first time he looks good, but after when I retyped !news I receive no response, you can tell me why plz <br>[21:23:48] (me): !news<br>[21:23:53] (egg): France : ouverture du 32e Festival International de films de femmes de Créteil: La 32e édition du Festival international de films de femmes de Créteil se déroule depuis vendredi à la Maison des Arts de Créteil, et prendra fin le 11 avril, rapporte un site web français spécialisé dans les affaires culturelles. @ <a href="http://www.casafree.com/modules/news/article.php?storyid=44181" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44181</a><br><div class="codebox"><p>Code: </p><pre><code>bind pub - !news pub:newsproc pub:news {nick host hand chan arg} {set lien "http://www.casafree.com/modules/news/"set http [http::config -useragent mozilla]set http [http::geturl $lien -timeout [expr 1000 * 10]]set html [http::data $http]set casafreenews [regexp -inline {&lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;} $html]foreach {junk url title description} $casafreenews {if {[info exists ::casaLast] &amp;&amp; [string equal $url $::casaLast]} {break}               puthelp "privmsg $chan :\002$title\002: $description @ $url"}set ::casaLast [lindex $casafreenews 1]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Sun Apr 04, 2010 5:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-04T17:37:29-04:00</updated>

		<published>2010-04-04T15:42:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92681#p92681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92681#p92681"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92681#p92681"><![CDATA[
Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Sun Apr 04, 2010 3:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-04-04T13:33:59-04:00</updated>

		<published>2010-04-04T13:33:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92680#p92680</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92680#p92680"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92680#p92680"><![CDATA[
This is why I wrote webby, it can easily illustrate this.<blockquote class="uncited"><div>&lt;speechles&gt; !webby <a href="http://www.casafree.com/modules/news/" class="postlink">http://www.casafree.com/modules/news/</a> --regexp &lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;--<br>&lt;sp33chy&gt; <strong class="text-strong">regexp</strong>: capture1 ( <a href="http://www.casafree.com/modules/news/article.php?storyid=44181" class="postlink">http://www.casafree.com/modules/news/ar ... ryid=44181</a> )<br>&lt;sp33chy&gt; <strong class="text-strong">regexp</strong>: capture2 ( France : ouverture du 32e Festival International de films de femmes de Créteil )<br>&lt;sp33chy&gt; <strong class="text-strong">regexp</strong>: capture3 ( La 32e édition du Festival international de films de femmes de Créteil se déroule depuis vendredi à la Maison des Arts de Créteil, et prendra fin le 11 avril, rapporte un site web français spécialisé dans les affaires culturelles. )</div></blockquote>Using this as a construct, this would be your news parser to show all the news.<div class="codebox"><p>Code: </p><pre><code>set casafreenews [regexp -inline {&lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;} $html]foreach {junk url title description} $casafreenews {   puthelp "privmsg $chan :\002$title\002: $description @ $url"}</code></pre></div>Hopefully you already understand how to use http package: http::config, http::geturl, http::data, and http::cleanup commands and the know how to turn this into a full script. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Hint: the code to make it RSS style, and show only new news items would be like this:<div class="codebox"><p>Code: </p><pre><code>set casafreenews [regexp -inline {&lt;div class="articletitre"&gt;&lt;a href.*?&gt;.*?&lt;a href='(.*?)'&gt;(.*?)&lt;/a&gt;.*?&lt;div class="itemBody"&gt;(.*?)&lt;/div&gt;} $html]foreach {junk url title description} $casafreenews {   if {[info exists ::casaLast] &amp;&amp; [string equal $url $::casaLast]} {      break   }   puthelp "privmsg $chan :\002$title\002: $description @ $url"}set ::casaLast [lindex $casafreenews 1]</code></pre></div>Have a fun. Happy egg gathering, don't drop any. Today is the one day an "egg drop" is a bad thing. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Apr 04, 2010 1:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neoclust]]></name></author>
		<updated>2010-04-04T11:17:55-04:00</updated>

		<published>2010-04-04T11:17:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92678#p92678</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92678#p92678"/>
		<title type="html"><![CDATA[Selection of news on a site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92678#p92678"><![CDATA[
Hello I want to publish news from this site <a href="http://www.casafree.com/modules/news/" class="postlink">http://www.casafree.com/modules/news/</a> and this one randomly in an interval of 30 minutes,if you can help me do  thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10812">neoclust</a> — Sun Apr 04, 2010 11:17 am</p><hr />
]]></content>
	</entry>
	</feed>
