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

	<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>2009-02-23T19:38:06-04:00</updated>

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

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-02-23T19:38:06-04:00</updated>

		<published>2009-02-23T19:38:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87535#p87535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87535#p87535"/>
		<title type="html"><![CDATA[Scraping a little bit of text]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87535#p87535"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>package require httpsetudef flag imagesset vTimeout 10set vUrl http://imghostr.net/bind PUB - !images pImagesproc pImages {nick uhost hand channel txt} {    global vTimeout vUrl    if {[channel get $channel images]} {        set agent [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]        if {![catch {set http [::http::geturl $vUrl -timeout [expr {$vTimeout * 1000}]]}]} {            switch -- [::http::status $http] {                "timeout" {putserv "PRIVMSG $channel :attempt to scrape $vUrl timed out after $vTimeout seconds"}                "error" {putserv "PRIVMSG $channel :attempt to scrape $vUrl returned error [::http::error $http]"}                "ok" {                    switch -- [::http::ncode $http] {                        200 {                            regexp -- {Currently Hosting:\&lt;/label\&gt;(.+?)Images} [::http::data $http] -&gt; images                            if {([info exists images]) &amp;&amp; ([regexp -- {[0-9]+} $images])} {                                putserv "PRIVMSG $channel :$vUrl is currently hosting [string trim $images] images"                            } else {putserv "PRIVMSG $channel :the number of images hosted by $vUrl could not be found"}                        }                        default {putserv "PRIVMSG $channel :attempt to scrape $vUrl returned ncode [::http::ncode $http]"}                    }                }            }            ::http::cleanup $http        } else {putserv "PRIVMSG $channel :attempted connection to $vUrl failed"}    }    return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Feb 23, 2009 7:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2009-02-23T18:20:14-04:00</updated>

		<published>2009-02-23T18:20:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87534#p87534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87534#p87534"/>
		<title type="html"><![CDATA[Scraping a little bit of text]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87534#p87534"><![CDATA[
try:<div class="codebox"><p>Code: </p><pre><code>if {![regexp -- {&lt;li&gt;&lt;label&gt;Currently Hosting:&lt;/label&gt;(.+)&lt;/li&gt;} $html - s_login]} {set s_login Unknown}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Mon Feb 23, 2009 6:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[paulOr]]></name></author>
		<updated>2009-02-23T16:29:27-04:00</updated>

		<published>2009-02-23T16:29:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87533#p87533</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87533#p87533"/>
		<title type="html"><![CDATA[Scraping a little bit of text]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87533#p87533"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>package require httpsetudef flag serverinfovariable serverquery "http://www.imghostr.net/"variable servertimeout 10bind pub - "!imghostr" checkserverproc checkserver {nick host hand chan rest} {       # chanset catch, use .chanset #yourchan +serverinfo to enable       if {[lsearch -exact [channel info $chan] +serverinfo] == -1} { return 0 }       # browser agent       set http [::http::config -useragent "Mozilla"]       # get url with error control       catch {set http [::http::geturl "$::serverquery" -timeout [expr 1000 * $::servertimeout]]} error       # case 1, no socket       if {[string match -nocase "*couldn't open socket*" $error]} {              putserv "privmsg $chan : Cannot open socket. Try again later."              ::http::cleanup $http              return 0       }       # case 2, timeout       if { [::http::status $http] == "timeout" } {              putserv "privmsg $chan : Website has timed out. Try again later."              ::http::cleanup $http              return 0       }       # case 3, success, get html       set html [::http::data $http]       # scrape the page       if {![regexp -- {&lt;li&gt;&lt;label&gt;Currently Hosting:&lt;/label&gt;.*?&lt;/li&gt;} $html - s_login]} {set s_login Unknown}       # reformat scraped information and message to irc.       puthelp "privmsg $chan :images : $s_login"       return 1}</code></pre></div>So i done some searching and found what i think should do the job, iv added in the HTML sarounding what im wanting to show.<br><br><a href="http://imghostr.net" class="postlink">http://imghostr.net</a> &lt;-- i want the current image count: Currently Hosting ### Images.<br><br>Can anyone see where im going wrong?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10300">paulOr</a> — Mon Feb 23, 2009 4:29 pm</p><hr />
]]></content>
	</entry>
	</feed>
