Ruby JSON RPC API Client
#1
Star 
Hi Folks,

just wanted to let you know that I've created a (very alpha and basic) Ruby client for the JSON RPC API.

It does not explicitly define all the classes and methods in the source code, but rather builds itself on the fly by calling JSONRPC.Introspect and then dynamically defining all namespaces and methods, so with very little code, the API is (kind of) covered completely.

You can find the source on Github: https://github.com/colszowka/xbmc-client

It is available as a Rubygem "xbmc-client", see the gem website at http://rubygems.org/gems/xbmc-client

I've only tried it with the AudioLibrary and AudioPlayer API so far, but I don't see a reason why it shouldn't work for the other API requests as long as there are no quirks in certain API calls that I'm not aware of.

I've also filed a related feature request for the JSON RPC API on Trac: http://trac.xbmc.org/ticket/10763
Reply
#2
damn that's beautiful code Smile
Reply
#3
spiff Wrote:damn that's beautiful code Smile

Thanks mate Wink
Reply
#4
I must say, building the methods on the fly is so beautiful I want to cry Smile Perfect example why we added the introspect.

Great job! Hope to see some awesome clients thanks to this!
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#5
Thanks again Smile

I'm currently working on a music web client based upon this with Rhythmbox/Itunes-ish UI. Basic stuff is (kinda) working already, but it will need a lot more work - no real UI at the moment. We'll see...
Reply
#6
Very nice usage of the ruby language! Now wouldn't it be nice if we could write addons for xmbc in ruby? Wink
Reply
#7
Hello,

Firstly - sorry for dragging up such an old thread.

I've recently found an interesting Ruby client for AirVideo - a Windows and Mac based Server which transcodes content on the fly (on the remote side) primarily for consumption over the Internet.

The server was developed for iOS devices (iPhone/iPod/iPad etc.). One installs the "Server" component on their machine at home with enough horsepower to transcode video, and the AirVideo "App" on their iDevice to stream that content on the road.

I've been looking for a way to add a remote video source to XBMC that would be capable of traversing a WAN connection, served by a typical home Internet connection. As most of my content is 720p+, that really means there is a need to transcode due to limited available bandwidth. I use AirVideo on my iPhone, and if you have a recent build of XBMC running, you can use Apple's own AirPlay technology to achieve this already, but that requires an iDevice to leverage.

I'd like to be able to eliminate the iDevice, and instead stream directly from the Server to the remote XBMC client.

Here is the link to the forum post which in turn links to the software (including source) :

http://inmethod.com/forum/posts/list/195/514.page#23889

Here is the post inline as well :

Code:
Air Video Client for Windows: [url]http://dl.dropbox.com/u/10205542/AirVideoClient_win32_20111218.zip[/url]
Requirements: Windows XP or later. For live conversion, .NET framework 4 is required, and if you are using Air Video Server 2.4.3, download Elecard AVC HD Player (trial version), and locate the player in the client app. For Air Video Server 2.4.5beta users, locate a VLC media player in the app. TCP port 8008 must be opened for live re-streaming proxy.

[03/22/2011] Re-implemented by wxRuby
[03/25/2011] Mod for Ruby 1.9. HTTPLiveStreamingProxy is now isolated from the client app.
[03/28/2011] Playing with live conversion is now available on Windows XP or later with Elecard AVC HD Player.
[03/29/2011] Tests on pseudo-seek during live conversion.
[03/31/2011] Now compatible with AirVideo Server 2.4.5beta (playback/livePlayback-2.4).
[04/01/2011] Fixed wrong live playback starting points, etc.
[04/03/2011] HTTPLiveStreamingProxy was re-written by C#, which resulted in less memory usage. Add manual bitrate selection / recording buttons.
[04/07/2011] Fixed live conversion request method (now all movies could be played by live conversion)
[04/07/2011] Abort the development because much better solution has been found. See pavram's post on 5th Apr 2011.
[05/31/2011] Temporal fix of encoding problems (UTF8-MAC) on AirVideo Server 2.4.5beta6 Mac
[12/18/2011] Context menus for sorting options were added for my personal use. Recompiled with Ruby 193p0 and Ocra 1.3.


Is a Ruby client like this something which can be made to work with XBMC? Not being one who can program, I have little to no idea.

Thanks,

-- Phob
Reply

Logout Mark Read Team Forum Stats Members Help
Ruby JSON RPC API Client0