INTERACT FORUM

Windows => Plug-in Development => Topic started by: gappie on May 26, 2014, 06:46:52 am

Title: MCWS and Python
Post by: gappie on May 26, 2014, 06:46:52 am
ive been reading through this forum and the web the whole morning and I could not find any guidance. :) so I just ask.

im trying to connect a VMeter to mc ( http://vmeter.net/ ).
im not very familiar with Python, but im playing around with it for a while (hello world). on the vmeter site they have some stuff in python that communicates with the vmeter, so that is why I choose python. and I thought that using MCWS was a good idea (rather not the com object).

now the problem is as always... getting started. how do I get anything from or to mc with python using MCSW. for instance print the artist name of the currently playing song... or pause\play...

any help would be much appreciated.

 :)
gab
Title: Re: MCWS and Python
Post by: MrC on May 26, 2014, 12:20:54 pm
You'll need to find and use python libraries that provide authenticated HTTP requests.  Once you can make an AUTH request, then its just a matter of formatting the messages and reading the responses.  You'll also probably also want HTML Entities & URI encoding/decoding and XML modules.  If you are going to write values back to MC, you'll also want a CSV module.  You can look at my perl script modules, specifically MCUtils/MCWS.pm for any of pscriptor, amg.pl, or discogs.pl.  Look at connect(), send(), send_items(), and possibly do_mcc_command().
Title: Re: MCWS and Python
Post by: gappie on May 27, 2014, 01:19:10 am
thank you very much... that helps a lot.. have some more puzzling to do.

 :)
gab