Le mardi 19 décembre 2006 17:39, Michael Ablassmeier a écrit : > hi, Hi !
> hm, well, imho the manpage says it clearly: > > [..] > Also, the submit method requires that the following configuration > parameters be set for this "Audio::Scrobbler" object: > > * username > The username of the user's AudioScrobbler registration. > > * password > The password for the AudioScrobbler registration. That's precisly what I was talking about, when I was testing the perl module, submit failed when password was passed only at submit function, I had to pass it at the constructor too. In the helper example, it seems that the paramaters passed to the constructor and submit are the same... > > * The parameter passing on submit is submit({ 'artist' => 'blabla, ..}) > > and not as stated submit('artist' => 'blabla', ...) which leads to > > the above bug. > > yes, thats not clearly statet in the manpage, which only speaks about a > "hash referenced by the info parameter". One could guess it. Im going to > add the missing brackets in the SYNOPSYS section with the next upload. > > > Also, please consider a complete and working example and not only 'this > > and this parameter is needed', it saves times ! > > the package ships /usr/bin/scrobbler-helper, you might want to have a > look at this one. Example config is shipped aswell. Im going to add a > pointer to this script in README.Debian. Yes, but this script is very difficult to understand since the option array is never explicitly stated. For instance I had to go through the specs online to guess a correct progname and progversion (mandatory).. Here is a simple example that works for for me (c): #!/usr/bin/perl use Audio::Scrobbler; # progname tst and version 1.0 are for test only, do not publish code using # it.. $scrob = new Audio::Scrobbler('cfg' => { 'username' => "my-user", 'progname' => 'tst', 'progver' => '1.0', 'password' => 'hackme' }); $scrob->handshake() or die "Scrobbler: ".$scrob->err()."\n"; $scrob->submit({ 'artist' => 'my-artist', 'album' => 'my-album' , 'title' => 'my-title', 'username' => 'my-user', 'password' => 'hackme', 'progname' => 'tst', 'progver' => '1.0', 'length' => 120 }) or die "Scrobbler submit: ".$scrob->err()."\n"; Romain -- We sick an' tired of-a your ism-skism game - Dyin' 'n' goin' to heaven in-a Jesus' name, Lord. We know when we understand: Almighty God is a living man.