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

	<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>2010-05-19T11:11:30-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SkRiBaL]]></name></author>
		<updated>2010-05-19T11:05:12-04:00</updated>

		<published>2010-05-19T11:05:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93129#p93129</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93129#p93129"/>
		<title type="html"><![CDATA[Last.fm script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93129#p93129"><![CDATA[
I am pretty sure its a problem with some of the regexp but cant seem to figure it out. If any one can please help me or point me in the right direction any help would be much appreciated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11157">SkRiBaL</a> — Wed May 19, 2010 11:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SkRiBaL]]></name></author>
		<updated>2010-05-19T11:11:30-04:00</updated>

		<published>2010-03-31T15:42:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92659#p92659</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92659#p92659"/>
		<title type="html"><![CDATA[Last.fm script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92659#p92659"><![CDATA[
Would it be possible to get a working script like the one or help fixing this one or at least a point in the right direction.<div class="codebox"><p>Code: </p><pre><code># Lastfm Artist Lookup Script by Rosc2112 at yahoo com  http://members.dandy.net/~fbn/lastfm-artist.tcl.txt# Copyright C.Leonhardt March 12, 2008 set lalver "0.1a"## Retrieves artist info from last.fm, top album and tracks (last week &amp; 6 months) # http://www.last.fm/music/## Usage:  .lfm &lt;artist&gt;  or  /msg botnick lfm &lt;artist&gt;################################################################################################################# Configs:########### channels we allow public use in:set lalchans "#mychan #chan2 #etc"# out of the above channels, these will only respond by PRIVMSG:set lalquiet "#chan2 #etc"# timeout for geturl (1/1000ths sec.)set laltout "1200000"################################################################################################################ Code Below############package require httpbind pub - .lfm lalprocbind msg - .lfm lalmsgbind msg - lfm lalmsgproc lalmsg {nick uhost hand text} {if {![onchan $nick]} {return}lalproc $nick $uhost $hand privmsg $textreturn}proc lalproc {nick uhost hand chan text} {if {([lsearch -exact $::lalchans $chan] == -1) &amp;&amp; ($chan != "privmsg")} {return}if {([lsearch -exact $::lalquiet $chan] != -1) || ($chan == "privmsg")} {set chan $nick}set text [split [string trim $text]]if {[llength $text] &lt; 1} {puthelp "PRIVMSG $nick :Lastfm Artist Lookup Script: Artist/Band Name must be at least one word."return}set originaltext $text# Need to convert space chars to html code. We'll assume the rest of the input is somewhat rational.regsub -all { } $text {%20} textregsub -all {\+} $text {%2B} textset lalurl "http://www.last.fm/music/"putquick "PRIVMSG $chan :Last.fm: looking up artist, holon.."catch {set page [::http::geturl $lalurl$text -timeout $::laltout]} errorif {[string match -nocase "*couldn't open socket*" $error]} {puthelp "PRIVMSG $nick :Error: couldn't connect to last.fm..Try again later"return}if { [::http::status $page] == "timeout" } {puthelp "PRIVMSG $nick :Error: Connection to last.fm timed out."return}set html [::http::data $page]::http::cleanup $pageif {[regexp {&lt;title&gt;(.*?) –.*?&lt;/title&gt;} $html match laltitle]} {set laltitle [split [string trim $laltitle]]if {([regexp -nocase {&lt;title&gt;Last.fm – The Social Music Revolution&lt;/title&gt;} $html])\||([regexp -nocase {&gt;We don?t know much about .*? yet.&lt;} $html])\|| ([regexp -nocase {&lt;span&gt;We don.*? have a description for this artist yet, &lt;} $html])\|| (![regexp -nocase $originaltext $laltitle])} {puthelp "PRIVMSG $chan :Last.fm: no artist info available for [join $originaltext]"return} elseif {[regexp -nocase $originaltext $laltitle]} {set lalbum "";set laltoplw "";set laltop6m ""regexp {&gt;Top Albums &lt;span&gt;.*?&lt;strong class="title"&gt;&lt;a href="/music/.*?/.*?" title=".*?"&gt;(.*?)&lt;/a&gt;&lt;/strong&gt;} $html match lalbumregexp {&lt;h3&gt;Top Tracks, Last Week&lt;/h3&gt;.*?&lt;a href="/music/.*?/_/.*?"&gt;(.*?)&lt;/a&gt;} $html match laltoplwregexp {&lt;h3&gt;Top Tracks, Last Six Months&lt;/h3&gt;.*?&lt;a href="/music/.*?/_/.*?"&gt;(.*?)&lt;/a&gt;} $html match laltop6mputhelp "PRIVMSG $chan :Last.fm \002Artist\002: $laltitle \002Top Album\002: $lalbum \002Top Track (Last week)\002: $laltoplw \002Top Track (6 months)\002: $laltop6m"return} else {puthelp "PRIVMSG $chan :Last.fm: no artist info available for [join $originaltext] "}} else {puthelp "PRIVMSG $chan :Sorry, artist \002[join $originaltext]\002 was not found."}}putlog "Last.fm Artist Lookup Script $lalver by Rosc loaded."</code></pre></div>any help would be much appreciated. <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=11157">SkRiBaL</a> — Wed Mar 31, 2010 3:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
