As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label Last.fm. Show all posts

Yes, I know it's still 2012. When the clock tells me it's 2013, I will be too lazy to summarize it. Besides, Doomsdays is coming, we probably wouldn't have seen the new year. Yeap, I know. Again. Only silly people will believe Doomsdays is true, right? How could they not see the real threat is Juno?

Moving the range one month ahead, so when it's said 2012 in this post, it means from December, 2011 to November, 2012. First, starts with the summary in case you just want to read the numbers.

Summary

  • Blog: 331 posts and 85 comments.
  • Code: 17,591 additions and 17,874 deletions.
  • Gentoo: 1,056 merges and 999 un-merges.
  • Emails: 750 mails.
  • Last.fm: 4,711 scrobbles ~ 9.8 days (if each track is 3 minute long).
  • Television: 1,240 episodes ~ 52 days.
  • Film: 29 films ~ 2 days.
  • mt: 265.
  • gad: 35.47 (yjlv) + 76.18 (brps) = 111.65.

Blog

Basics numbers

331 Posts       378.730 per year   31.561 per month
 85 Comments     97.257 per year    8.105 per months  0.257 per post

First post                     <-  0.9 years ->                      Last post
One-liner text using jQuery... <-  10 months -> Stack Overflow testing revi...
2012-01-16 11:53:00-08:00      <-   319 days ->      2012-11-30 14:34:00-08:00

331 Posts    210 Updated (after 11 days, 3:10:58.704524 in average)

106,338 Words     321.263 per post
541,550 Chars   1,636.103 per post
  1,574 Labels      4.755 per post

With addition 10 spam comments. Most used word is, well, the "I," 3,170 times. I really need to quit that, heck, it's I++.

Only 321 words per post, it's not very long. I wish my posts will reach 1,000 words in average in the future, though I won't keep that in mind when writing. Blogging shouldn't be like that, it should go with the flow of mood, not the word count.

Most commented posts

   25 ( 29.4%): Full referrer URL in Google Analytics reports
    9 ( 10.6%): Sigh, glad I still have Disqus on my side
    5 (  5.9%): Bored? Have some random eats with recipes on ActiveState Code
    5 (  5.9%): Let your readers decide when to load Disqus
    4 (  4.7%): The Reading list in Blogger Dashboard
    3 (  3.5%): GitHub following and watching graph
    3 (  3.5%): Silly retard filename for removal
    3 (  3.5%): Three years with Gentoo
    3 (  3.5%): Custom date time format in Google Docs Spreadsheets
    2 (  2.4%): Fus Ro Dah!
I can't even remember 7 of them which were written in 2012. It's not like I forgot the content, just too many posts that I couldn't recall when I wrote them.

Distribution of posting and comments

. By Year and Month ..........................................................

YYYY-MM  Posts                             |                          Comments
2012-01  16                           #####|                                 0
2012-02  42                   #############|##                               2
2012-03  94 ###############################|#####                            5
2012-04  89   #############################|############################### 27
2012-05  32                      ##########|##                               2
2012-06  24                         #######|####                             4
2012-07  10                             ###|##########################      23
2012-08   0                                |                                 0
2012-09   0                                |#########                        8
2012-10   0                                |#####                            5
2012-11  24                         #######|##########                       9

. By Day of Month ............................................................

Day  Posts                               |                            Comments
 01   9                ##################|####                               1
 02  16 #################################|                                   0
 03  11            ######################|########################           5
 04   6                      ############|########################           5
 05   9                ##################|####                               1
 06  16 #################################|##############                     3
 07  12          ########################|################################## 7
 08  10              ####################|###################                4
 09  12          ########################|################################## 7
 10  10              ####################|################################## 7
 11  12          ########################|#############################      6
 12   5                        ##########|########################           5
 13  15    ##############################|###################                4
 14   8                  ################|                                   0
 15   9                ##################|####                               1
 16  14      ############################|                                   0
 17   6                      ############|#########                          2
 18  12          ########################|##############                     3
 19  11            ######################|#########                          2
 20   8                  ################|#########                          2
 21   9                ##################|#########                          2
 22  15    ##############################|                                   0
 23  14      ############################|########################           5
 24  10              ####################|####                               1
 25  16 #################################|                                   0
 26  10              ####################|#########                          2
 27  12          ########################|####                               1
 28  15    ##############################|##############                     3
 29   5                        ##########|#########                          2
 30   7                    ##############|##############                     3
 31   7                    ##############|####                               1

