Hi Alivac,

It looks nice for me, and is for sure a very good use for perl. But, usually, at least in my case, I already know most of the music my friends listen.

So, When I saw your code my first thought was... Can I use this to check what my neighbours are listening to? My neighbours are those people who listen to many of the musics I listen more, so probably I'll like most music they listen also. But as they are completly unknow to me, probably they know other things I still don't know.

So, I made a small change in your script, to make it possible to pass another param to specify that I want friends or neighbours. Here is the diff:
65c65,66 < Param('mode|m')->default('text') --- > Param('mode|m')->default('text'), > Param('info|i')->defau +lt('friends'), 71a73 > my $info = $opt->get_info(); 74c76,79 < my $content = get("http://ws.audioscrobbler.com/1.0/user/${user}/fri +ends.xml"); --- > my $feed=$info eq 'neighbours' > ?"http://ws.audioscrobbler.com/1.0/user/${user}/neighb +ours.xml" > :"http://ws.audioscrobbler.com/1.0/user/${user}/friend +s.xml"; > my $content = get($feed);
Congratulation. A very nice use for perl.


In reply to Re: What are YOUR friends listening to? by themage
in thread What are YOUR friends listening to? by ailivac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.