Created this file named test.xml:
- Code: Select all
<?xml version="1.0"?><methodCall>
<methodName>enableCamera</methodName>
<params>
<param>
<value>
<string>MY_CAMERA_NAME</string>
</value>
</param>
<param>
<value>
<boolean>1</boolean>
</value>
</param>
</params>
</methodCall>
Ran http://curl.haxx.se/ (substituting MY_CAMERA_NAME above and USERNAME, PASSWORD, HOSTNAME and PORT below with the appropriate values):
- Code: Select all
curl --user USERNAME:PASSWORD --header "Content-Type: application/xml" -X POST [email protected] 'http://HOSTNAME:PORT/xmlrpc/'
Server replies with:
- Code: Select all
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><nil/></value></param>
</params>
</methodResponse>
...and it works, the camera is now on!
Is the API set in stone? Sometimes I forget to enable/disable the cameras. In lieu of an AppleScript interface this might be a nice way to control the application through cron.
