from http://liquidsoap.fm/doc-svn/scripts/get_json_metadata.html 
<http://liquidsoap.fm/doc-svn/scripts/get_json_metadata.html>

meta = ref []

# s = some source

# Update current metadata
# converted in UTF8
def update_meta(m) =
  m = metadata.export(m)
  recode = string.recode(out_enc="UTF-8")
  def f(x) =
    (recode(fst(x)),recode(snd(x)))
  end
  meta := list.map(f,m)
end

# Apply update_metadata
# every time we see a new
# metadata
s = on_metadata(update_meta,s)

# Return the json content
# of meta
def get_meta(~protocol,~data,~headers,uri) =
  m = !meta
  http_response(
    protocol=protocol,
    code=200,
    headers=[("Content-Type","application/json; charset=utf-8")],
    data=json_of(m)
  )
end

# Register get_meta at port 700
harbor.http.register(port=7000,method="GET","/getmeta",get_meta)





> On May 15, 2015, at 9:40 AM, dtouch3d completely <[email protected]> wrote:
> 
> Hello,
> 
> I have a large number of streams (about 100) produced by liquidsoap. the will 
> be available from a web site and I want to show the corresponding metadata. 
> Ideally, I would like to use something like websockets from a separate 
> application, so the metadata would be pushed to listeners on change.
> 
> I am thinking about using the on_track function in liquidsoap. What is the 
> proper way to send the metadata from liquidsoap to my app ? I thought about 
> making a request to a local webserver but I cannot find a way to do this 
> natively from liquidsoap. I could try to call system and make a request with 
> curl or something. Or maybe I could use UNIX sockets.
> 
> Is there a proper way to do something like this ?
> 
> Thanks.
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to