EDIT: I made an alias version of just the now playing command. Use /lfm to spam.
Here (Change line 6 to your username)
Last.fm Info via API. Thanks to ES for helping me out with this and just generally being a bro.
!lfmhelp - for this list of commands
---Adding yourself to the bot
--
!lfma username :: Add yourself to the bot
!lfmd username :: Remove yourself from the bot
--
---Basic information
!lfm [username] :: Now Playing info
!lfmu [username] :: Profile information on the specified user
--
---Advanced information
!lfmc user1 [user2] :: Taste-O-Meter rating with another nick. Type !lfmhelp compare for more information.
!lfms artist :: 10 artists similar to the one specified
!lfmnr <1-10/username> [1-10] :: Recommended new album(s) based on your listening history. Type !lfmhelp nr for more information.
!lfmta :: Top 10 overall artists on the Last.fm charts
!lfmuta <overall|7day|3month|6month|12month> [username] :: Top 10 Artists for a specific period/user
!lfmn [username] :: Top 10 recommended Neighbors for the specified user
Values in [ ] are optional.
-------------------------------------Examples
(11:35:27 pm) <~hxck> !lfm [name]
(11:35:28 pm) <~Victoria> Last.fm » Moonlit Sailor - Sunbeams (Played 53 times) <3 [05:29]
The Now Playing command will show artist - song, how many times the track has been played, if its a loved track and the length.
-------------------------------------
(11:11:57 pm) <~hxck> !lfmu [name]
(11:11:59 pm) <~Victoria> Last.fm » User: fleshis4zombies » ID: 10339776 » Subscriber? No » Type: user
(11:12:01 pm) <~Victoria> Last.fm » Real Name: DJ Jazzy Jeff » Name: fleshis4zombies » Age: 24 » Gender: Male » Country: US
(11:12:01 pm) <~Victoria> Last.fm » Plays: 18884 » Image:
http://userserve-ak.last.fm/serve/126/66169924.png »
http://last.fm/user/fleshis4zombies
The User Info command displays profile information on specified nick.
-------------------------------------
(04:23:56 pm) <~hxck> !lfmc ohaitharu
(04:23:57 pm) <~Victoria> Last.fm » fleshis4zombies's compatibility with ohaitharu is Low (28.5%). Artist(s) they have in common include(s) Victoria Justice, Ferry Corsten, Ariana Grande, Skrillex, From Autumn to Ashes.
The Taste-O-Meter Comparison command takes 2 users and compares their tastes together, same as its done automatically when you visit a person's profile on the site. Gives percentage and 5 similar artists.
-------------------------------------
(11:11:10 pm) <~hxck> !lfms Fear Before The March of Flames
(11:11:11 pm) <~Victoria> Last.fm » Similar Artists: Fear Before, Heavy Heavy Low Low, The Number Twelve Looks Like You, ORBS, The Jonbenet, Duck Duck Goose, Trophy Scars, The Blood Brothers, Poison The Well, United Nations.
The Similar Artists command grabs 10 similar artists to the one you supply, same as visiting an artist page on the website.
-------------------------------------
(05:32:11 pm) <~hxck> !lfmnr [name] 5
(05:32:13 pm) <~Victoria> Last.fm » New Album Releases for fleshis4zombies are: Greatest Hits 1 & 2 - Journey, Cinematic Attractions - A Static Lullaby, Empros - Russian Circles, Low Level Owl, Vol. 1 + 2 - The Appleseed Cast, Shoulders & Giants - Collapse Under the Empire.
The New Releases command grabs up to 10 new releases of bands you've listened to based on your history.
-------------------------------------
(11:08:49 pm) <~hxck> !lfmta
(11:08:50 pm) <~Victoria> Last.fm » Top of the Last.fm Charts: Coldplay, Radiohead, Adele, The Beatles, Rihanna, Florence + The Machine, Red Hot Chili Peppers, Muse, Lady Gaga, Nirvana.
The Top Artists command shows the top 10 artists on the Last.fm charts.
-------------------------------------
(07:39:00 am) <~hxck> !lfmuta [name] 7day
(07:39:04 am) <~Victoria> Last.fm » Top 5 Artists for fleshis4zombies » Period: Last 7 Days: C418, I See Stars, Rosaline, Emery, Glassjaw,
The User Top Artists command shows the top 5 artists for a specified period/user. Possible periods include Overall, 7day, 3month, 6month and 12month.
-------------------------------------
(10:52:54 pm) <~hxck> !lfmn [name]
(10:52:55 pm) <~Victoria> Last.fm » Top 10 Neighbors: SkaterKuehl96, Wes2theG, charliestrouse3, brainlessbrook, wendy-clear, oceanfloorgrave, danielg2112, mts5424, laurenelysse, skyisthelimit13.
http://www.last.fm/user/fleshis4zombies/neighbours
The Neighbors command gives you the top 10 users recommended as friends based on Taste-O-Meter compatibility. On *:START: {
if (!$hget(lastinfo)) { hmake lastinfo 20 }
hload -s lastinfo lastinfo.hsh
}
On *:LOAD: {
if (!$hget(lastinfo)) { hmake lastinfo 20 }
hload -s lastinfo lastinfo.hsh
}
on *:TEXT:!lfmhelp*:#: {
if ($2 == nr) {
.query $nick The New Releases command works 4 ways:
.query $nick 1. !lfmnr - This will show 5 (Default) recommended new albums based on the person who triggered it
.query $nick 2. !lfmnr <1-10> - This will show 1-10 (depending on what you chose) recommended new albums based on the person who triggered it
.query $nick 3. !lfmnr [username] - This will show 5 (default) recommended new albums based on username
.query $nick 4. !lfmnr [username] <1-10> - This will show 1-10 (depending on what you chose) recommended new albums based on username
}
if ($2 == compare) {
.query $nick The Taste-O-Meter works 2 ways:
.query $nick !lfmc user1 - This will compare user1 with the person who triggered it (assuming that person has added their Last.fm nick to the bot)
.query $nick !lfmc user1 user2 - This will compare user1 with user2
}
if (!$2) {
.query $nick !lfmhelp - for this list of commands
.query $nick 3---Adding yourself to the bot
.query $nick --
.query $nick !lfma username :: Add yourself to the bot
.query $nick !lfmd username :: Remove yourself from the bot
.query $nick --
.query $nick 3---Basic information
.query $nick !lfm [username] :: Now Playing info
.query $nick !lfmu [username] :: Profile information on the specified user
.query $nick --
.query $nick 3---Advanced information
.query $nick !lfmc user1 [user2] :: Taste-O-Meter rating with another nick. Type !lfmhelp compare for more information.
.query $nick !lfms artist :: 10 artists similar to the one specified
.query $nick !lfmnr <1-10/username> [1-10] :: Recommended new album(s) based on your listening history. Type !lfmhelp nr for more information.
.query $nick !lfmta :: Top 10 overall artists on the Last.fm charts
.query $nick !lfmuta <overall|7day|3month|6month|12month> [username] :: Top 10 Artists for a specific period/user
.query $nick !lfmn [username] :: Top 10 recommended Neighbors for the specified user
}
}
on *:TEXT:!lfm*:#: {
if ($sock(lfm)) { sockclose lfm }
; ===================
; Add or Remove Users
; ===================
if ($1 == !lfma) {
hadd lastinfo $nick $2
msg # Added! Use !lfm or !lfmu
}
if ($1 == !lfmd) {
hdel lastinfo $nick $2
msg # User removed.
}
; =================
; Set method 'Info'
; =================
if ($1 == !lfmu) {
if ($sock(lfm)) { sockclose lfm }
set %methodd info
if (!$2) {
if (!$hget(lastinfo, $nick)) {
msg $chan No such nick regged with the bot, please add one using !lfma <Last.FM Nick>
halt
}
if $hget(lastinfo, $nick) {
set %username $hget(lastinfo, $nick)
set %method /2.0/?method=user.getinfo&user= $+ %username $+ &limit=1&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
}
if ($2) {
set %username $iif($hget(lastinfo, $2),$hget(lastinfo, $2),$2)
set %method /2.0/?method=user.getinfo&user= $+ %username $+ &limit=1&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm »
}
; ===============
; Set method 'NP'
; ===============
if ($1 == !lfm) {
if ($sock(lfm)) { sockclose lfm }
set %lfmnametemp 0
set %lfmartisttemp 0
set %lfmalbumtemp 0
set %methodd np
if (!$2) {
if (!$hget(lastinfo, $nick)) {
msg $chan No such nick regged with the bot, please add one using !lfma <Last.FM Nick>
halt
}
if ($hget(lastinfo, $nick)) {
set %username $hget(lastinfo, $nick)
set %method /2.0/?method=user.getrecenttracks&user= $+ %username $+ &limit=1&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
}
if ($2) {
set %username $iif($hget(lastinfo, $2),$hget(lastinfo, $2),$2)
set %method /2.0/?method=user.getrecenttracks&user= $+ %username $+ &limit=1&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
sockopen lfm ws.audioscrobbler.com 80
set %lfm.chan #
}
;=====================
; Set method 'Compare'
;=====================
if ($1 == !lfmc) {
set %methodd compare
if (!$2) { msg # You must provide a nickname to compare with. | halt }
if (!$3) {
if (!$hget(lastinfo,$nick)) { msg # You're not regged with the bot, please add one using !lfma <Last.FM Nick>, or do !lfmc <Last.FM Nick 1> <Last.FM Nick 2> | halt }
else {
set %lfmcu1 $hget(lastinfo,$nick)
set %lfmcu2 $iif($hget(lastinfo,$2),$hget(lastinfo,$2),$2)
}
}
if ($3) {
set %lfmcu1 $iif($hget(lastinfo,$2),$hget(lastinfo,$2),$2)
set %lfmcu2 $iif($hget(lastinfo,$3),$hget(lastinfo,$3),$3)
}
set %method $+(/2.0/?method=tasteometer.compare&type1=user&type2=user&value1=,%lfmcu1,&value2=,%lfmcu2,&api_key=bdf34b247ee7ee2ccd8e856a675bb82d)
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm 4»
}
;=====================
; Set method 'Similar'
;=====================
if ($1 == !lfms) {
set %methodd similar
if (!$2) { msg # You must provide an artist. | halt }
set %method /2.0/?method=artist.getsimilar&artist= $+ $replace($2-,$chr(32),$chr(43)) $+ &autocorrect=1&limit=10&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm 4»
}
;==========================
; Set method 'New Releases'
;==========================
if ($1 == !lfmnr) {
if (($2) && (!$3)) {
if ($2 isnum) {
if ($2 > 10) { msg # Sorry, but that'll be too many releases, please choose a number between 1 and 10 | halt }
if ($2 isnum 1-10) {
if (!$hget(lastinfo,$nick)) { msg $chan You're not regged with the bot, please add one using !lfma <Last.FM Nick> | halt }
set %lfmnrout $2
set %username $hget(lastinfo,$nick)
}
}
else {
set %lfmnrout 5
set %username $iif($hget(lastinfo,$2),$hget(lastinfo,$2),$2)
}
}
if (!$2) {
if (!$hget(lastinfo,$nick)) { msg $chan You're not regged with the bot, please add one using !lfma <Last.FM Nick> | halt }
else {
set %lfmnrout 5
set %username $hget(lastinfo,$nick)
}
}
if ($3) {
set %username $iif($hget(lastinfo,$2),$hget(lastinfo,$2),$2)
if ($3 > 10) { msg # Sorry, but that'll be too many releases, please choose a number between 1 and 10 | halt }
if ($3 isnum 1-10) { set %lfmnrout $3 }
}
set %methodd lfmnr
set %lfmnametemp 0
set %lfmnrtemp 0
set %method $+(/2.0/?method=user.getnewreleases&user=,%username,&api_key=bdf34b247ee7ee2ccd8e856a675bb82d)
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm 4»
}
;===============================
; Set method 'Chart Top Artists'
;===============================
if ($1 == !lfmta) {
set %methodd lfmta
set %method http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&limit=10&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm 4»
}
;==============================
; Set method 'User Top Artists'
;==============================
if ($1 == !lfmuta) {
set %methodd lfmuta
if (!$2) { msg # You must provide a period of time. Acceptable inputs are: Overall, 7day, 3month, 6month and 12month. | halt }
if (($2) && (!$3)) {
if ($2 == overall) || ($2 == 7day) || ($2 == 3month) || ($2 == 6month) || ($2 == 12month) {
set %period $2
if (!$hget(lastinfo,$nick)) { msg # You're not regged with the bot, please add one using !lfma <Last.FM Nick> | halt }
set %username $hget(lastinfo,$nick)
set %method http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user= $+ %username $+ &period= $+ %period $+ &limit=10&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
else { msg # 4Last.fm 4» Acceptable inputs are: Overall, 7day, 3month, 6month and 12month. | halt }
}
if (($2) && ($3)) {
if ($2 == overall) || ($2 == 7day) || ($2 == 3month) || ($2 == 6month) || ($2 == 12month) {
set %period $2
set %username $iif($hget(lastinfo,$3),$hget(lastinfo,$3),$3)
set %method http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user= $+ %username $+ &period= $+ %period $+ &limit=10&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
else { msg # 4Last.fm 4» Acceptable inputs are: Overall, 7day, 3month, 6month and 12month. | halt }
}
if ($sock(lfm)) { sockclose lfm }
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm 4»
}
;============================
; Set method 'User Neighbors'
;============================
if ($1 == !lfmn) {
set %methodd lfmn
if (!$2) {
if (!$hget(lastinfo,$nick)) { msg # You're not regged with the bot, please add one using !lfma <Last.FM Nick> | halt }
set %username $hget(lastinfo,$nick)
set %method http://ws.audioscrobbler.com/2.0/?method=user.getneighbours&user= $+ %username $+ &limit=10&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
if ($2) {
set %username $iif($hget(lastinfo,$2),$hget(lastinfo,$2),$2)
set %method http://ws.audioscrobbler.com/2.0/?method=user.getneighbours&user= $+ %username $+ &limit=10&api_key=bdf34b247ee7ee2ccd8e856a675bb82d
}
if ($sock(lfm)) { sockclose lfm }
sockopen lfm ws.audioscrobbler.com 80
sockmark lfm msg # 4Last.fm 4»
}
}
; ==================
; Connect the Socket
; ==================
on *:sockopen:lfm: {
sockwrite -n $sockname GET %method HTTP/1.1
sockwrite -n $sockname Host: ws.audioscrobbler.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
; ===============
; Read the Socket
; ===============
on *:sockread:lfm: {
if ($sockerr) { $sock(lfm).mark Socket Error: $sock(lfm).wsmsg }
var %lfmtemp
sockread %lfmtemp
; =============
; Set 'NP' vars
; =============
if (%methodd == np) {
if ((<name> isin %lfmtemp) && (%lfmnametemp == 0)) {
set %lfmname $replace($nohtml(%lfmtemp),&,&,",")
set %lfmnametemp 1
}
if ((<artist isin %lfmtemp) && (%lfmartisttemp == 0)) {
set %lfmartist $replace($nohtml(%lfmtemp),&,&,",")
set %lfmartisttemp 1
}
if ((<album isin %lfmtemp) && (%lfmalbumtemp == 0)) {
set %lfmalbum $replace($nohtml(%lfmtemp),&,&,",")
set %lfmalbumtemp 1
}
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ==============
; Set 'NP2' vars
; ==============
if (%methodd == np2) {
if (<duration> isin %lfmtemp) { set %lfm.length $nohtml(%lfmtemp) }
if (<userloved> isin %lfmtemp) {
if (<userplaycount> isin %lfmtemp) {
set %lfm.playcount $gettok($nohtml(%lfmtemp),1,32)
set %lfm.loved $gettok($nohtml(%lfmtemp),2,32)
}
else { set %lfm.loved $gettok($nohtml(%lfmtemp),1,32) }
}
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ===============
; Set 'Info' vars
; ===============
if (%methodd == info) {
if (<realname> isin %lfmtemp) { set %lfm.realname $remove(%lfmtemp,<realname>,</realname>) }
if (<country> isin %lfmtemp) { set %lfm.country $remove($gettok(%lfmtemp,1,32),<country>,</country>) }
if (<name> isin %lfmtemp) { set %lfm.name $remove($gettok(%lfmtemp,1,32),<name>,</name>) }
if (<age> isin %lfmtemp) { set %lfm.age $remove($gettok(%lfmtemp,1,32),<age>,</age>) }
if (<id> isin %lfmtemp) { set %lfm.id $remove($gettok(%lfmtemp,1,32),<id>,</id>) }
if (size="large" isin %lfmtemp) { set %lfm.image $remove($gettok(%lfmtemp,2,32),size="large">,</image>) }
if (<gender> isin %lfmtemp) { set %lfm.gender $remove($gettok(%lfmtemp,1,32),<gender>,</gender>) }
if (<playcount> isin %lfmtemp) { set %lfm.plays $remove($gettok(%lfmtemp,1,32),<playcount>,</playcount>) }
if (<subscriber> isin %lfmtemp) { set %lfm.subscriber $remove(%lfmtemp,<subscriber>,</subscriber>) }
if (<type> isin %lfmtemp) { set %lfm.type $remove(%lfmtemp,<type>,</type>) }
set %lfm.url http://last.fm/user/ $+ %username
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ==================
; Set 'Compare' vars
; ==================
if (%methodd == compare) {
if (<score> isin %lfmtemp) { set %lfm.score $round($calc($nohtml(%lfmtemp)*100),1) }
if (<name> isin %lfmtemp) { set %lfm.artists $+(%lfm.artists,$chr(32),$replace($nohtml(%lfmtemp),&,&,","),$chr(44)) }
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ==================
; Set 'Similar' vars
; ==================
if (%methodd == similar) {
if (<name> isin %lfmtemp) {
set %lfm.similar $+(%lfm.similar,$chr(32),$nohtml(%lfmtemp),$chr(44))
}
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; =======================
; Set 'New Releases' vars
; =======================
if (%methodd == lfmnr) {
if ((<name> isin %lfmtemp) && (%lfmnametemp == 0) && (%lfmnrtemp < %lfmnrout)) { set %lfmrecsout %lfmrecsout $replace($nohtml(%lfmtemp),&,&,",") - }
if ((<name> isin %lfmtemp) && (%lfmnametemp == 1) && (%lfmnrtemp < %lfmnrout)) {
set %lfmrecsout %lfmrecsout $replace($nohtml(%lfmtemp),&,&,",") $+ ,
set %lfmnametemp 0
inc %lfmnrtemp
}
if (<artist> isin %lfmtemp) { set %lfmnametemp 1 }
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ============================
; Set 'Chart Top Artists' vars
; ============================
if (%methodd == lfmta) {
if (<name> isin %lfmtemp) {
set %lfm.topartists $+(%lfm.topartists,$chr(32),$nohtml(%lfmtemp),$chr(44))
}
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ===========================
; Set 'User Top Artists' vars
; ===========================
if (%methodd == lfmuta) {
if (<name> isin %lfmtemp) {
set %lfm.usertop $+(%lfm.usertop,$chr(32),$nohtml(%lfmtemp),$chr(44))
}
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
; ========================
; Set 'User Neighbor' vars
; ========================
if (%methodd == lfmn) {
if (<name> isin %lfmtemp) {
set %lfm.neighbors $+(%lfm.neighbors,$chr(32),$nohtml(%lfmtemp),$chr(44))
}
if (<error isin %lfmtemp) { var %err $remove(%lfmtemp,<error code=",</lfm>,</error>,">) | $sock(lfm).mark $remove(%err,$left(%err,1)) | unset %lfm.* | sockclose lfm }
}
}
; ===============================
; Close socket and message output
; ===============================
on *:sockclose:lfm: {
if (%methodd == np2) {
msg %lfm.chan 4Last.fm » %lfmartist - %lfmname $chr(91) $+ %lfmalbum $+ $chr(93) $iif(%lfm.playcount,$+($chr(40),Played %lfm.playcount times,$chr(41))) $iif(%lfm.loved,4♥) $iif(%lfm.length,$+([,$gettok($duration($calc(%lfm.length / 1000),3),2-,58),]))
unset %lfm* | unset %lfmcu* | unset %method | unset %methodd
}
if (%methodd == np) {
set %methodd np2
set %method $+(/2.0/?method=track.getinfo&api_key=bdf34b247ee7ee2ccd8e856a675bb82d&artist=,$urlencode(%lfmartist),&track=,$urlencode(%lfmname),&username=,%username)
if ($sock(lfm)) { sockclose lfm }
sockopen lfm ws.audioscrobbler.com 80
}
if (%methodd == info) {
$sock(lfm).mark User: %username 4» ID: $iif(%lfm.id == $null,Not Specified,%lfm.id) 4» Subscriber? $replace(%lfm.subscriber,0,No,1,Yes) 4» Type: %lfm.type $+
$sock(lfm).mark Real Name: $iif(%lfm.realname == $null,Not Specified,%lfm.realname) 4» Name: $iif(%lfm.name == $null,Not Specified,%lfm.name) 4» Age: $iif(%lfm.age == $null,Not Specified,%lfm.age) 4» Gender: $iif(%lfm.gender == $null,Not Specified,$replace(%lfm.gender,m,Male,f,Female,n,Unknown)) 4» Country: $iif(%lfm.country == $null,Not Specified,%lfm.country)
$sock(lfm).mark Plays: %lfm.plays 4» Image: $iif(%lfm.image == $null,Not Specified,%lfm.image) 4» %lfm.url
unset %lfm* | unset %lfmcu* | unset %method | unset %methodd | unset %username
}
if (%methodd == compare) {
$sock(lfm).mark %lfmcu1 $+ 's compatibility with %lfmcu2 is $iif(%lfm.score == 0,Unknown.,$compat(%lfm.score) $+($chr(40),%lfm.score,$chr(37),$chr(41),$chr(46)) Artist(s) they have in common include(s) $gettok(%lfm.artists,1- $+ $calc($gettok(%lfm.artists,0,44) - 2),44) $+ .)
unset %lfm* | unset %lfmcu* | unset %method | unset %methodd | unset %username
}
if (%methodd == similar) {
$sock(lfm).mark Similar Artists: $replace($gettok(%lfm.similar,1-10,44) $+ .,&,&)
unset %lfm* | unset %lfmcu* | unset %method | unset %methodd | unset %username
}
if (%methodd == lfmnr) {
$sock(lfm).mark New Album Releases for %username are: $gettok(%lfmrecsout,1- %%lfmnrout,44) $+ .
unset %lfm* | unset %method | unset %methodd | unset %username
}
if (%methodd == lfmta) {
$sock(lfm).mark Top of the Last.fm Charts: $gettok(%lfm.topartists,1-10,44) $+ .
unset %lfm* | unset %method | unset %methodd | unset %username
}
if (%methodd == lfmuta) {
$sock(lfm).mark Top 10 Artists for %username 4» Period: $replace(%period,overall,Overall:,7day,Last 7 Days:,3month,Last 3 Months:,6month,Last 6 Months:,12month,Last 12 months:) $gettok($replace(%lfm.usertop,&,&),1-10,44) $+ .
unset %lfm* | unset %method | unset %methodd | unset %username | unset %period
}
if (%methodd == lfmn) {
$sock(lfm).mark Top 10 Neighbors: $gettok(%lfm.neighbors,1-10,44) $+ . http://www.last.fm/user/ $+ %username $+ /neighbours
unset %lfm* | unset %method | unset %methodd | unset %username
}
}
alias nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias urlencode {
var %a = $regsubex($$1,/([^\w\s])/Sg,$+(%,$base($asc(\t),10,16,2)))
return $replace(%a,$chr(32),$chr(43))
}
alias -l compat {
if ($1 isnum 00.0-16.6) { return Very Low }
if ($1 isnum 16.6-33.3) { return Low }
if ($1 isnum 33.3-50.0) { return Medium }
if ($1 isnum 50.0-66.6) { return High }
if ($1 isnum 66.6-83.4) { return Very High }
if ($1 isnum 83.4-100) { return Super }
}
On *:EXIT: {
hsave lastinfo lastinfo.hsh
hfree lastinfo
}