. By Hour of Day .............................................................

Hour Posts                               |                            Comments
 01   9                ##################|####                               1
 02  16 #################################|                                   0
 03  11            ######################|########################           5
 04   6                      ############|########################           5
 05   9                ##################|####                               1
 06  16 #################################|##############                     3
 07  12          ########################|################################## 7
 08  10              ####################|###################                4
 09  12          ########################|################################## 7
 10  10              ####################|################################## 7
 11  12          ########################|#############################      6
 12   5                        ##########|########################           5
 13  15    ##############################|###################                4
 14   8                  ################|                                   0
 15   9                ##################|####                               1
 16  14      ############################|                                   0
 17   6                      ############|#########                          2
 18  12          ########################|##############                     3
 19  11            ######################|#########                          2
 20   8                  ################|#########                          2
 21   9                ##################|#########                          2
 22  15    ##############################|                                   0
 23  14      ############################|########################           5
 24  10              ####################|####                               1

Labels

29 (  1.8%): Bash
28 (  1.8%): Python
26 (  1.7%): thought
22 (  1.4%): JavaScript
22 (  1.4%): Blogger
17 (  1.1%): shell scripting
13 (  0.8%): Gentoo
12 (  0.8%): Song of the Day
12 (  0.8%): Google
10 (  0.6%): email

Numbers from Google Analytics


Compare to 2011, the numbers are doubled, even four months have no new posts. In Blogger Stats, the pageviews are 172,645, that's 42.7% more than 120,945 in Google Analytics.

Top posts haven't changed much, three posts written in 2012 got into the list.


As for traffic sources, more people from search engine, which is not what I wanted at all.

Television shows and films

In 2012, I watched 1,240 episodes of television shows and 29 films. Just for rough average number 1,240 * 1h + 29 * 2h = 1,240 hours + 58 hours ~= 54 days.

Holy cow, 54 days! I spent two months on watching television shows and films in 2012.

I wish I was wrong but I took very detail records. After I watch an episode, I use VimNotes to take a record with timestamp. One episode per line, so grep and wc can get the correct numbers. I have been keeping record since October, 2010.

If I was able to count my time spent on YouTube, that would definitely contribute a lot.

Code


17,591 additions and 17,874 deletions. Only count towards some of my own repositories.

Once in a while, I would loop a song and keep listening to it over and over again. That's what I am doing and curious what songs I had done with before. I wrote a quick Bash script to use Last.fm user.getRecentTracks API for listening timeline, here is the script:


You will need to obtain a Last.fm API key in order to use this script, the script is run with this syntax:
./obs.sh APIKEY USERNAME
It will retrieve last 1,000 tracks (using 5 API calls) that you have listened to and check consecutive plays of same tracks. Only three or more consecutive plays will be printed out as final results. The following screenshot is a sample output:


Each numbers means how many times the track had been played consecutively including starting play. I use URL to group the result, which serves a unique key and it's okay to be used in final results. Not really hard to read the artist's and track's names from it, although simple process can be used to perfect the output format, but it's not necessary. The first two of same URL are not a glitch of this script, there were some tracks played between them.

The script only retrieve 1,000 tracks, because for every 200 tracks, it's about 140K of XML file. Quite a waste of bandwidth for just the URLs of tracks. Of course, I can pipe through YQL to select <url> elements, but that is a bit overkill for this quick script. Although the API page listed JSON as alternative format, but that only returns empty response. This is not my first time to see JSON format returns empty response, I guess their API documentation is pretty out-of-date or just inaccurate to current status.

Here is a text version of the sample output, in case you wonder what these songs are:
 12 http://www.last.fm/music/Laura+Story/_/Blessings
 26 http://www.last.fm/music/Laura+Story/_/Blessings
  4 http://www.last.fm/music/Gipsy+Kings/_/Volare
 23 http://www.last.fm/music/Ellie+Goulding/_/Your+Song
 17 http://www.last.fm/music/John+Denver/_/Country+Roads+(West+Virginia)
 22 http://www.last.fm/music/Mikeschair/_/Someone+Worth+Dying+For
132 http://www.last.fm/music/Miracle+Of+Sound/_/Commander+Shepard

Just finished some changes for showing song title and artist of music which played by (S)MPlayer in my dzen.

