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

	<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-10-09T10:46:35-04:00</updated>

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

		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2013-10-09T10:46:35-04:00</updated>

		<published>2013-10-09T10:46:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102096#p102096</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102096#p102096"/>
		<title type="html"><![CDATA[tweakers.net / pricewatch.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102096#p102096"><![CDATA[
Thanks for the reply!<br><br>unfortunatly there isn't a public API available; although one of the devvers of the website hinted this should always keep working:<br><br><a href="http://tweakers.net/xmlhttp/xmlHttp.php?application=sitewidesearch&amp;type=search&amp;action=pricewatch&amp;keyword=MY_SEARCH&amp;output=json" class="postlink">http://tweakers.net/xmlhttp/xmlHttp.php ... utput=json</a><br><br>For example:<br><a href="http://tweakers.net/xmlhttp/xmlHttp.php?application=sitewidesearch&amp;type=search&amp;action=pricewatch&amp;keyword=asus&amp;output=json" class="postlink">http://tweakers.net/xmlhttp/xmlHttp.php ... utput=json</a><br><br>I don't know if that outcome is workable to have the same outcome as from when the script was still working....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Wed Oct 09, 2013 10:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-10-09T00:57:14-04:00</updated>

		<published>2013-10-09T00:57:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102092#p102092</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102092#p102092"/>
		<title type="html"><![CDATA[tweakers.net / pricewatch.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102092#p102092"><![CDATA[
Every time they will update HTML code of the pages the script will stop working until it's changed again in the TCL code.<br><br>The best option would be to look if there's an API for searching tough the site. I've googled about it and found some links but don't understand dutch so..<br><br>If there isn't any, try contacting the owner and ask if there's one, or maybe he can create one or whatever.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Oct 09, 2013 12:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2013-10-08T08:41:57-04:00</updated>

		<published>2013-10-08T08:41:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102086#p102086</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102086#p102086"/>
		<title type="html"><![CDATA[tweakers.net / pricewatch.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102086#p102086"><![CDATA[
Could someone please update this script so it works with the new layout of the website?<br><br>Thanks in advance.<br><br>I really love this script!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Tue Oct 08, 2013 8:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2009-12-29T10:09:27-04:00</updated>

		<published>2009-12-29T10:09:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91477#p91477</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91477#p91477"/>
		<title type="html"><![CDATA[tweakers.net / pricewatch.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91477#p91477"><![CDATA[
Awesome; thank you very much; it seems working perfectly!<br><br>I'm really thankful, perhaps in the future i could help you out with something; as I'm learning the language<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Tue Dec 29, 2009 10:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-12-28T17:06:09-04:00</updated>

		<published>2009-12-28T17:06:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91469#p91469</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91469#p91469"/>
		<title type="html"><![CDATA[tweakers.net / pricewatch.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91469#p91469"><![CDATA[
Limited testing done. Seems Ok. Please carefully read what it says.<br><div class="codebox"><p>Code: </p><pre><code># pricewatch.tcl# arfer &lt;arfer.minute@gmail.com&gt;# DALnet #Atlantis### ------------------------------------------------------------------------------------------- ###### -------------------- OPERATION ------------------------------------------------------------ #### scrapes product price information from http://tweakers.net/pricewatch/### ------------------------------------------------------------------------------------------- ###### -------------------- CHANGELOG ------------------------------------------------------------ #### 1.0 beta release 28/12/09### ------------------------------------------------------------------------------------------- ###### -------------------- DEPENDENCIES --------------------------------------------------------- #### eggdrop 1.6.17+# tcl 8.4.x+# http 2.5.x+ (http package is normally installed by default with the shell's tcl installation)# IRC client for results output must be UTF-8 compliant, such as mIRC or XChat# IRC output channel must allow colour/bold text styles### ------------------------------------------------------------------------------------------- ###### -------------------- INSTALLATION --------------------------------------------------------- #### 1. configure pricewatch.tcl in a suitable text editor# 2. put the configured pricewatch.tcl in the bot's scripts subdirectory# 3. add a line to the bots .conf file 'source scripts/pricewatch.tcl'# 4. restart the bot# 5. requires partyline '.chanset #channelname +pricewatch' to function in #channelname### ------------------------------------------------------------------------------------------- ###### -------------------- SYNTAX --------------------------------------------------------------- #### assuming the default trigger character ! (see configuration section below)# !pw &lt;text&gt;# !pricewatch &lt;text&gt;### ------------------------------------------------------------------------------------------- ###### -------------------- CONFIGURATION -------------------------------------------------------- #### set here the single character command triggerset vPricewatchTrigger !# set here the bot user flag(s) required to permit use of the public commandsset vPricewatchFlag -# set here the maximum number of results to return# note that the actual results may be less than this value, but will never be moreset vPricewatchResults 4### ------------------------------------------------------------------------------------------- ###### -------------------- CODE ----------------------------------------------------------------- ###### ********************************* ###### ********** DO NOT EDIT ********** ###### ********************************* ###### ----- initialise ------------------------ ###set vPricewatchVersion 1.0package require httpsetudef flag pricewatchproc pPricewatchTrigger {} {  global vPricewatchTrigger  return $vPricewatchTrigger}### ----- binds ----------------------------- ###bind PUB $vPricewatchFlag [pPricewatchTrigger]pw pPricewatchScrapebind PUB $vPricewatchFlag [pPricewatchTrigger]pricewatch pPricewatchScrape### ----- procs ----------------------------- ###proc pPricewatchParse {chan text token} {  global vPricewatchResults  regexp -- {&lt;tbody&gt;(.+)&lt;/tbody&gt;} [::http::data $token] -&gt; data  if {[info exists data]} {    for {set count 1} {$count &lt;= $vPricewatchResults} {incr count} {      if {[regexp -indices -- {(&lt;/tr&gt;)} $data -&gt; idx]} {        set product($count) [regsub -all -- {[\n\t]} [string range $data 0 [expr {[lindex $idx 0] - 1}]] {}]        set data [string range $data [expr {[lindex $idx 1] + 1}] end]      }    }    if {[array size product] &gt; 0} {      set results 0      foreach name [lsort -increasing [array names product]] {        if {[regexp -- {&lt;td class=\"title ellipsis\"&gt;&lt;p&gt;&lt;a href[^&gt;]+&gt;([^&lt;]+)&lt;/a&gt;} $product($name) -&gt; model]} {          if {[regexp -- {title=\"Specificaties[^&gt;]+&gt;([^&lt;]+)&lt;/a&gt;} $product($name) -&gt; type]} {            if {[regexp -- {&lt;td class=\"price\"&gt;&lt;p&gt;&lt;a href[^&gt;]+&gt;([^&lt;]+)&lt;/a&gt;} $product($name) -&gt; price]} {              set price [regsub -- {€ } $price [encoding convertto utf-8 \u20AC]]              if {[regexp -- {&lt;p class=\"subtitle\"&gt;([^&lt;]+)&lt;/p&gt;} $product($name) -&gt; shops]} {                if {[regexp -- {&lt;td class=\"first thumb\"&gt;&lt;a href=\"([^"]+)\"} $product($name) -&gt; link]} {                  putserv "PRIVMSG $chan :&lt;pricewatch&gt; \002$model\002 -&gt; $type -&gt; \002$price\002 ($shops) -&gt; \00303\037$link\037\003"                  incr results                }              }            }          }        }      }      if {$results == 0} {putserv "PRIVMSG $chan :Nothing found for $text"}    } else {putserv "PRIVMSG $chan :Nothing found for $text"}  } else {putserv "PRIVMSG $chan :Nothing found for $text"}  return 0}proc pPricewatchScrape {nick uhost hand chan text} {  if {[channel get $chan pricewatch]} {    set keyword [regsub -all -- {[\s]} [regsub -all -- {[\s]{2,}} [string trim $text] { }] \+]    set url http://tweakers.net/pricewatch/zoeken/?keyword=$keyword    set agent [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]    if {![catch {set token [::http::geturl $url -timeout 20000]}]} {      switch -exact -- [::http::status $token] {        "timeout" {putserv "PRIVMSG $chan :Operation timed out"}        "error" {putserv "PRIVMSG $chan :Error encountered [::http::error $token]"}        "ok" {          switch -- [http::ncode $token] {            200 {pPricewatchParse $chan $text $token}            default {putserv "PRIVMSG $chan :Unexpected Ncode [http::ncode $token]"}          }        }        default {}      }      ::http::cleanup $token    } else {putserv "PRIVMSG $chan :Failed to locate URL"}  }  return 0}### ----- finalise -------------------------- ###putlog "pricewatch.tcl version $vPricewatchVersion by arfer loaded"# eof</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Dec 28, 2009 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DiEPLZ]]></name></author>
		<updated>2009-12-24T11:34:15-04:00</updated>

		<published>2009-12-24T11:34:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91431#p91431</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91431#p91431"/>
		<title type="html"><![CDATA[tweakers.net / pricewatch.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91431#p91431"><![CDATA[
Hiya people,<br><br>I'm a total n00b when it comes to scripting or coding; but I have searched for a tcl which will give me a result for the pricewatch @ tweakers.net (it's a dutch site wich checks the cheapest prices for internet stores)<br><br>The URL is: <a href="http://tweakers.net/pricewatch/" class="postlink">http://tweakers.net/pricewatch/</a><br><br>And I would like some tcl script that if I do: !pw samsung / !pricewatch samsung<br><br>it will announce a variable amount of results (wich could be set in the code)<br><br>The layout would be something like this:<br>!pw samsung<br>!pricewatch samsung<br><br>&lt; pricewatch&gt; <strong class="text-strong">Samsung Syncmaster XL2370</strong> - Monitoren - <strong class="text-strong">€ 298,-</strong> (31 winkels) - <a href="http://tweakers.net/pricewatch/245280/samsung-syncmaster-xl2370.html" class="postlink">http://tweakers.net/pricewatch/245280/s ... l2370.html</a><br>&lt; pricewatch&gt; <strong class="text-strong">Samsung Syncmaster P2370</strong> - Monitoren - <strong class="text-strong">€ 179,15</strong> (39 winkels) - <a href="http://tweakers.net/pricewatch/236702/samsung-syncmaster-p2370.html" class="postlink">http://tweakers.net/pricewatch/236702/s ... p2370.html</a><br>&lt; pricewatch&gt; <strong class="text-strong">Samsung Syncmaster 2443BW</strong> - Monitoren - <strong class="text-strong">€ 227,-</strong> (19 winkels) - <a href="http://tweakers.net/pricewatch/245685/samsung-syncmaster-2443bw.html" class="postlink">http://tweakers.net/pricewatch/245685/s ... 443bw.html</a><br><br><br><br>Would something like this be possible?<br>I hope someone is bored and would like to help a n00b out with a nice tcl script for this<br><br>It would be very much appreciated!<br><br>Thanks in advance<br><br><br>PS: I hope I've been clear enough about the request; if not; please ask for anything so I could try to make it more clear for those who are interested in making the script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11027">DiEPLZ</a> — Thu Dec 24, 2009 11:34 am</p><hr />
]]></content>
	</entry>
	</feed>
