Well I do.
I think you can scratch most of what I've written in the above message,
look at this bit of trace I can get from a jsoned snstatus.pl:
Code:
--------------------
Opening session with www.squeezenetwork.com
Login success. Got cookie [Set-Cookie3:
sdi_squeezenetwork_session=304871%2000mVXKStErXyxuJ1Lv2mH4BLDiU; path="/";
domain=www.squeezenetwork.com; path_spec; expires="2010-02-23 20:17:43Z";
version=0]
[1235420263] Getting status update from
[http://www.squeezenetwork.com/jsonrpc.js]
JSON query -- BEGIN
$VAR1 = {
'params' => [
'',
[
'serverstatus'
]
],
'version' => '1.1',
'method' => 'slim.request',
'id' => '1'
};
JSON query -- END
JSON response -- BEGIN
$VAR1 = {
'player count' => 2,
'players_loop' => [
{
'playerid' => '00:04:01:02:03:04',
'displaytype' => 'graphic-320x32',
'ip' => '11.22.33.44',
'connected' => 1,
'name' => 'Georgetown',
'model' => 'squeezebox2',
'uuid' => undef,
'isplayer' => 1,
'canpoweroff' => 1,
'power' => 1
},
{
'playerid' => '00:16:cb:a5:6b:73',
'displaytype' => 'graphic-320x32',
'ip' => '11.22.33.44',
'connected' => 0,
'name' => 'SqueezePlay 2',
'model' => 'squeezeplay',
'uuid' => '872fc80108c6d6b82ba824809foobeef',
'isplayer' => 1,
'canpoweroff' => 1,
'power' => 1
}
]
};
JSON response -- END
JSON query -- BEGIN
$VAR1 = {
'params' => [
'00:04:01:02:03:04',
[
'alarms',
'0',
'999'
]
],
'version' => '1.1',
'method' => 'slim.request',
'id' => '1'
};
JSON query -- END
JSON response -- BEGIN
$VAR1 = {
'count' => 2,
'alarms_loop' => [
{
'volume' => '100',
'time' => '36000',
'dow' => '1,2,3,4,5',
'url' => 'http://kexp-mp3-2.cac.washington.edu:8000/',
'id' => '60a0c612',
'repeat' => '1',
'enabled' => '1'
},
{
'volume' => '100',
'time' => '44100',
'dow' => '1,2,3,4,5',
'url' => 'http://kexp-mp3-2.cac.washington.edu:8000/',
'id' => '16b23e7b',
'repeat' => '1',
'enabled' => '1'
}
],
'fade' => '1'
};
JSON response -- END
[1235420263] Sleeping 25 more seconds
--------------------
What you see here is:
- logging and getting a cookie on www.squeezenetwork.com
- sending a "serverstatus" CLI query, JSON style and the response. One
player is on SN
- sending a "<playerID> alarms" CLI query.
Ain't life grand ?
I was in a hurry to report this, so I won't post the code right now, it
needs a bit of polishing. Furthermore, the code uses HTTP::Cookies,
JSON::RPC::Client (which builds on LWP::UserAgent), so it is ok for a
stand-alone script, but that won't do for a plugin. But some other day
I think I saw reusable stuff in Slim::Networking::something.
--
epoch1970
------------------------------------------------------------------------
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins