Soma.fm + Spotify + import.io + Python mashup: automatically create a Spotify playlist with Soma.fm tracks

Posted on Sun 12 July 2015 in Python • Tagged with import.io, music, Python, soma.fm, spotify

I'm a big fan of Soma.fm (a 25+ channels streaming radio based in San Francisco) and during the years I've been writing clients for this radio for different mobile platforms (Maemo, MeeGo, Harmattan, Windows Phone, BlackBerry 10, Jolla). I love in particular their "Indie Pop Rock" channel that during these years made me discover some very good artists.

When Spotify finally was available in Italy (I'm still using it right now that I live in the UK), something that I always missed was a radio with the same good music. Why not just listening to Soma.fm? Because I like to listen to the music while I commute and in the London Underground it's nearly impossible to have signal.

So I was thinking: it would be nice to have a Spotify playlist with Soma.fm tracks. Wait a moment.... I can do it!

Frankenstein_Jr_Mel_Brooks_1974

Soma.fm publishes the tracks history with all the tracks streamed during the last hour http://somafm.com/indiepop/songhistory.html so I just needed something to parse this list for me and return me a well formatted version.

Thanks to import.io (it's a service that takes a web page as input, parse the data and generates a RESTful API to access this data) I was able to easily get the data I needed. At this point I only needed to be able to loop through the list, search each track on Spotify and add it to my playlist.

The source code is fully available here https://github.com/andreagrandi/spotisoma

Note: you can't just get the code and run it. You will need to get your own import.io api key, generate your import.io api url, get a Spotify application key (the old/deprecated one, since it was nearly impossible for me to use oauth in a simple Python script due to the fact I didn't have an endpoint to receive the token back. You can get more informations here: https://pyspotify.mopidy.com/en/latest/quickstart/#application-keys) and set your env variables with your Spotify username and password. Last but not least: the old Spotify library only works with Premium accounts.


Announcing LastGo: Maemo/MeeGo client for Last.fm

Posted on Fri 16 July 2010 in Linux, Maemo (EN), MeeGo, Programmazione, Qt • Tagged with client, last.fm, music, N900, nokia

While I'm still working to mSoma with Lorenzo Bettini, I decided to start writing another application. I needed to write something from scratch to learn better how to use C++ and Qt libraries, so I decided to write a client for Last.fm service. The application is still in full development, but you can already taste it if you have extras-devel repository enabled on your N900. At the moment it only supports basic radio features: tuning user's radio, playing a song, skipping a song and displaying song informations.

lastgo

Other basic Last.fm features like scrobbling, marking a song as loved or banned ecc.. are not supported yet, but of course they're planned for the stable release. Please not that the application is still a bit unstable even if it works for normal tasks.

If you are a Last.fm subscriber and you want to test it, please install it from extras-devel repository and send me your feedback.

Note: since it's not allowed to use Last.fm API from a mobile phone (due to API license restrictions) I cannot distribute a valid api key with the application. I'm writing this software mainly to learn C++ and Qt and for the future tablets and netbooks that will be based on MeeGo. If you feel to assume the responsability, you can download the api key file and import it using "Import Api Key" that you can find in the application menu.


Last.fm: the money music revolution!

Posted on Mon 11 May 2009 in Recensione • Tagged with community, last.fm, music, radio, streaming

lastfm

Non c'è alcun errore nel titolo di questo post. Sebbene lo slogan originale di Last.fm fosse "The Social Music Revolution", ho voluto modificarlo in questo modo, per sottolineare il recente cambiamento di rotta di un servizio che fino a pochi giorni fa ritenevo uno dei migliori, se non il migliore, del suo genere.

Facciamo un passo indietro per spiegare cos'è Last.fm. Si tratta di un servizio che permette, una volta registrati, di condividere le canzoni che ascoltiamo (titolo e autore, non il file audio) in modo che si possa essere messi in contatto con altre persone che ascoltano i nostri gruppi preferiti oppure di ricevere suggerimenti su gruppi simili a quelli che ascoltiamo. Grazie a questa funzione ho avuto la possibilità di conoscere ed apprezzare gruppi musicali di cui prima ignoravo l'esistenza.

Oltre a permettere lo scrobbling (invio del titolo della canzone) e la creazione automatica di classifiche, il sito mette a disposizione moltissimi strumenti che hanno permesso la creazione di una vasta community musicale. La community, grazie a questi strumenti, ha arricchito il sito web di moltissimi dati importanti: un wiki con i dati dei gruppi musicali, i tag su ogni canzone, gruppi di discussione e la creazione di eventi e ritrovi. Last.fm è anche una "radio", ma in un modo un po' diverso rispetto a quello a cui siamo abituati.

Non esistono playlist valide per tutti gli utenti, ogni utente ha la propria playlist, in base ai brani ascoltati, ai gruppi simili ed ai suggerimenti degli amici. Oltre alle proprie playlista è inoltre possibile ascoltare quelle dei "vicini", degli amici e dei gruppi ai quali siamo iscritti. Se oggi Last.Fm è diventata quello che tutti vediamo, è in gran parte grazie al lavoro svolto dalla community musicale.

Che cosa è successo per portarmi alla decisione di eliminare il mio account, vecchio di 3 anni, con piu' di 30.000 brani ascoltati?

Circa un mese fa i vertici di Last.fm hanno deciso che entro poco tempo il servizio di radio in streaming sarebbee diventato a pagamento, a causa dell'aumento dei costi di licenza imposti dalle major. Per continuare ad ascoltare la radio si dovranno pagare 3€ al mese. Quello che ha scatenato l'ira di moltissimi utenti e che mi ha fatto prendere la decisione di disiscrivermi, è il fatto che USA, Inghilterra e Germania potranno continuare ad usufruire gratuitamente del servizio. Questa divisione in paesi di serie A e paesi di serie B non è piaciuta proprio a nessuno, basta guardare le centinaia di commenti che sono arrivati sul blog ufficiale di Last.fm.

Io mi associo al pensiero comune: se anche USA, Inghilterra e Germania pagassero, il costo potrebbe scendere a 1 o 2 euro al mese ed inoltre non ci sarebbero divisioni e/o discriminazioni a seconda del paese di provenienza. Avrei pagato volentier anche 3€/mese se non ci fossero state queste differenze. Perchè gli altri paesi devono pagare pochi privilegiati?

A mio parere Last.fm ha commesso un gravissimo errore facendo questa mossa e sono convinto che entro breve perderà moltissimi utenti smettendo inoltre di essere una community ricca di contenuti creati dagli utenti stessi. Staremo a vedere se ci saranno inversioni di rotta o se continueranno a seguire questa strada.