Updates, status, and hacks for lastfmlovetweet, a mashup of your loved tracks on lastfm and twitter.

Import your loved tracks into tumblr (or just about anywhere)

*** UPDATE 3/27/09 After some experimentation, I am not happy with either a pipes solution or using a feed of twitter search results (described below).  The best solution, I think, would be to use the tumblr API to generate the posts.  That would allow me to include pictures, or other media to make the tumblr posts more than just tweets in tumblr.  Any ideas are welcome, but this one may take some time, so please be patient! ***

*** UPDATE 2/26/09 Several users (myself included) are seeing some strange formatting problems when following this process - I will work on getting a yahoo pipe togather that fixes these problems.   Stay tuned… ***

A user asked if there is a way to import your lastfmlovetweets into tumblr without having all of your tweets imported.

My first thought was to use yahoo pipes, but then I realizes that theres a much easier way that anyone can setup in just a few minutes.

Basically you want to do a search on twitter, and then grab the feed for that search and import the search results into tumblr.  Make sense?  Here are the steps broken down: (This assumes your tweets have the hashtags #lastfm #love - if they don’t you will have to make a search to suit your format.)

1. Go twitter’s search and enter the following search (using your twitter username instead of pootytang):  #lastfm #love from:pootytang

2. Click on ‘search’ to get to the results screen.

3. Grab the feed for that query.  (Right click on ‘Feed for this query’ and select ‘Copy link location’)

4. In another tab or window go to your tumblr dashboard and click on ‘customize’ and then ‘Feeds’

5. Paste the twitter ‘Feed for this query’ link from step 3 into the ‘Feed URL’ box.

6. You can decide whether to import as links, links with summaries, or Text without titles.

This process can be used to get your loved tracks pretty much anywhere that you can get an rss feed, so play around with it, and have fun!

If you do import your loved tracks into a tumblr blog, or anywhere else, please let me know in the comments of this post, as I would love to take a look!

Happy lastfmlovetweeting!

Peter

Comments (View)

Where are my tweets?

Every now and again, I get a tweet asking if lastfmlovetweet is working, or why don’t I see my loved tracks?  Here are some things you can check:

1. Is lastfmlovetweet down?  The easiest way to check is view the search results from twitter.  They will show you the most recent lastfmlovetweets, and are usually updating every few minutes.

2. Are your loves tracks being recorded on lastfm?  To determine if you have loved a track recently, I check the feed provided at this link: http://ws.audioscrobbler.com/2.0/user/pootytang/lovedtracks.rss To check your feed, copy that link and replace ‘pootytang’ with your lastfm username.  The main reason your loved tracks wouldn’t show up is that lastfm only records the 1st time you love a track.  Once you have loved the track, the next time you love it it won’t show up in your feed, and it wont generate a tweet.

3. Has your twitter password changed? If you have changed your twitter pasword, you need to re-sign up.

4. Is twitter up?

5. Have you angered the lastfmlovetweet genie? If you haven’t used lastfm in a month or more, it will take a little while (up to 4 hours) for the lastfm love bot to start checking your account.  You can send an @ or dm to lastfm_love with the word ‘ping’ and the bot will start checking your account immediately.

Comments (View)

Growing Pains

Over the last few weeks lastfmlovetweet has gone through some growing pains.  Here is a summary of what happened, and what changed:

I. Uh Oh

I was on vacation with my family, and got home to find out that my web hosting provider decided I was abusing my account by running my little lastfmlovetweet ruby script every 10 minutes.

He had a point - let me explain: Each run of the lastfm_love ruby script generated about 1800 http requests to lastfm (to check each user for new loved tracks), and then 2 more requests for each tweet generated (One for the url shortening, and one to twitter).  So, I was doing about 10,080 requests per hour, and parsing as many xml documents, so yeah, my host had a point - that isn’t what a shared hosting account is meant to be used for.  So, he cut me down to only running once an hour, and told me to optimize my code.  That meant that loved tracks would only show up once an hour.  Many users of lastfmlovetweet love multiple tracks per hour, so some users were hours and hours behind.  Not good.

II. I Had a Plan.  The Plan was Flawed

Fear not though, as I had expected this day to come, and I had a plan.  I already had a few yahoo pipes designed that would dramatically reduce the number of requests.  Basically the pipe would allow me to group together 20 users at a shot, bringing 1800 down to 90.  A huge difference.  The code to use the yahoo pipe was old, but it didn’t require much work to get it working again.  I just needed to test it out, and so I spent an afternoon doing just that.  I got it working, and then pounded on it for a while.  Good thing I did.  Yahoo pipes is an amazing tool, but 100% reliable it is not.  I found that it was failing a lot, and seemed to be sporadically giving me cached results which are useless to me.

III. VPS to the rescue

Virtual Private Server to the rescue!  I really wanted to use amazon’s EC2, but for my purposes it was a bit pricey, so after looking around a bit I decided that my current host’s VDS service was fine for my needs (the devil you know…)  I spent a few more hours configuring and testing the VDS and officially moved to it Monday night (Jan. 26th).  It’s been running beautifully since then.

IV. Threads

In addition to moving to a VDS, I also modified my code to use ruby threads so I can grab multiple lastfm feeds at once.  I currently grab 20 at a time and that cut the processing time from about 15 minutes down to about 5 minutes.  Thats what allowed me to speed up the service so that it now polls every 6 minutes.

V. Follow limit

Ugg. Just when I thought things were going smoothly, I realized that the lastfmlovetweet bot was no longer able to follow new users.  This is a problem, because updating the tweet format (and new unannounced features) require a direct message, and twitter accounts can only receive directs from people they follow.  I’ve opened a ticket with twitter, but so far they haven’t lifted the cap.  I think they capped my account in error - it is only supposed to kick in when your friendships are reciprocated - and one way or another I’m gonna get that cap lifted!  In the meantime, I unfollowed a bunch of people that are no longer using the service, so I am once again below the 2000 threshold… for now…

VI. Whats next?

The response to lastfmlovetweet has been terrific, and its been a lot of fun for me.  I have a number of new features coming out that I hope you will enjoy.  In addition, I am thinking about ways to make any money from this service to recoup the monthly expense of my VDS and maybe have enough left over to buy a cup of coffee.  More on that later.

Any ideas, suggestions, issues, comments, thoughts, musings, PLEASE leave comments!

Comments (View)

Cusomize your tweet!!!

*** UPDATE 3/21/09 Added amazon variables ***

*** UPDATE 2/24/09 The @lastfm_love bot now treats @ and dm the same.  You can update your tweet format by sending @lastfm_love just like you can with d lastfm_love. ***

Finally, you, my wonderful lastfmlovetweet user, can customize your tweet format to be whatever you like.
The default format has caused some dissatisfaction, and in polling you all to see what it should be it was clear that people had very different ideas. So, now it can be whatever your <3 (or ♥) desires.

Heres how it works:

You send a direct message or an @ reply to the lastfm_love user with the text you want (using the format described below), and then the lastfm_love user will set that to be your tweet format AND send you back a direct message with an example of how your format would look with your most recently loved track.

Examples:

For the example below I will use the track “Livin’ on a Prayer” by the inimitable Bon Jovi.
The current default is:
#lastfm #love Livin’ on a Prayer by Bon Jovi http://bit.ly/Wc1mt
Lets say that you want your tweet to be:
I freakin’ LOVE Livin’ on a Prayer by Bon Jovi. It ROCKS! Check it out here: http://bit.ly/Wc1mt
Then the message you would send lastfm_love would be:
tweet format I freakin’ LOVE %t by %a. it ROCKS! Check it out here: %l
The first 2 words, “tweet format”, tell lastfm_love that you want to change your tweet format. The rest of the message is the format you want but the artist, track, and link are replaced by the following placeholders:

  • %a = artist
  • %t = track name
  • %l = lastfm link
  • %amazon_album_or_track - First tries to get the album, if it can’t find it, gets the track. (recommended)
  • %amazon_uk_album_or_track - First tries to get the album, if it can’t find it, gets the track. (uk) (recommended)
  • %amazon_album - link to the album’s mp3s on amazon
  • %amazon_uk_album - link to the album’s mp3s on amazon uk
  • %amazon_track - link to the track’s mp3 on amazon
  • %amazon_uk_track - link to the track’s mp3 on amazon uk

The other parts of the tweet (The “I freakin’ LOVE”, “by”, and “It ROCKS! Check it out here:”) are static text and dont change from tweet to tweet. The %a, %t, and %l (and amazon placeholders) get filled in with whatever track you just loved.

Testing

If you aren’t sure about whether your format is correct, and you just want to test it out, then add the work “test” after “tweet format” and your will receive the test message, but your tweet format will NOT be changed. For example, sending the following message:
tweet format test I freakin’ LOVE %t by %a. it ROCKS! Check it out here: %l
will cause the direct message response to be sent, but will NOT change your tweet format.

More examples:

tweet format:
♥ Livin’ on a Prayer by Bon Jovi http://bit.ly/Wc1mt
message to send:
tweet format ♥ %t by %a %l

tweet format:
OMFG I ♥ Bon Jovi’s Livin’ on a Prayer http://bit.ly/Wc1mt
message to send:
OMFG I ♥ %a’s %t %l

If Things go Wrong:

If you need to reset your tweet format back to the default, send the following message:
tweet format default

Comments (View)

Welcome to the LastFMLoveTweet blog!

This blog will serve several functions:

  1. Announce new features - I have a few ideas… 
  2. Status notifications - I will tweet the major status issues, such as extended service outages, but here I will post minor updates as well.
  3. Discussion - This blog has disqus comments enabled, so some discussion can occur here.
  4. How Tos - As I add new features, I will NOT be making them accessible via the web interface.  Rather, they will be accessible via twitter.  This is because I want the web page sign up process to be as simple as possible.  Instructions for using advanced features will be available on this blog, and tagged with howto.

If there is anything else you want out of this blog, please let me know in the comments below.  This project has been a lot of fun for me so far, and I greatly appreciate the interest and feedback I have received!

Comments (View)