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

	<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>2007-08-13T01:56:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[pitbull]]></name></author>
		<updated>2007-08-13T01:56:37-04:00</updated>

		<published>2007-08-13T01:56:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75235#p75235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75235#p75235"/>
		<title type="html"><![CDATA[Request: Script to get Crude oil &amp; Precious metal spot p]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75235#p75235"><![CDATA[
Thanks for your help. I managed to modify another script to get the metal prices using a loop. I couldn't get it to work for the oil prices, however, with your regexp example, I was able to modify my metals tcl and it almost worked. It was only picking up 3 variables with that expression, so I modified it a little and it got 4 like it was supposed to. I can't thank you enough for the help however <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9222">pitbull</a> — Mon Aug 13, 2007 1:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-08-13T00:12:44-04:00</updated>

		<published>2007-08-13T00:12:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75233#p75233</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75233#p75233"/>
		<title type="html"><![CDATA[Request: Script to get Crude oil &amp; Precious metal spot p]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75233#p75233"><![CDATA[
Well, if you look at any of the web scripts in the tcl archive, they would serve as a good template on which to base your script, as your example is lacking in a few places, but hey it's a good stab in the dark =)<br><br>You don't want to use pubm, you want to use a pub bind. Your regexp's are not precise enough to get the particular data you want.<br><br>For the new york gold/silver prices, I'd use something like:<br><div class="codebox"><p>Code: </p><pre><code>if {[regexp {New York Spot Price.*?Gold.*? (\d+) (\d+) .*?Silver (\d+) (\d+)} $all match goldvar1 goldvar2 silvervar1 silvervar2]} {           #do stuff with vars..}</code></pre></div>For the oil page:<div class="codebox"><p>Code: </p><pre><code>if {[regexp {&gt;Nymex Crude Future&lt;/span&gt;.*?&lt;span class="tbl_num"&gt;(.*?)&lt;/span&gt;.*?&gt;Dated Brent Spot&lt;/span&gt;.*?&lt;span class="tbl_num"&gt;(.*?)&lt;/span&gt;.*?&lt;span class="tbl_txt_green"&gt;(.*?)&lt;/span&gt;} $all match nymexprice nymexchange brentprice brentchange]} {        # do stuff</code></pre></div>I'm not 100% certain about the regexp for the 1st set of numbers, but the 2nd for the oil stuff should work. Someone else might have more eloquent regexp examples <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>And like I said, take a look at some other web scripts so you have a better idea of how to use geturl and such. Try again, we can help you make your own script (these webscripts are simple to make..I make tons of em.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Aug 13, 2007 12:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pitbull]]></name></author>
		<updated>2007-08-12T12:25:19-04:00</updated>

		<published>2007-08-12T12:25:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75217#p75217</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75217#p75217"/>
		<title type="html"><![CDATA[Request: Script to get Crude oil &amp; Precious metal spot p]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75217#p75217"><![CDATA[
Hello all, I was hoping someone could help me out and create a script that would retrieve the current Crude oil prices and precious metals. I tried writing a metals one myself, but I lack the knowledge to write the hard part. Here is what I tried:<blockquote class="uncited"><div>bind pubm - !metals get_metals<br><br>proc get_metals {nick uhost handle chan var} {<br>  set query "<a href="http://genesiss.kitco.com/scripts/cgi-bin/texten.pl" class="postlink">http://genesiss.kitco.com/scripts/cgi-bin/texten.pl</a>"<br>  set token [http::geturl $query]<br>  set all [http::data $token]<br><br>  regexp {Gold(.*)Silver} $all - gold<br>  regexp {Silver(.*)Platinum} $all - silver<br><br>  putserv "PRIVMSG $chan :Gold: Bid: [linex $gold 0] Ask: [lindex $gold 1]"<br>  putserv "PRIVMSG $chan :Silver: Bid: [linex $silver 0] Ask: [lindex $silver 1$<br><br><br>}</div></blockquote>The website I want the gold and silver price from is <a href="http://genesiss.kitco.com/scripts/cgi-bin/texten.pl" class="postlink">http://genesiss.kitco.com/scripts/cgi-bin/texten.pl</a>. Now, One problem I realized with my script, is there is 2 occurances of Gold and Silver before the spot where I want to grab the data from. I want to use the data from the New York Stock market for it. Since I couldn't get this one to work, I didn't even attempt the second. I was hoping the same thing could be done, to grab data from <a href="http://www.bloomberg.com/markets/commodities/energyprices.html" class="postlink">http://www.bloomberg.com/markets/commod ... rices.html</a> and include the Price and change for Nymex Crude Future as well as Dated Brent spot.<br><br>Thank you so much for any and all help! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9222">pitbull</a> — Sun Aug 12, 2007 12:25 pm</p><hr />
]]></content>
	</entry>
	</feed>
