Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Spotify (api is partially broken)

Questions and comments specific to a particular plugin should go here.
Post Reply
werdna219
Posts: 4
Joined: Fri Aug 10, 2012 1:40 am

Re: Spotify

Post by werdna219 »

Hey so once you get the "Get Track" and " Get Artist" information how do you send that to a broadcast event? I would like to broadcast this to my phone. Is there a python code?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Currently this is given as a simple print statement in the log if you just execute the macro but you can easily use the action result in a python script code.

You have so many options, almost unlimited. To send information to a phone, I am personally using Growl for Windows and "Prowl" on my iPhone ("Notify my Android" for those devices).

First thing I would do is to make a little macro with a script for each info I am interested in. This is a sample for "Get Current Song Title" using Growl :

Code: Select all

theTrack = eg.plugins.MySpotify.GetCurrentTrack()
eg.plugins.Growl.Notify(u'EventGhost', u'Spotify', theTrack, u'', True, 0, None, False)
When I run it, it sends the track name to my phone. That's it, very simple.

Best reg Walter
werdna219
Posts: 4
Joined: Fri Aug 10, 2012 1:40 am

Re: Spotify

Post by werdna219 »

Thats almost what Im looking for, but is there a way to do this with python. I tried modifing your code to no avail. Thank you for the response, Im so close to the answer!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

If you could be more precise, we could give you some hints but we are not interested in guessing games.
Specify your target (phone type, os, phone app etc etc).
werdna219
Posts: 4
Joined: Fri Aug 10, 2012 1:40 am

Re: Spotify

Post by werdna219 »

Im sorry...ill try to explain better. Im linking an Android phone (Atrix) with the event ghost app and the amazing TerREmote. They talk to the eventghost broadcaster event, or even better the Android Plugin for EventGhost. I have recently downloaded the Spotify Plugin and love the simplicity. When I include "Get Track" in a macro, I notice that in the "Viewer" window i can see the correct track. What I would like help with is the code to take that "i" (information) that is received by running "Get Track" and broadcast that to my Android Phone. The code written before seemed very close but you used the plugin notify, which confused me.

I hope this helps, and sorry for being vague, but i do appreciate the time!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

OK, I see now, you have an Android phone. This python script uses the Android plugin for EG. Try this in a macro:

Code: Select all

theTrack = eg.plugins.MySpotify.GetCurrentTrack()
eg.plugins.Android.plugin.Send(theTrack)
The script above will assume that Spotify is running and playing something. To handle situations when this is not the case, the script could be extended with various checks. But it should work to start from...

BR
brotbuexe
Posts: 19
Joined: Wed Feb 21, 2007 8:40 pm

Re: Spotify

Post by brotbuexe »

If Spotify is started when evenghost is running it does not work for me.
I have to exit and restart eventghost.

Is there a way to make shure the plugin works when spotify is started later?
a timer that does the start thing every x minutes.
Or a action I can trigger by pressing a button.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

If Spotify is started when evenghost is running it does not work for me
That is strange, when I test it, it works without problem if Spotify is started before or not. Try the macros "Terminate Spotify" and "Start Spotify" if they works. Here they works fine. (I'm running the test with Vista)

Best regards, Walter
brotbuexe
Posts: 19
Joined: Wed Feb 21, 2007 8:40 pm

Re: Spotify

Post by brotbuexe »

Looks like its only not working after I put my system in standby.

Now when its not working I try to disable the spotify plugin:

Spotify plugin stopped
Spotify monitor thread has stopped

When I then enable it, nothing happens and it still does not work.
I can restart spotify, it still does not work.

When I then restart Eventghost it works.

Spotify found
Spotify object created

Now if I can just do some reload action, I could run this action when the system comes from standby.
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: Spotify

Post by husa550 »

Hi!

This is my first post in this forum.

As my maincontrol i use CommandFusion + iTach IP2IR + http.
Have just found Eventghost, excellent software!
My problem is that i want to use Spotify plugin to control Spotify at the same pc as as i have Eventghost and control spotify works fine.
In the spotify plugin there is funktions to get song title, artist and here i get trouble.
I want eventghost to send song title as feedback to CommandFusion (iViewer 4).
Is that posible without python script/command?
If so, how???
If python script/command i a must, how should that look like?

Thank's

Latest Eventghost
Win7
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Hi husa550,
It is not possible without work, most likely python scripts are needed. I have showed some examples of the same but then sending to an android phone. It all depends how Command Fusion can receive information. Maybe the author of Command Fusion will care to help you out.

Best regards, Walter
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: Spotify

Post by husa550 »

Does someone have an idea how i could send the info after "Spotify Get current status" to commandfusion?
Skärmavbild 2012-09-09 kl. 22.25.45.png
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: Spotify

Post by husa550 »

krambriw wrote:Hi husa550,
It is not possible without work, most likely python scripts are needed. I have showed some examples of the same but then sending to an android phone. It all depends how Command Fusion can receive information. Maybe the author of Command Fusion will care to help you out.

Best regards, Walter
I want to put the text from !info to get in commandfusion plugin: Serial Change
After that it's easy.
Or if there are some way of sending !info text by UDP
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Hi, just looked at it quickly. The action in my Spotify plugin is returning a value as response. This simple python script sends the current track title using SerialChange. You can try if it works.

Best regards, Walter

Code: Select all

theTrack = str(eg.plugins.MySpotify.GetCurrentTrack())
eg.plugins.CommandFusion.SerialChange(1, theTrack)
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: Spotify

Post by husa550 »

krambriw wrote:Hi, just looked at it quickly. The action in my Spotify plugin is returning a value as response. This simple python script sends the current track title using SerialChange. You can try if it works.

Best regards, Walter

Code: Select all

theTrack = str(eg.plugins.MySpotify.GetCurrentTrack())
eg.plugins.CommandFusion.SerialChange(1, theTrack)
Sweet!
It works :mrgreen:
Big thank you!!!
If i want to send the result from "Get Current Status", how will the script look like?
I tried to change Track to Status in the script but that did not work, what am i missing?

Edit: I worked it out :D

This is how it look's now.
Would be nice with fanart, perhaps in the future for this plugin!? :D
SpotifyRemote.gif
Post Reply