The modified lf-submit.sh (lf-mplayer-wrapper.sh) doesnt extract time information because it will have to parse MPlayers output, though its not hard, but I just didnt want to do it. Beside, the script couldnt decide the song length, because I might set A-B playing mode. Basically, only song title and artist are available to display and thats what my dzen used to show me the songs played by MPD.

Except the time and players status, my dzen shows me same information as if showing MPD status, including Last.fm playcount and loved status. lf-submit.sh helps save the current song information to /tmp/lf-submit.sh.currentsong and my status.c pick up and show them, then lf-playcount-image.sh helps retrieve data from Last.fm.

I dont feel I really need song to be shown in dzen when I play a music video, you can just watch pictures, why do you want to read text? Anyway, it just got me something to do.

If you have watched the screencast above, you may notice that there are some glitches when rolling the text after 050. I knew someday I would have to fix that, problems with characters other than ASCII. Now, I really have to, but later.

Last few days, I have been watching German music video. I found there are some awesome videos and some funny ones. I will post later hopefully.

Oh, sorry for the last 1 minute and 30 second, seeing me fixing that exclamation mark thing!

Since I started to watch music videos on YouTube, I have always wanted to write a YouTube scrobbler but I never did and probably would never do, because it might be messy in someway. I also have downloaded some from YouTube so I could enjoy better performance in full-screen with MPlayer. A couple of days ago, I started to ponder about a MPlayer a wrapper, which enables users having more controls. Such as a notification capable, or something else. But the main purpose of this wrapper is for being used with a Last.fm scrobbler.

And lf-submit.sh was born, a set of pure Bash scripts including three parts:

  • wrapper: A MPlayer wrapper, it parses outputs of MPlayer. It can be used with MPlayer GUI frontend, such as SMPlayer.
  • scrobbler: A scrobbler, tts invoked by wrapper, it reads metadata of files and invokes lf-submit.sh to send an API request.
  • submitter: Submitter, it can be a standalone script. Its the real script which communication with Last.fm.

The scripts support Now playing and Scrobbling. The dependencies are perl, md5sum, and few common shell scripting programs. The scripts are licensed under the BSD License.

1   How to Install

Download three scripts and make sure scrobbler and submitter is in search path. As for wrapper, you can put it anyway and run it. Before you start the wrapper, you must run submitter to configure your account, you will be asked for your Last.fm username and given a link, which you can authorize the scripts to submit scrobbles.

If you use SMPlayer as frontend, change MPlayer executable in preference dialog to wrapper script.

The configuration files are stored at $XDG_CONFIG_HOME/lf-submit.sh/config. If anything goes wrong, you can run lf-submit.sh -r to re-configure.

2   How it Works?

The first step is to run wrapper. For example:

# Use absolute path
/path/to/lf-mplayer-wrapper.sh foo_video.ogg

# If it's in search path
lf-mplayer-wrapper.sh foo_video.ogg

Calling wrapper directly might not be what you want. My search path, its more like this PATH=/home/username/bin:/usr/bin. My ~/bin is first place to look up for a command. In my case, I use a symbolic link:

ln -s /path/to/lf-mplayer-wrapper.sh ~/bin/mplayer

Therefore, /usr/bin/mplayer is wrapped by the wrapper. The wrapper uses which to find the real MPlayer program.

Once the wrapper brings up the MPlayer and supply all arguments which wrapper is given to the MPlayer, it starts to parse MPlayers output. It can detect file changes, then do proper action with scrobbler:

# When new file played, wrapper runs
lf-scrobble.sh -n - /path/to/file.ogg

# When new file played after the end of another, wrapper runs
lf-scrobble.sh -s <TIMESTAMP> /path/to/file.ogg

-n means now playing and -s means scrobble. When scrobbles a track, timestamp of start time must be sent to Last.fm.

Scrobbler takes over, it firstly checks if there is a file named /path/to/file.lfs. File with extension lfs is the metadata file. The scripts do not use central database, the metadata file must sit next to media file, and there is no automatic way to have metadata. The metadata files should have content like:

track=track name blah blah
artist=the artist's name

These two lines are required, you can put more in, please consult with parameters sections of track.scrobble and track.updateNowPlaying.

If scrobbler has everything it needs to make a request to Last.fm, it then invokes submitter. Submitter accepts similar arguments:

lf-submit.sh <-n|-s> 'key1=value1' 'key2=value2' ...

For a scrobble, it would look like:

lf-submit.sh -s 'track=Track Name' 'artist=Artist Name' 'timestamp=123456789'

The order of key-value pairs is not important, submitter will make them in right order internally.

