]> git.sesse.net Git - vlc/blob - share/lua/http/requests/status.xml
866e13d65a8521106a73dacf34b031c955d2b3ae
[vlc] / share / lua / http / requests / status.xml
1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlcprint'>'?>
2 <?vlc --[[
3 vim:syntax=lua
4 <!--  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
5 <  status.xml: VLC media player web interface
6 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
7 <  Copyright (C) 2005-2009 the VideoLAN team
8 <  $Id$
9
10 <  Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
11 <                       Rob Jonson <rob -at- hobbyistsoftware -dot- com>
12
13 <  This program is free software; you can redistribute it and/or modify
14 <  it under the terms of the GNU General Public License as published by
15 <  the Free Software Foundation; either version 2 of the License, or
16 <  (at your option) any later version.
17
18 <  This program is distributed in the hope that it will be useful,
19 <  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 <  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 <  GNU General Public License for more details.
22
23 <  You should have received a copy of the GNU General Public License
24 <  along with this program; if not, write to the Free Software
25 <  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
27 ]]?>
28
29 <?vlc
30
31 --package.loaded.httprequests = nil --uncomment to debug changes
32 require "httprequests"
33
34 httprequests.processcommands()
35
36 local statusTable=httprequests.getstatus(false)
37
38 print('<root>\n')
39 httprequests.printTableAsXml(statusTable,0)
40
41 local item = vlc.input.item()
42
43 --data in the information section is presented in a non-standard way to keep compatibility.
44
45 ?>
46 <information>
47     <category name="meta">
48     <?vlc
49       if item then
50         local metas = item:metas()
51         for k,v in pairs(metas) do
52           print("<info name='"..k.."'>"..vlc.strings.convert_xml_special_chars(v).."</info>")
53         end
54       end
55     ?>
56     </category>
57   <?vlc
58     if item then
59       local info = item:info()
60       for k, v in pairs(info) do
61         print("<category name='"..k.."'>")
62           for k2, v2 in pairs(v) do
63             print("<info name='"..k2.."'>"..vlc.strings.convert_xml_special_chars(v2).."</info>")
64           end
65         print("</category>")
66       end
67     end
68   ?>
69   </information>
70   <stats>
71   <?vlc
72     if item then
73       local stats = item:stats()
74       for k,v in pairs(stats) do
75         local tag = string.gsub(k,"_","")
76         print("<"..tag..">"..tostring(v).."</"..tag..">\n")
77       end
78     end
79   ?>
80   </stats>
81 </root>