Search found 151 matches

by yokel22
Mon Oct 16, 2017 11:18 pm
Forum: Coding Corner
Topic: Anyone willing to collaborate on a Spotify Web API plugin?
Replies: 13
Views: 269

Re: Anyone willing to collaborate on a Spotify Web API plugin?

I think you've guys have got this covered. I think I'll just step back. I've got plenty on my plate as it is.
by yokel22
Mon Oct 16, 2017 2:53 pm
Forum: Coding Corner
Topic: Anyone willing to collaborate on a Spotify Web API plugin?
Replies: 13
Views: 269

Re: Anyone willing to collaborate on a Spotify Web API plugin?

Personally, I HATE plugins that self load all actions to the tree. I'd say allow the user to select scope from a dropdown or checkbox. Then seperate the scopes actions into seperate folders. That way the user knows which actions can be used. We can use a dict to hold the different scopes parameters....
by yokel22
Sun Oct 15, 2017 12:25 pm
Forum: Coding Corner
Topic: Anyone willing to collaborate on a Spotify Web API plugin?
Replies: 13
Views: 269

Re: Anyone willing to collaborate on a Spotify Web API plugin?

:D grammatical errors are my fortay. I kinda take pride in it. Seriously, change whatever you like, it's your plugin. I'm just trying to help where I can.
by yokel22
Sun Oct 15, 2017 6:07 am
Forum: Coding Corner
Topic: Anyone willing to collaborate on a Spotify Web API plugin?
Replies: 13
Views: 269

Re: Anyone willing to collaborate on a Spotify Web API plugin?

I cleaned up the config & fixed the self.variables. They weren't saving properly the way they were setup. Changed all instances of username to userName to fit rest of naming convention. I'm able to get the access token returned but it gives a 404 error on redirect. I didn't have time to delve into t...
by yokel22
Fri Oct 13, 2017 7:50 pm
Forum: Coding Corner
Topic: How can I use values from def Configure() in an eg.ActionBase class?
Replies: 3
Views: 109

Re: How can I use values from def Configure() in an eg.ActionBase class?

Take a look at this plugin here. It should help clarify a bit.
by yokel22
Fri Oct 13, 2017 7:20 pm
Forum: Coding Corner
Topic: How can I use values from def Configure() in an eg.ActionBase class?
Replies: 3
Views: 109

Re: How can I use values from def Configure() in an eg.ActionBase class?

I believe the syntax for that is gonna be "self.plugin.variableName". I'd have to check on a pc for sure.

So, in plugin base initialize as self.clientID . Then within the action base use self.plugin.clientID .

Take a look at some of the other plugins on your system for a quick example.
by yokel22
Fri Oct 13, 2017 3:19 pm
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

That's not a problem. If it seems like i know what im doing 100% of the time. Its mearly an illusion. You pretty much have several actions done now. I'll get the base plugin setup with some of your code. Since you already know what it does, you'll be able to understand the plugin structure pretty qu...
by yokel22
Fri Oct 13, 2017 2:29 am
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

Man, it looks pretty concise to me. Well done & thanks for sharing. If you ever feel like setting this up into a plugin with the grant flow authorization. I'd be willing to work on it with you. As i have a bunch of fitbit scripts sitting around that just need to be formulated into a plugin. The last...
by yokel22
Thu Oct 12, 2017 7:01 pm
Forum: General Support
Topic: Trying to get the best approach
Replies: 10
Views: 219

Re: Trying to get the best approach

Your not going to be able to get returned data to the script with a triggerEvent action. You'll need to set it up as a function that returns data. Setup a script like this. You'll need to initialize the script each time EG restarts. You can do this by running the script on the 'MainOnInit' event, or...
by yokel22
Thu Oct 12, 2017 6:23 pm
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

on second thought you may want to set it up as an eg.globals function, that way you can call it from any other script. You'll want to run this script either on the 'Main.OnInit' event or put it in your tree's autostart. import json import base64 import requests def refreshSpot(): refresh_token = "My...
by yokel22
Thu Oct 12, 2017 6:10 pm
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

Yep, refreshing the token just upon error should work fine for your needs. As long as your network connection is active when your pc wakes up, i don't foresee any problems. you'll want to format your logic statements like this though. if r.statuscode != 200: 'do something' else: 'do something else'
by yokel22
Thu Oct 12, 2017 5:58 pm
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

The code i posted won't likely be exactly right, it was a script i use for fitbit(it's very similar). It will need to be modified slightly. This is an example script from spotify's api doc. page here: https://developer.spotify.com/web-api/authorization-guide/ . I believe it's a base64encoded clientI...
by yokel22
Wed Oct 11, 2017 4:24 pm
Forum: General Support
Topic: Help with an if not Spacebar based Rule
Replies: 3
Views: 129

Re: Help with an if not Spacebar based Rule

I went ahead & changed the typing event to better suite your needs. <?xml version="1.0" encoding="UTF-8" ?> <EventGhost Version="0.5.0-rc2"> <Folder Name="basic setup" XML_Guid="{458F4F9C-892A-4DB0-9147-4F47806B2828}" Expanded="True"> <Macro Name="IE Opens" XML_Guid="{7865AC7E-73CA-492D-907F-BF96452...
by yokel22
Wed Oct 11, 2017 8:34 am
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

No, it doesn't matter. Once you have your tokens you should be good to go. I can't say positively here as I don't use Spotify. But in past token systems I've used. The current token will expire after a few hrs. The renew token doesn't expire, so the script should be able to update the tokens no matt...
by yokel22
Wed Oct 11, 2017 5:08 am
Forum: Coding Corner
Topic: Trying to use Spotipy [sic] in EventGhost
Replies: 12
Views: 240

Re: Trying to use Spotipy [sic] in EventGhost

Have you gotten to the point where you've got your first token & refresh token? This could all be done within EG but would require module that isn't stock to EG. Unless you plan on writing a plugin for it, it's kinda overkill. If it's just for personal use, then you can get it working pretty easily ...