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

	<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>2021-03-30T17:46:24-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-03-30T17:46:24-04:00</updated>

		<published>2021-03-30T17:46:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109688#p109688</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109688#p109688"/>
		<title type="html"><![CDATA[Parsing a entire html source page]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109688#p109688"><![CDATA[
Google don't think you're a bot, google redirects you to a version you can read (without javascript).<div class="codebox"><p>Code: </p><pre><code>set tok [::http::geturl $url]if {[::http::ncode $tok]==301 || [::http::ncode $tok]==302} {   set meta $tok(meta)   set data [::http::data [::http::geturl $meta(Location)]]} else {   set data [::http::data $tok]}</code></pre></div>Note that this system works only if there is just one redirection.<br><br>And I don't understand why you do <em class="text-italics">::http::config -useragent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" </em> <strong class="text-strong">after</strong> having used ::http ? The ::http::config must be at the initialisation of ::http<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Mar 30, 2021 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-30T16:16:55-04:00</updated>

		<published>2021-03-30T16:16:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109687#p109687</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109687#p109687"/>
		<title type="html"><![CDATA[Parsing a entire html source page]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109687#p109687"><![CDATA[
Tried your suggestion CrazyCat, <div class="codebox"><p>Code: </p><pre><code>bind PUB - "!test" the:testpackage require httppackage require tlsproc the:test {nick host hand chan text} {http::register https 443 [list ::tls::socket]set url "https://www.google.com/search?q=lego+ninjago"set tok [::http::geturl $url]if {[::http::ncode $tok]==301 || [::http::ncode $tok]==302} {  putserv "PRIVMSG $chan :FAIL"} else {   set data [::http::data $tok]}::http::config -useragent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"foreach lines2 $data {putserv "PRIVMSG $chan :$lines2"}http::unregister https}</code></pre></div>Results<div class="codebox"><p>Code: </p><pre><code>20&lt;ComputerTech&gt;30 !test18&lt;Tech18&gt; FAIL</code></pre></div>Google still thinks i am a bot,  any ideas to bypass this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Tue Mar 30, 2021 4:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-30T02:27:58-04:00</updated>

		<published>2021-03-30T02:27:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109684#p109684</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109684#p109684"/>
		<title type="html"><![CDATA[Parsing a entire html source page]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109684#p109684"><![CDATA[
Thanks CrazyCat will try that  <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=12849">ComputerTech</a> — Tue Mar 30, 2021 2:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-03-30T01:55:51-04:00</updated>

		<published>2021-03-30T01:55:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109683#p109683</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109683#p109683"/>
		<title type="html"><![CDATA[Parsing a entire html source page]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109683#p109683"><![CDATA[
This is because you didn't think about potential redirections (as 301 or 302), and don't analyse the status.<br>Your line:<div class="codebox"><p>Code: </p><pre><code>set data [::http::data [::http::geturl "$url" -timeout 10000]]</code></pre></div>The better way (not the best):<div class="codebox"><p>Code: </p><pre><code>set tok [::http::geturl $url]if {[::http::ncode $tok]==301 || [::http::ncode $tok]==302} {   // this is a redirection} else {   set data [::http::data $tok]}</code></pre></div>You can also use ::http::status and other infos to know if you are on the good page.<br><br>Have a look on <a href="https://www.tcl.tk/man/tcl8.4/TclCmd/http.htm" class="postlink">https://www.tcl.tk/man/tcl8.4/TclCmd/http.htm</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Mar 30, 2021 1:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-30T00:57:57-04:00</updated>

		<published>2021-03-30T00:57:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109682#p109682</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109682#p109682"/>
		<title type="html"><![CDATA[Parsing a entire html source page]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109682#p109682"><![CDATA[
So i am trying to retrieve the entire code from this https:://google.com/search?q=lego<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - "!test" the:testpackage require httppackage require tlsproc the:test {nick host hand chan text} {http::register https 443 [list ::tls::socket]set url "https://www.google.com/search?q=lego"set data [::http::data [::http::geturl "$url" -timeout 10000]]::http::config -useragent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"foreach lines2 $data {putserv "PRIVMSG $chan :$lines2"}http::unregister https}</code></pre></div>And i am getting this<div class="codebox"><p>Code: </p><pre><code>&lt;Tech&gt; &lt;HTML&gt;&lt;HEAD&gt;&lt;meta&lt;Tech&gt; http-equiv="content-type"&lt;Tech&gt; content="text/html;charset=utf-8"&gt;&lt;Tech&gt; &lt;TITLE&gt;302&lt;Tech&gt; Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;Tech&gt; &lt;H1&gt;302&lt;Tech&gt; Moved&lt;/H1&gt;&lt;Tech&gt; The&lt;Tech&gt; document&lt;Tech&gt; has&lt;Tech&gt; moved&lt;Tech&gt; &lt;A&lt;Tech&gt; HREF="https://www.google.com/sorry/index?continue=https://www.google.com/search%3Fq%3Dlego&amp;q=EhAmB1MAAGEA2QAMAAAAAAAAGIDuioMGIhkA8aeDS7Cl4MTYJvxJOGvj5SyvlN0tmGEIMgFy"&gt;here&lt;/A&gt;.&lt;Tech&gt; &lt;/BODY&gt;&lt;/HTML&gt;</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Tue Mar 30, 2021 12:57 am</p><hr />
]]></content>
	</entry>
	</feed>
