<commit_before>= XBMC-Client

This is a simple Ruby client for the XBMC (XBox Media Center) JSON-RPC API.

It does not define all the API methods explicitly, but rather loads and defines them
on the fly by pulling the available namespaces and methods from the JSONRPC.Introspect
call baked into the XBMC Api and thus has all methods described there available via
Xbmc::NAMESPACE.method_name_in_underscore_writing, so for example the JSON RPC call 
`AudioPlayer.PlayPause` becomes `Xbmc::AudioPlayer.play_pause`.

Parameters can be passed in to all methods via the optional first argument to each
method call, which is expected to be a hash: `Xbmc::AudioLibrary.get_songs(:albumid => 1)`

Note that this is a very early release and is considered experimental. There will
be bugs.

The client is being developed against Ruby 1.9.2, but should work with Ruby 1.8 as well.

== Install

  gem install xbmc-client
  
== Usage

  require 'pp'
  require 'xbmc-client'
  
  # Set up the url and auth credentials
  Xbmc.base_uri "http://localhost:8435"
  Xbmc.basic_auth "xbmc", "xbmc"
  Xbmc.load_api! # This will call JSONRPC.Introspect and create all subclasses and methods dynamically
  
  pp Xbmc::AudioLibrary.get_artists
  # > [{"artistid"=>1,<commit_msg>RDoc fiddle...<commit_after>= XBMC-Client

This is a simple Ruby client for the XBMC (XBox Media Center) JSON-RPC API.

It does not define all the API methods explicitly, but rather loads and defines them
on the fly by pulling the available namespaces and methods from the <code>JSONRPC.Introspect</code>
call baked into the XBMC Api and thus has all methods described there available via
Xbmc::NAMESPACE.method_name_in_underscore_writing, so for example the JSON RPC call 
`AudioPlayer.PlayPause` becomes `Xbmc::AudioPlayer.play_pause`.

Parameters can be passed in to all methods via the optional first argument to each
method call, which is expected to be a hash: `Xbmc::AudioLibrary.get_songs(:albumid => 1)`

Note that this is a very early release and is considered experimental. There will
be bugs.

The client is being developed against Ruby 1.9.2, but should work with Ruby 1.8 as well.

== Install

  gem install xbmc-client
  
== Usage

  require 'pp'
  require 'xbmc-client'
  
  # Set up the url and auth credentials
  Xbmc.base_uri "http://localhost:8435"
  Xbmc.basic_auth "xbmc", "xbmc"
  Xbmc.load_api! # This will call JSONRPC.Introspect and create all subclasses and methods dynamically
  
  pp Xbmc::AudioLibrary.get_artists
  # > [{"artistid"=>1,
{'fraction_non_alphanumeric': 0.06910246227164417, 'fraction_numerical': 0.008737092930897538, 'mean_word_length': 4.405579399141631, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3454137', 'n_tokens_mistral': 787, 'n_tokens_neox': 767, 'n_words': 328}