<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://townx.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>townx - Progress on Drupal Last.fm module - Comments</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module</link>
 <description>Comments for &quot;Progress on Drupal Last.fm module&quot;</description>
 <language>en</language>
<item>
 <title>Would be nice if it could be</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-34385</link>
 <description>&lt;p&gt;Would be nice if it could be fixed. I&#039;ve handed the module over to someone else now, but hopefully they&#039;ll benefit from the fix.&lt;/p&gt;</description>
 <pubDate>Thu, 17 Apr 2008 18:17:25 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 34385 at http://townx.org</guid>
</item>
<item>
 <title>Drupal is working on a major</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-26850</link>
 <description>&lt;p&gt;Drupal is working on a major update soon, so maybe will be fixed then. For the time being I will use your module. &lt;/p&gt;

&lt;p&gt;Thanks for the work. Also I couldn&#039;t install the module from the reply method.&lt;/p&gt;

&lt;p&gt;Locke.&lt;br /&gt;
&lt;a href=&quot;http://www.contentmanagement365.com&quot;&gt;Content management&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Mon, 24 Mar 2008 15:30:56 -0500</pubDate>
 <dc:creator>Locke</dc:creator>
 <guid isPermaLink="false">comment 26850 at http://townx.org</guid>
</item>
<item>
 <title>Sure</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14315</link>
 <description>&lt;p&gt;I&#039;ll see if I can get it into drupal&#039;s cvs. &lt;/p&gt;

&lt;p&gt;Could you send me the most recent version of your code.  It sounds like you&#039;ve implemented some good features that I don&#039;t have.  &lt;/p&gt;

&lt;p&gt;By all means I&#039;ll list you in the credits.  Email me your full name and any other info you&#039;d like in there.  &lt;span class=&quot;caps&quot;&gt;GPL &lt;/span&gt;is fine.&lt;/p&gt;

&lt;p&gt;It may take me two weeks to get to this, but I&#039;ll follow through.&lt;/p&gt;</description>
 <pubDate>Fri, 17 Aug 2007 11:18:51 -0500</pubDate>
 <dc:creator>Brian Wood</dc:creator>
 <guid isPermaLink="false">comment 14315 at http://townx.org</guid>
</item>
<item>
 <title>Hi Brian. As I currently</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14313</link>
 <description>&lt;p&gt;Hi Brian. As I currently don&#039;t have too much time to work on this, would you be interested in becoming its custodian? If you want to maintain the project, I&#039;d be happy with a quick mention as one of the originators of the code. The licence was never mentioned (I don&#039;t think), but I&#039;d be happy with the &lt;span class=&quot;caps&quot;&gt;GPL.&lt;/span&gt; It would be good to get it onto the official Drupal &lt;span class=&quot;caps&quot;&gt;CVS &lt;/span&gt;server if you&#039;re so inclined.&lt;/p&gt;</description>
 <pubDate>Fri, 17 Aug 2007 10:46:35 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 14313 at http://townx.org</guid>
</item>
<item>
 <title>an official last.fm module</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14312</link>
 <description>&lt;p&gt;A lot of people are interested in a last.fm module. So I think it&#039;s a good idea to host your work on drupal.org. It will be easier for people to find it and watch the evolution of the project. If you already posted it on drupal.org, please send me the link. &lt;/p&gt;

&lt;p&gt;Thanks and keep up the good work!&lt;/p&gt;</description>
 <pubDate>Fri, 17 Aug 2007 06:43:19 -0500</pubDate>
 <dc:creator>kenjiru</dc:creator>
 <guid isPermaLink="false">comment 14312 at http://townx.org</guid>
</item>
<item>
 <title>Bugfix revision 0.6 of Brian&#039;s code.</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14250</link>
 <description>&lt;p&gt;...is here: &lt;a href=&quot;http://bria.nwood.org/system/files/lastfmdev5.x-0.6.tar.gz&quot;&gt;http://bria.nwood.org/system/files/lastfmdev5.x-0.6.tar.gz&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;&lt;span class=&quot;caps&quot;&gt;BUG&lt;/span&gt;: If click Save Configuration on the admin form you will get a blank page...&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixed.&lt;/strong&gt; Silly... My debugging output was thwarting the header() in includes/common.inc line 311.  I have implemented simple debugging output in the bottom of the block for developer convenience.&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;&lt;span class=&quot;caps&quot;&gt;BUG&lt;/span&gt;: Track times: They are probably incorrect for you.&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixed.&lt;/strong&gt;  _lastfmdev_adjust_server_time() now calculates the offset between the Last.fm server&#039;s timezone and the date_default_timezone set in the Drupal installation.&lt;/p&gt;