3   Feedback

The scripts are still in unstable stage. Basically, you wont see any error messages from these scripts and that makes debugging harder. If you encounter problems, please provide information such as file name, metadata, MPlayer and frontend player versions. Its better that you create a bug report.

My previous post shows you how to include play count in Conky. I dont know how could I even forget Love song. Anyway, I changed lf-playcount-image.sh, now it shows the loverly heart!

http://farm2.static.flickr.com/1061/5155271854_c5ea850aba.jpg

In my ~/.conkyrc, I made few changes. Basically, you would need:

${execi 6 lf-playcount-image.sh}
${if_match "${execi 6 cut -f 7 -d \  "/tmp/lf-playcount-image"}" == "1"}${color red}$color $else${color black}$color $endif$

First line is to update, second one is to grab the love status, which is stored in /tmp/lf-playcount-image at field 7, space-separated. If its 1, then this currently playing song is loved on Last.fm.

Note

Last.fm API changed and has required API key, so this wouldnt work with the key, and some links have been removed from this post. (2015-12-14T06:30:48Z)

I have been wondering how I could edit my favorite music section in my Blogger Profile. One good way may be the Last.fms top tracks feed.

Note

Since Google+ integration into Blogger, the classic Blogger profile is no more for mine. (2015-12-14T06:28:13Z)

http://4.bp.blogspot.com/_CLdf4ORfzWk/SuK-dtyVT6I/AAAAAAAACTo/4kO4HFtgWk8/s800/toptracks.png

Its an XML feed (e.g. my overall feed), you need to process it. An easy way is to use XSLT processor, xsltproc, you should be no big deal if you are a Linux user.

Today I paid first monthly subscription fee to Last.fm. You may probably be aware that Last.fm is not free for all. People who live outside of US, UK, and German would need to subscribe for listening to streams. I noticed this change two weeks ago, at the moment, I had no intention and no idea that I would subscribe. Earlier, I read a forum thread, which mentions few things:

  • Music is not all free
  • $3 is just enough buy you a cup of coffee

Because of this coffee comparison, I decided to subscribe. And I totally agreed with the first one. Some music are free like on Jamendo. I was hoping Jamendo can be the alternative. Unfortunately, it doesnt have same concept. All I want is the radio-like playing. Jamendo has radio stations, too, but the songs in list are fixed. No random or based on your taste of music. I used to like Pandora, but it doesnt provide service outside of US since two years ago, both paid or free. So Last.fm is my only choice.

And this is me on Last.fm.

I think I have some misunderstanding about Blip.fm. By its name, it's tend to compare to Last.fm. As far as I know, it's ok to compare Last.fm with Pandora. But it's not the case for Blip.fm.

Twitter, instead! Yes, Twitter. I have strong feeling for the word blip after hours, it's like tweet. How come? On Twitter, you simply tweet what you think with text. On Blip.fm, you can tweet (blip) with text and a song or music as well. So, when you blip, it's not all about the song but why you choose that song and what you think. And that's why Blip.fm also has @reply feature. Moreover, you can blip a song many times.

What do you think?

I just signed up not long ago. So, what is this "blip" thing all about? I am not so sure but from my understanding by using it, the music you will be listening to are user-uploaded music files. I think if they were not, then there should not be so many duplications.

First you enter artist name or song name to search for songs. You can preview to check up if that is right song you expected. You can also view a blip-stream on front page (just below the search box) which is made of many blips from users.

What does this "Blip" mean? You can blip a song, which is like a announcement saying you have listened to the song. Of course you don't have to, but that would be strange, wouldn't? Okay, when you decide to blip a song, you also have to write a message within 150 characters, whose content is about the song. Note that you must blip a song in order to put the song into your Blip.fm profile (For example: http://blip.fm/livibetter) a.k.a. Blips list at the sidebar. For the sake of social thing, you must blip some songs, or who would be interested in an empty profile page?

However, you can put any song into your Favorite list, just click on the star-shaped icon at a blip.

Blip.fm supports integration with Twitter, FriendFeed, ..., and Last.fm. Although, some are not really ready. But most important thing is it can scrabble Last.fm and Last.fm scrabble your music. No need to reinvent the wheel. Pretty clever, isn't? You can then blip those songs.

So far, it doesn't have many song. But it's quite stable, no, I haven't activated the beta testing.

Did anyone know if it has something about blip.tv? and when will FriendFeed officially support it?