Difference between revisions of "JSON Plugin"

From LinuxMCE
Jump to: navigation, search
(Created page with "Category:LinuxMCE_Plugins This plugin provides access to DCERouter internals via http protocol on port 7230. This plugin is purely academic at the moment and not part of...")
 
(Adding note about the JSON PHP script on github.)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
[[Category:Programmer's Guide]]
 
[[Category:LinuxMCE_Plugins]]
 
[[Category:LinuxMCE_Plugins]]
This plugin provides access to DCERouter internals via http protocol on port 7230.  
+
This plugin provides access to DCERouter internals via http protocol on port 7230. At the moment of this writing (Aug 2014) it does NOT work together with the RPC Plugin.
  
This plugin is purely academic at the moment and not part of a regular build cycle.
+
This plugin is purely academic at the moment and not part of a regular build cycle. Sometimes a binary can be downloaded from [http://fluffybitch.org/builder-precise/JSON_Plugin fluffy].
 +
== Installation ==
 +
Like any other plugin, the JSON plugin is a child of DCERouter in your device tree. Make sure you have updated sqlCVS to have the corresponding JSON Plugin device template.
 +
* Add a child to DCERouter - Select the JSON Plugin
 +
* Download the JSON_Plugin.so binary into /usr/pluto/bin
 +
* Quick reload the router
  
 
== Supported Information ==
 
== Supported Information ==
Line 8: Line 14:
 
Easiest way to get information about what player is at the moment playing stuff in a specific entertainment area:
 
Easiest way to get information about what player is at the moment playing stuff in a specific entertainment area:
  
  http://dcerouter:7230/now_playing?ea=<number-of-ea>&timestamp=<timestamp-of-last-access>
+
  http://dcerouter:7230/now_playing?ea=$FK_Entertain_Area&timestamp=$last-timestamp-we-have-seen
 +
=== Playlist ===
 +
Returns the current playlist in a specific entertainment area
 +
 
 +
http://dcerouter:7230/playlist?ea=$FK_Entertain_Area
  
 
== Adding Information Provider ==
 
== Adding Information Provider ==
 
Below the src/JSON_Plugin directory is the CivetHandler directory. Take a look at how NowPlaying is incorporated and amend/extend appropriately, and add the required stuff to JSON_Plugin.cpp and the Makefile.
 
Below the src/JSON_Plugin directory is the CivetHandler directory. Take a look at how NowPlaying is incorporated and amend/extend appropriately, and add the required stuff to JSON_Plugin.cpp and the Makefile.
 +
 +
An alternative can be found on [https://github.com/posde github] - a PHP script utilizing the JSON Plugins output for the router space information and at the same time providing access to some tables via MySQL access.

Latest revision as of 12:10, 23 February 2019

This plugin provides access to DCERouter internals via http protocol on port 7230. At the moment of this writing (Aug 2014) it does NOT work together with the RPC Plugin.

This plugin is purely academic at the moment and not part of a regular build cycle. Sometimes a binary can be downloaded from fluffy.

Installation

Like any other plugin, the JSON plugin is a child of DCERouter in your device tree. Make sure you have updated sqlCVS to have the corresponding JSON Plugin device template.

  • Add a child to DCERouter - Select the JSON Plugin
  • Download the JSON_Plugin.so binary into /usr/pluto/bin
  • Quick reload the router

Supported Information

Now Playing

Easiest way to get information about what player is at the moment playing stuff in a specific entertainment area:

http://dcerouter:7230/now_playing?ea=$FK_Entertain_Area&timestamp=$last-timestamp-we-have-seen

Playlist

Returns the current playlist in a specific entertainment area

http://dcerouter:7230/playlist?ea=$FK_Entertain_Area

Adding Information Provider

Below the src/JSON_Plugin directory is the CivetHandler directory. Take a look at how NowPlaying is incorporated and amend/extend appropriately, and add the required stuff to JSON_Plugin.cpp and the Makefile.

An alternative can be found on github - a PHP script utilizing the JSON Plugins output for the router space information and at the same time providing access to some tables via MySQL access.