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

	<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>2013-05-25T14:35:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-05-25T14:35:03-04:00</updated>

		<published>2013-05-25T14:35:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101575#p101575</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101575#p101575"/>
		<title type="html"><![CDATA[Script to return Title &amp; URL of Random Sub-Reddit Post]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101575#p101575"><![CDATA[
It doesnt stores anything and at every trigger request it will display a different or the same as the last info. And to add more rss pages to this script i dont know if its the same XML version (maybe it will work) but i dont know<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat May 25, 2013 2:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neocharles]]></name></author>
		<updated>2013-05-25T12:00:02-04:00</updated>

		<published>2013-05-25T12:00:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101574#p101574</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101574#p101574"/>
		<title type="html"><![CDATA[Script to return Title &amp; URL of Random Sub-Reddit Post]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101574#p101574"><![CDATA[
I haven't tired it yet, but had a few questions...<br><br>Is this storing the information in a 'database' of sorts for what is in the rss feed? (I'd probably suggest for anyone to use the /r/subreddit-name/new/.rss instead of the top for more variety...)<br><br>And if it is, how often is it updating that?  Just on the trigger?  If I trigger 5 times in a row, is it different stuff?<br><br><br>Also, I have quite a few subreddits I'd like to toy around with this with ... if it's not too much trouble, would you be able to show me how to do different ones with the script?  Or multiple ones, etc?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12227">neocharles</a> — Sat May 25, 2013 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-05-18T09:24:52-04:00</updated>

		<published>2013-05-18T09:24:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101565#p101565</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101565#p101565"/>
		<title type="html"><![CDATA[Script to return Title &amp; URL of Random Sub-Reddit Post]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101565#p101565"><![CDATA[
This what ive comed up for what you asked<br>Im not that good with XML pages or tdom but it does what you've asked for (atleast from my tests). I know it can be done different, maybe an easy way but thats how ive managed to make it with my knowledge.<br><br>The command !news works for everything if you want to change that to a particular acces post here and ill modify the script for you.<br><br>So it gets a random title and its link from that RSS page and displays it on the main channel.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - !news rss:infopackage require httppackage require tdomproc erepublik:info {nick uhost hand chan arg} {global {my-ip} newsset l1 ""set l2 ""## ++ INFOset token [http::config -useragent Mozilla]set token [http::geturl "http://www.reddit.com/r/news/.rss"]set data [::http::data $token]::http::cleanup $tokenset XML $dataset doc [dom parse $XML]set root [$doc documentElement]foreach node [$root getElementsByTagName "title"] { if {![string match -nocase "news" $node]} { lappend l1 "[$node asText]" } }foreach node [$root getElementsByTagName "link"] { if {$node != "http://www.reddit.com/r/news/"} { lappend l2 "[$node asText]" } }set nr 0foreach n $l1 { incr nr }set nr [rand $nr]putserv "PRIVMSG $chan :Title: \00304[lindex $l1 $nr] --&gt; \00312[lindex $l2 $nr]"}</code></pre></div>PS: Not proud of this code<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat May 18, 2013 9:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neocharles]]></name></author>
		<updated>2013-04-23T16:34:56-04:00</updated>

		<published>2013-04-23T16:34:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101443#p101443</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101443#p101443"/>
		<title type="html"><![CDATA[Script to return Title &amp; URL of Random Sub-Reddit Post]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101443#p101443"><![CDATA[
What I am looking to be able to do is have anyone in the room type something like <br><div class="codebox"><p>Code: </p><pre><code>!news</code></pre></div>And it return the title of a random post, along with said URL.<br><br>Every subreddit has an rss feed available to them by adding .rss to the end of the URL<div class="codebox"><p>Code: </p><pre><code>http://www.reddit.com/r/news/.rss</code></pre></div>I imagine the easiest way would be to query the rss feed to accomplish this.<br><br><br>I know pretty much zero on scripting at all, so I was curious if there is something that is already written to accomplish this, or if someone would be able to help me in getting something working for this.  Simple enough that I can figure out how to add additional triggers for different URLs of rss feeds?<br><br><br>Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12227">neocharles</a> — Tue Apr 23, 2013 4:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
