<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phill84.org &#187; last.fm</title>
	<atom:link href="http://phill84.org/tag/lastfm/feed/" rel="self" type="application/rss+xml" />
	<link>http://phill84.org</link>
	<description>System.out.print</description>
	<lastBuildDate>Sat, 26 Mar 2011 10:21:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>X-Chat Last.fm plugin</title>
		<link>http://phill84.org/2009/03/x-chat-lastfm-plugin/</link>
		<comments>http://phill84.org/2009/03/x-chat-lastfm-plugin/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 16:08:06 +0000</pubDate>
		<dc:creator>phill84</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[xchat]]></category>

		<guid isPermaLink="false">http://phill84.org/2009/03/x-chat-lastfm-plugin/</guid>
		<description><![CDATA[上班無聊隨便寫了個&#8230;. This plugin can retrieve the most recent 10 updates from your personal rss on last.fm, please notice that there is delay for the rss to get updated. ## Use Modules ## use XML::Simple; use LWP::Simple; &#160; ## last.fm home &#8230; <a href="http://phill84.org/2009/03/x-chat-lastfm-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>上班無聊隨便寫了個&#8230;.</p>
<p>This plugin can retrieve the most recent 10 updates from your personal rss on last.fm, please notice that there is delay for the rss to get updated.<span id="more-561"></span></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## 	Use Modules 			##</span>
<span style="color: #000000; font-weight: bold;">use</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## 	last.fm home address 	##</span>
<span style="color: #666666; font-style: italic;">## 	change to your own 		##</span>
<span style="color: #0000ff;">$home</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;http://www.last.fm/user/jiening&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## 	last.fm feed rss 		##</span>
<span style="color: #666666; font-style: italic;">## 	change to your own 		##</span>
<span style="color: #0000ff;">$url</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;http://ws.audioscrobbler.com/1.0/user/jiening/recenttracks.rss&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##	Registering The Script 	##</span>
<span style="color: #666666; font-style: italic;">##	and Commands 			##</span>
Xchat<span style="color: #339933;">::</span><span style="color: #006600;">register</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;LastFM&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;0.1&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;A Script to display the latest song listed on your last.fm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Xchat<span style="color: #339933;">::</span><span style="color: #006600;">hook_command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;lastfm&quot;</span><span style="color: #339933;">,</span> lastfm<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Xchat<span style="color: #339933;">::</span><span style="color: #006600;">hook_command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;lasthelp&quot;</span><span style="color: #339933;">,</span> lasthelp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">## 	Text to print when		## </span>
<span style="color: #666666; font-style: italic;">##	the script is loaded 	## </span>
<span style="color: #000000; font-weight: bold;">sub</span> lastfm_load <span style="color: #009900;">&#123;</span> 
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO ---&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO LastFM 1.0 by Phill84 loaded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO For HELP type /lasthelp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO ---&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">return</span> Xchat<span style="color: #339933;">::</span><span style="color: #006600;">EAT_NONE</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
lastfm_load<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## 	Help 					##</span>
<span style="color: #000000; font-weight: bold;">sub</span> lasthelp <span style="color: #009900;">&#123;</span>
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO ---&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO just type /lastfm, what's so difficult about it?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO ---&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">return</span> Xchat<span style="color: #339933;">::</span><span style="color: #006600;">EAT_NONE</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## 	Main function 			##</span>
<span style="color: #000000; font-weight: bold;">sub</span> lastfm <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$content</span> <span style="color: #339933;">=</span> get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #0000ff;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ECHO Could not retrieve $url&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066;">return</span> Xchat<span style="color: #339933;">::</span><span style="color: #006600;">EAT_NONE</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$rss</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">XMLin</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;SAY 10 recent updates on $home&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$i</span> <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$title</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>channel<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>item<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>title<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$date</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>channel<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>item<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>pubDate<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
			<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\+0000//</span><span style="color: #339933;">;</span>
			Xchat<span style="color: #339933;">::</span><span style="color: #006600;">command</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;SAY $title - $date&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066;">return</span> Xchat<span style="color: #339933;">::</span><span style="color: #006600;">EAT_NONE</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://phill84.org/2009/03/x-chat-lastfm-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>註冊了 last.fm</title>
		<link>http://phill84.org/2009/03/%e8%a8%bb%e5%86%8a%e4%ba%86-lastfm/</link>
		<comments>http://phill84.org/2009/03/%e8%a8%bb%e5%86%8a%e4%ba%86-lastfm/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 18:40:43 +0000</pubDate>
		<dc:creator>phill84</dc:creator>
				<category><![CDATA[blah]]></category>
		<category><![CDATA[last.fm]]></category>

		<guid isPermaLink="false">http://phill84.org/2009/03/%e8%a8%bb%e5%86%8a%e4%ba%86-lastfm/</guid>
		<description><![CDATA[可以開始放棄豆瓣了 豆瓣要手動編輯太 tmd 煩了 last.fm 全自動外加有支援 iphone 的客戶端 加了個 last.fm 的 recent playlist widget 到首頁 或著可以點 這裡 直接瀏覽我的 profile]]></description>
			<content:encoded><![CDATA[<p>可以開始放棄豆瓣了</p>
<p>豆瓣要手動編輯太 tmd 煩了</p>
<p>last.fm 全自動外加有支援 iphone 的客戶端</p>
<p>加了個 last.fm 的 recent playlist widget 到首頁</p>
<p>或著可以點 <a href="http://www.last.fm/user/jiening">這裡</a> 直接瀏覽我的 profile <img src='http://phill84.org/wp-includes/images/smilies/icon_biggrin.gif' alt="icon biggrin 註冊了 last.fm" class='wp-smiley colorbox-557' title="註冊了 last.fm" /> </p>
]]></content:encoded>
			<wfw:commentRss>http://phill84.org/2009/03/%e8%a8%bb%e5%86%8a%e4%ba%86-lastfm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