&lt;p&gt;Since it is possible that Last.fm could decide to host this service on servers in another timezone, the module&#039;s Admin Settings now includes a timezone select menu to change the Last.fm server timezone.  The default is the server&#039;s present location (USA Eastern Time). &lt;/p&gt;

&lt;p&gt;&lt;cite&gt;&lt;span class=&quot;caps&quot;&gt;BUG&lt;/span&gt;: Updated timestamp (showing the &quot;freshness&quot; of the Last.fm data) was poorly implemented.&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixed.&lt;/strong&gt; Now using format_date($update_timestamp, &#039;small&#039;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixed.&lt;/strong&gt; $table was not set for db_lock(). Presently hard-coded to &#039;cache&#039; - probably should be flexible.&lt;/p&gt;

&lt;p&gt;Do a diff against the old file (lastfmdev.tgz) to see other minor stuff.  I will use revision numbers going forward.&lt;/p&gt;</description>
 <pubDate>Sun, 08 Jul 2007 16:23:57 -0500</pubDate>
 <dc:creator>Brian Wood</dc:creator>
 <guid isPermaLink="false">comment 14250 at http://townx.org</guid>
</item>
<item>
 <title>Site5</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14248</link>
 <description>&lt;p&gt;Hey,  I happen to be on Site5 too.  Just noticed the sidebar ad.&lt;/p&gt;</description>
 <pubDate>Fri, 06 Jul 2007 12:44:08 -0500</pubDate>
 <dc:creator>Brian Wood</dc:creator>
 <guid isPermaLink="false">comment 14248 at http://townx.org</guid>
</item>
<item>
 <title>Excellent!</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14247</link>
 <description>&lt;p&gt;By all means.  Incorporate any of my code that you like.  I&#039;d be really happy if my efforts help to push this along. &lt;/p&gt;

&lt;p&gt;Yeah lets get this into &lt;span class=&quot;caps&quot;&gt;CVS &lt;/span&gt;so that we can get the latest versions of each other&#039;s work.   Or if you&#039;re pressed for time, email me your latest code and I&#039;ll try to get it in there. &lt;/p&gt;

&lt;p&gt;I&#039;d be excited about collaborating...we can divide and conquor on some of the features... I&#039;ve can also test on XP/Ubuntu Feisty/MacOS 10.4 and corresponding browsers.  I&#039;ll try to watch here, but feel free to email me directly too.&lt;/p&gt;</description>
 <pubDate>Fri, 06 Jul 2007 12:42:04 -0500</pubDate>
 <dc:creator>Brian Wood</dc:creator>
 <guid isPermaLink="false">comment 14247 at http://townx.org</guid>
</item>
<item>
 <title>Brian, that looks very</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14245</link>
 <description>&lt;p&gt;Brian, that looks very interesting. As I&#039;m in the throes of rewriting it (again), would it be OK if I folded your changes into what I&#039;ve been doing? I particularly like how you&#039;ve done caching: I&#039;d been using it, but my approach was less elegant by far. The other thing I want to do is make it possible to retrieve data from other parts of the &lt;span class=&quot;caps&quot;&gt;API, &lt;/span&gt;so I want to refactor the code (e.g. to give _lastfm_fetch(), _lastfm_parse(), _lastfm_render(), _lastfm_cache() functions). I&#039;ve also changed my approach slightly, so that I&#039;m using theming properly for &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;generation, and am showing Last.fm recent tracks on a person&#039;s profile (which requires a new database table), as well as providing a block to do the recent tracks for a particular individual.&lt;/p&gt;

&lt;p&gt;But I could definitely do with some help, and also liked the idea of being able to show the time when the track was played. As mentioned in my blog entry, my main issue is with timeouts wrecking my site: so I may redo the fetch functionality to use raw sockets rather than drupal_http_request() (which I&#039;m using currently) or &lt;span class=&quot;caps&quot;&gt;CURL&lt;/span&gt;; and I may redo the parser to use the Drupal approach, compatible with &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; 4 (the &lt;span class=&quot;caps&quot;&gt;DOM &lt;/span&gt;stuff isn&#039;t). I&#039;m quite enjoying messing with it at the moment, as you can probably tell :) Someone else suggested committing it to the Drupal project properly and getting it into &lt;span class=&quot;caps&quot;&gt;CVS, &lt;/span&gt;which would perhaps be a good idea now there&#039;s some interest.&lt;/p&gt;

&lt;p&gt;Yes, the cron thing. I never particularly liked the idea of Drupal cron. Seems a bit nasty, though I suppose it&#039;s essential. I guess my thought was that the data might need to be updated more frequently than cron to be relevant (if you have long gaps between cron calls). Perhaps an option to use cron would be useful, though I think it&#039;s over-complicated for now.&lt;/p&gt;

&lt;p&gt;So, to summarise my rambling, I&#039;d be happy to collaborate, but at the moment I feel I need to rewrite the core properly so I can use it across the whole Last.fm &lt;span class=&quot;caps&quot;&gt;API, &lt;/span&gt;and want to sort out this &lt;span class=&quot;caps&quot;&gt;HTTP &lt;/span&gt;business too.&lt;/p&gt;</description>
 <pubDate>Fri, 06 Jul 2007 10:32:00 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 14245 at http://townx.org</guid>
</item>
<item>
 <title>I&#039;ve been working with your code</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comment-14244</link>
 <description>&lt;p&gt;Hi Elliot,&lt;/p&gt;

&lt;p&gt;I&#039;ve been playing with your code for a few weeks.  Since I see that you are working on it again, I wanted to make my modifications available to you... I had this dream of squashing all the bugs and sharing some pristine code with you, but &lt;a href=&quot;http://bria.nwood.org/system/files/lastfmdev.tgz&quot;&gt;here&#039;s an alpha version&lt;/a&gt; so you can see what I&#039;ve done.  If you would like to work together on this, let&#039;s talk. Here&#039;s the status:&lt;/p&gt;

&lt;p&gt;Implemented:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Use drupal_cache_get/set functions.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.lullabot.com/articles/a_beginners_guide_to_caching_data&quot; title=&quot;http://www.lullabot.com/articles/a_beginners_guide_to_caching_data&quot;&gt;http://www.lullabot.com/articles/a_beginners_guide_to_caching_data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If there is an error getting lastfm data, and there is data in the cache, update the expiration on the cached data&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Admin option to show timestamps for when the tracks were played&lt;/li&gt;
&lt;li&gt;Admin option to display a last updated timestamp on the block, so we can see how fresh the data is&lt;/li&gt;
&lt;li&gt;Admin option to Override Refresh Interval (Always get Last.fm data.).  Maybe this should be removed.  My thinking: The admin wants to turn on an option like track timestamps, or change the number of tracks.  They want to see the block update immediately - they don&#039;t want to wait for the cache to expire. Changing to &quot;no caching&quot; doesn&#039;t expire what is currently in the cache...it could, that might be a better way to go...&lt;/li&gt;
&lt;li&gt;drupal_add_js calls lastfm.js test function works.&lt;/li&gt;
&lt;li&gt;drupal_add_css calls lastfm.css&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Bugs:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;If click Save Configuration on the admin form you will get a blank page.  (This is probably related to the bug in your post above.).  Work around: Don&#039;t reload the page (this resubmits the form data). Just click in the location bar and hit Enter to get the same &lt;span class=&quot;caps&quot;&gt;URL &lt;/span&gt;again.  You should see the page and the block should be updated with any changed options.&lt;/li&gt;
&lt;li&gt;Track times: They are probably incorrect for you. I haven&#039;t adjusted the timestamps from the &lt;span class=&quot;caps&quot;&gt;XML &lt;/span&gt;correctly yet. The &quot;UTS&quot; attribute is seems to be based on the localtime zone of the Last.fm server (USA: &lt;span class=&quot;caps&quot;&gt;EDT&lt;/span&gt;). (UTS...? &quot;unix time stamp&quot;???)
&lt;ul&gt;
&lt;li&gt;Note I&#039;m not using the textcontext item because in order to do date arithmetic on it, I&#039;d have to use strtotime() and there are bugs that will make the time appear as &quot;12:00&quot;. During certain hours.  I haven&#039;t looked into this. Using the uts attribute, might not be necessary...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Ideas/Plans:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Data should be updated by cron, not triggered by user page load. At least there should be an admin option to do it that way.&lt;/li&gt;
&lt;li&gt;Find the best way to truncate the artist-trackname to maintain a reasonable width.  Right now I&#039;m just truncating the string.  A slightly better option is described here: &lt;a href=&quot;http://www.computing.net/webdevel/wwwboard/forum/1919.html&quot; title=&quot;http://www.computing.net/webdevel/wwwboard/forum/1919.html&quot;&gt;http://www.computing.net/webdevel/wwwboard/forum/1919.html&lt;/a&gt; See javascript_truncate_table_POC.html. Ideas welcome.
&lt;ul&gt;
&lt;li&gt;onHover show full artist-title&lt;/li&gt;
&lt;li&gt;jquery to make the artist title scroll like the Last.fm widget&lt;/li&gt;
&lt;li&gt;jquery to make cover art popup on mouseover&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Installation:&lt;/p&gt;

&lt;p&gt;I renamed &quot;lastfm&quot; to &quot;lastfmdev&quot; so that this module could be installed along side your file-based-caching version. Right now I have your file-based block available to all users and this dev block available only to the administrator.&lt;/p&gt;

&lt;p&gt;(You&#039;ll notice some broken stuff on my site.  Style sheets broken in &lt;span class=&quot;caps&quot;&gt;IE. &lt;/span&gt; Some images need to be fixed too.)&lt;/p&gt;

&lt;p&gt;Hope this work and dreaming is helpful.  I&#039;ll probably have some time to get back to this on the weekend.&lt;/p&gt;</description>
 <pubDate>Fri, 06 Jul 2007 02:41:31 -0500</pubDate>
 <dc:creator>Brian Wood</dc:creator>
 <guid isPermaLink="false">comment 14244 at http://townx.org</guid>
</item>
<item>
 <title>Progress on Drupal Last.fm module</title>
 <link>http://townx.org/blog/elliot/progress-drupal-last-fm-module</link>
 <description>&lt;p&gt;I had another issue with my Last.fm module the other day, which is why it&#039;s currently turned off. I think it happens if the Last.fm feeds are unavailable; causing the module&#039;s &lt;span class=&quot;caps&quot;&gt;HTTP &lt;/span&gt;requests to time out; which in turn causes the whole of Drupal to time out as it waits for the response; which means my whole site falls over.&lt;/p&gt;

&lt;p&gt;I&#039;ve been using the &lt;tt&gt;drupal_http_request()&lt;/tt&gt; function to run my &lt;span class=&quot;caps&quot;&gt;HTTP &lt;/span&gt;requests, but unfortunately you can&#039;t adjust its timeout setting. So I dug around in that code, and have submitted a &lt;a href=&quot;http://drupal.org/node/156582&quot;&gt;feature request and patch&lt;/a&gt; which enables you to customise the timeout when using this function. I then rewrote my module with shorter timeouts when making requests to Last.fm, which seems to do the trick.&lt;/p&gt;

&lt;p&gt;Hopefully, if this patch makes it into Drupal, I will be able to release the new version of my module, complete with timeouts, so it won&#039;t cripple my site or anyone else&#039;s. It also adds a Last.fm recent tracks listing to user profiles (if they&#039;ve set up their username) and has a block (only for one user - I just put it in for myself, really). It still needs a bit of work, and only handles recent tracks, but it&#039;s coming along fine.&lt;/p&gt;</description>
 <comments>http://townx.org/blog/elliot/progress-drupal-last-fm-module#comments</comments>
 <category domain="http://townx.org/tech">tech</category>
 <pubDate>Thu, 05 Jul 2007 07:12:58 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">653 at http://townx.org</guid>
</item>
</channel>
</rss>
