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

	<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>2011-08-29T19:40:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-08-29T19:40:47-04:00</updated>

		<published>2011-08-29T19:40:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97568#p97568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97568#p97568"/>
		<title type="html"><![CDATA[Twitter tweet displayer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97568#p97568"><![CDATA[
<blockquote class="uncited"><div><br>Yeah I saw Birdy but it's a bit more than I want actually. Just want to keep it simple.</div></blockquote>Problem is, with that /#!/ in the url. It is going to use twitter's api. This uses json xml payloads. You won't be able to go about it as easily as you are thinking reading those. Because they are handled under oauth.<br><br><br>Instead... What you can do is use their non-api method, which still exists.<br><blockquote class="uncited"><div>&lt;speechles&gt; !webby twitter.com/wilw/statuses/108277782815051776 --regexp class="entry-content"&gt;(.*?)&lt;/span&gt;.*?&lt;span class="published timestamp".*?&gt;(.*?)&lt;/a&gt;&lt;/span&gt;--<br>&lt;sp33chy&gt; <strong class="text-strong">regexp</strong>: capture1 ( Our caterers put out franks and beans to go with lunch, labeled as "Tubesteak Chowder." My inner 12 year-old is still laughing. #Eureka )<br>&lt;sp33chy&gt; <strong class="text-strong">regexp</strong>: capture2 ( about 2 hours ago via Twitter for iPad )</div></blockquote>Webby proves that can be done.. So here's what I'm giving you.<br><blockquote class="uncited"><div>&lt;speechles&gt; <a href="http://twitter.com/wilw/statuses/108277782815051776" class="postlink">http://twitter.com/wilw/statuses/108277782815051776</a><br>&lt;sp33chy&gt; <strong class="text-strong">wilw</strong> (Wil Wheaton): Our caterers put out franks and beans to go with lunch, labeled as "Tubesteak Chowder." My inner 12 year-old is still laughing. #Eureka ( <a href="http://twitter.com/search?q=%23Eureka" class="postlink">http://twitter.com/search?q=%23Eureka</a> ) ( about 3 hours ago via Twitter for iPad )</div></blockquote><div class="codebox"><p>Code: </p><pre><code># Script to grab titles from webpages - Copyright C.Leonhardt (rosc2112 at yahoo com) Aug.11.2007 # http://members.dandy.net/~fbn/urltitle.tcl.txt# Loosely based on the tinyurl script by Jer and other bits and pieces of my own..# Hacked by speechles, to add special things for twitter! :P################################################################################################################# Usage: # 1) Set the configs below# 2) .chanset #channelname +urltitle        ;# enable script# 3) .chanset #channelname +logurltitle     ;# enable logging# Then just input a url in channel and the script will retrieve the title from the corresponding page.# When reporting bugs, PLEASE include the .set errorInfo debug info! # Read here: http://forum.egghelp.org/viewtopic.php?t=10215################################################################################################################# Configs:set urltitle(ignore) "bdkqr|dkqr" ;# User flags script will ignore input fromset urltitle(pubmflags) "-|-" ;# user flags required for channel eggdrop useset urltitle(length) 5 ;# minimum url length to trigger channel eggdrop useset urltitle(delay) 1 ;# minimum seconds to wait before another eggdrop useset urltitle(timeout) 60000 ;# geturl timeout (1/1000ths of a second)################################################################################################################# Script begins:package require http;# You need the http package..set urltitle(last) 111 ;# Internal variable, stores time of last eggdrop use, don't change..setudef flag urltitle;# Channel flag to enable script.setudef flag logurltitle;# Channel flag to enable logging of script.set urltitlever "0.01a"bind pubm $urltitle(pubmflags) {*://*} pubm:urltitleproc pubm:urltitle {nick host user chan text} {global urltitleif {([channel get $chan urltitle]) &amp;&amp; ([expr [unixtime] - $urltitle(delay)] &gt; $urltitle(last)) &amp;&amp; \(![matchattr $user $urltitle(ignore)])} {foreach word [split $text] {if {[string length $word] &gt;= $urltitle(length) &amp;&amp; \[regexp {^(f|ht)tp(s|)://} $word] &amp;&amp; \![regexp {://([^/:]*:([^/]*@|\d+(/|$))|.*/\.)} $word]} {set urltitle(last) [unixtime]set urtitle [urltitle $word]if {[llength $urtitle] &lt; 2} {puthelp "PRIVMSG $chan :$nick: URL Title for $word - \002[join [url_map $urtitle]]\002"} else {puthelp "PRIVMSG $chan :[url_map [url_map [lindex $urtitle 0]]]"}break}}        }if {[channel get $chan logurltitle]} {foreach word [split $text] {if {[string match "*://*" $word]} {putlog "&lt;$nick:$chan&gt; $word -&gt; $urtitle"}}}# change to return 0 if you want the pubm trigger logged additionally..return 1}proc urltitle {url} {if {[info exists url] &amp;&amp; [string length $url]} {catch {set http [::http::geturl $url -timeout $::urltitle(timeout)]} errorif {[string match -nocase "*couldn't open socket*" $error]} {return "Error: couldn't connect..Try again later"}if { [::http::status $http] == "timeout" } {return "Error: connection timed out while trying to contact $url"}set data [::http::data $http]regsub -all {(?:\n|\t|\v|\r|\x01)} $data " " dataset ncode [http::ncode $http]::http::cleanup $httpset title ""if {[string match *twitter.com* $url]} {while {[string match 30* $ncode]} {regexp -nocase -- {&lt;a href="(.*?)"&gt;} $data - urlregexp -all -- {/#!} $url "" urlcatch {set http [::http::geturl $url -timeout $::urltitle(timeout)]} errorif {[string match -nocase "*couldn't open socket*" $error]} {return "Error: couldn't connect..Try again later"}if { [::http::status $http] == "timeout" } {return "Error: connection timed out while trying to contact $url"}set data [::http::data $http]set ncode [::http::ncode $http]http::cleanup $http}regsub -all {(?:\n|\t|\v|\r|\x01)} $data " " dataif {[regexp -nocase {class="entry-content"&gt;(.*?)&lt;/span&gt;.*?&lt;span class="published timestamp" data=".*?"&gt;(.*?)&lt;/a&gt;&lt;/span&gt;} $data match ltweet ago]} {# scrub html elements outregsub -all {&lt;.*?&gt;} $ago "" agoregsub -all -nocase -- {&lt;a href="(/search\?q\=.*?)".*?&gt;(.*?)&lt;/a&gt;} [string trim $ltweet] "\\2 ( http://twitter.com\\1 \)" ltweetregsub -all -nocase -- {&lt;a href="(.*?)".*?&gt;(.*?)&lt;/a&gt;} $ltweet "( \\1 \)" ltweetregsub -all -nocase -- {(?!&lt;@)&lt;a class="tweet.*?href="(.*?)".*?&gt;(.*?)&lt;/a&gt;(?!&gt;)} $ltweet "\\2 \( _\?\=\\1 \)" ltweetregsub -all -nocase -- {&lt;\+@&lt;a class="tweet.*?href=".*?".*?&gt;(.*?)&lt;/a&gt;&gt;} $ltweet "&lt;+@\\1&gt;" ltweetregsub -all -nocase -- {&lt;\@&lt;a class="tweet.*?href=".*?".*?&gt;(.*?)&lt;/a&gt;&gt;} $ltweet "&lt;@\\1&gt;" ltweetregsub -all -nocase -- {_\?\=(.*?) } $ltweet "http://twitter.com\\1 " ltweetregexp -nocase {class="tweet-url screen-name" hreflang="[a-z]{2}" title="(.*?)"&gt;(.*?)&lt;/a&gt;} $data match real screenreturn [list "\002$screen\002 ($real): $ltweet ( $ago )" "twitter"]}} elseif {[regexp -nocase {&lt;title&gt;(.*?)&lt;/title&gt;} $data match title]} {return [list "[string map { {href=} "" " "" } $title]"]} else {return [list "No title found."]}}}proc url_map {text {char "utf-8"} } {# code below is neccessary to prevent numerous html markups# from appearing in the output (ie, ", ᘧ, etc)# stolen (borrowed is a better term) from tcllib's htmlparse ;)# works unpatched utf-8 or not, unlike htmlparse::mapEscapes# which will only work properly patched....set escapes {  \xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4¥ \xa5 ¦ \xa6 § \xa7 ¨ \xa8 © \xa9ª \xaa « \xab ¬ \xac ­ \xad ® \xae¯ \xaf ° \xb0 ± \xb1 ² \xb2 ³ \xb3´ \xb4 µ \xb5 ¶ \xb6 · \xb7 ¸ \xb8¹ \xb9 º \xba » \xbb ¼ \xbc ½ \xbd¾ \xbe ¿ \xbf À \xc0 Á \xc1 Â \xc2Ã \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xccÍ \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6× \xd7 Ø \xd8 Ù \xd9 Ú \xda Û \xdbÜ \xdc Ý \xdd Þ \xde ß \xdf à \xe0á \xe1 â \xe2 ã \xe3 ä \xe4 å \xe5æ \xe6 ç \xe7 è \xe8 é \xe9 ê \xeaë \xeb ì \xec í \xed î \xee ï \xefð \xf0 ñ \xf1 ò \xf2 ó \xf3 ô \xf4õ \xf5 ö \xf6 ÷ \xf7 ø \xf8 ù \xf9ú \xfa û \xfb ü \xfc ý \xfd þ \xfeÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39EΟ \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BAλ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BFπ \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F∑ \u2211 − \u2212 ∗ \u2217 √ \u221A∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A⌋ \u230B 〈 \u2329 〉 \u232A ◊ \u25CA♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666" \x22 &amp; \x26 &lt; \x3C &gt; \x3E O&amp;Elig; \u152 œ \u153Š \u160 š \u161 Ÿ \u178 ˆ \u2C6˜ \u2DC   \u2002   \u2003   \u2009‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A“ \u201C ” \u201D „ \u201E † \u2020‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A€ \u20AC &amp;apos; \u0027};if {![string equal $char [encoding system]]} { set text [encoding convertfrom $char $text] }set text [string map [list "\]" "\\\]" "\[" "\\\[" "\$" "\\\$" """ "\\""] [string map $escapes $text]]regsub -all -- {&amp;#([[:digit:]]{1,5});} $text {[format %c [string trimleft "\1" "0"]]} textregsub -all -- {&amp;#x([[:xdigit:]]{1,4});} $text {[format %c [scan "\1" %x]]} textcatch { set text "[subst "$text"]" }if {![string equal $char [encoding system]]} { set text [encoding convertto $char $text] }return "$text"}putlog "Url Title Grabber $urltitlever (rosc) script loaded.. (super action rocket missles by speechles :P)"</code></pre></div>Basically, yeah, it's rosc2112's good old url-title grabber. Hacked together with my url decoder thingy from my other scripts. So this script will also, show the title of url's pasted. But when it's a twitter one it sees, it will reply differently. I hacked in small modification that is extensible. This is the direction the script Webby I wrote is headed in. It will have custom parsing templates and all sorts of crazy stuff. But this may take time, months, years.. who knows.. But I do know how to accomplish it, all I need is time, and motivation... haw<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Aug 29, 2011 7:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fewyn]]></name></author>
		<updated>2011-08-29T17:28:01-04:00</updated>

		<published>2011-08-29T17:28:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97565#p97565</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97565#p97565"/>
		<title type="html"><![CDATA[Twitter tweet displayer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97565#p97565"><![CDATA[
<blockquote class="uncited"><div>Have you seen <a href="http://forum.egghelp.org/viewtopic.php?t=17556" class="postlink"><strong class="text-strong">Birdy</strong></a>?<br><br>While it doesn't yet allow referencing an exact tweet via ID, such as what you are doing. It allows for much more "interaction" than just spewing what someone on twitter tweets. With Birdy you can also, reply to them via !tweet. !retweet them. Etc Etc<br><br>Maybe this is more than what you wanted. Basically any url-title fetching type script with minor changes to it's parsing template can do what you are asking. As basically, you are feeding it URL's. Pretty dead simple. Instead give the users of your IRC channel something more to play with. Their own twitter account for the channel to use. This is what Birdy allows you to do. <br><br>Anyways, didn't know if you've already seen Birdy or not. It shall be updated soon to fix the shortcomings and errors it presently has. It is a constant work-in-progress and users dictate its evolution. So if you have a feature or something to include within Birdy. Shout it out. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"></div></blockquote>Yeah I saw Birdy but it's a bit more than I want actually. Just want to keep it simple.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5840">fewyn</a> — Mon Aug 29, 2011 5:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-08-29T17:19:36-04:00</updated>

		<published>2011-08-29T17:19:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97564#p97564</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97564#p97564"/>
		<title type="html"><![CDATA[Twitter tweet displayer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97564#p97564"><![CDATA[
Have you seen <a href="http://forum.egghelp.org/viewtopic.php?t=17556" class="postlink"><strong class="text-strong">Birdy</strong></a>?<br><br>While it doesn't yet allow referencing an exact tweet via ID, such as what you are doing. It allows for much more "interaction" than just spewing what someone on twitter tweets. With Birdy you can also, reply to them via !tweet. !retweet them. Etc Etc<br><br>Maybe this is more than what you wanted. Basically any url-title fetching type script with minor changes to it's parsing template can do what you are asking. As basically, you are feeding it URL's. Pretty dead simple. Instead give the users of your IRC channel something more to play with. Their own twitter account for the channel to use. This is what Birdy allows you to do. <br><br>Anyways, didn't know if you've already seen Birdy or not. It shall be updated soon to fix the shortcomings and errors it presently has. It is a constant work-in-progress and users dictate its evolution. So if you have a feature or something to include within Birdy. Shout it out. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Aug 29, 2011 5:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fewyn]]></name></author>
		<updated>2011-08-29T16:51:12-04:00</updated>

		<published>2011-08-29T16:51:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97563#p97563</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97563#p97563"/>
		<title type="html"><![CDATA[Twitter tweet displayer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97563#p97563"><![CDATA[
I've seen bots that have done this in the past but for the life of me I can't find  a script anywhere that does something like this.<br><br>Basically when someone pastes a a twitter url into chat it goes and fetches the tweet and spits it back out into IRC.<br><br>Example:<br>&lt;fewyn&gt; <a href="https://twitter.com/#!/wilw/statuses/108277782815051776" class="postlink">https://twitter.com/#!/wilw/statuses/108277782815051776</a><br>&lt;Bot&gt; Our caterers put out franks and beans to go with lunch, labeled as "Tubesteak Chowder." My inner 12 year-old is still laughing. #Eureka (wilw, 9m ago)<br><br>Any help?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5840">fewyn</a> — Mon Aug 29, 2011 4:51 pm</p><hr />
]]></content>
	</entry>
	</feed>
