Skip to main content


If you are using a Hotmail or Outlook email address, please change it now, as Microsoft is rejecting all email from our service outright.
Topic: R2YS a script for reddit (Read 3410 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

R2YS a script for reddit

 *The usage of this script must comply with the Reddit API Terms of Use
 *I will not be responsible for any modifications of the script made by the end users that do not comply with the terms.
 *Original concept (Subreddit to YouTube Source Bookmarklet) from
 *Search subreddits for youtube/vimeo/spotify url's and create a playlist within foobar2000.
 *Required components:
 *JScript Panel ( and
 *Youtube Source (
 *foo_input_spotify ( Spotify support for foobar2000. Requires a Spotify premium account.
 *Optional components:
 *m-tags (
 *Create an empty jscript panel and import the script.
 *Modify the script with your oauth2 credentials / or add them in the jscript panel properties.
 *username and password are your reddit credentials.
 *You must authorize with your account @ as your personal script to get your client_id  and client_secret keys.
 *See ,
 * example:
 * var username = window.GetProperty("Reddit.username", "redditusername");
 * var password = window.GetProperty("Reddit.password", "redditpassword");
 * var client_id = window.GetProperty("Reddit.client_id", "redditclientid");
 * var client_secret = window.GetProperty("Reddit.client_secret", "redditsecret");

Re: R2YS a script for reddit

Reply #1
Tried it, works, thanks!  8)

Re: R2YS a script for reddit

Reply #3
Script no longer works nowadays. I get this:

Reloading or fiddling with the config doesn't help.

Re: R2YS a script for reddit

Reply #4
It it still working  with JScript Panel v.1.3.0
Can you provide an output from the console panel where it crashes?

Re: R2YS a script for reddit

Reply #5
It it still working  with JScript Panel v.1.3.0
Same version here. Something else was wrong with my config, because another JScript panel crashes too (YouTube Track Manager).

Found the relevant log info:
Code: [Select]
JScript Panel: This component requires your system has IE9 or later installed.

So the solution is to install Internet Explorer 9 or later.

Re: R2YS a script for reddit

Reply #7
great job

Re: R2YS a script for reddit

Reply #8
foo_jscript_panel introduced breaking changes in v2.0.0 that require updating your script:

fb.Trace has been removed and replaced with a native console.log method so you'll need to do a simple find/replace in all your scripts. It takes multiple arguments as before.

window.GetColorCUI -> window.GetColourCUI
window.GetColorDUI -> window.GetColourDUI

Re: R2YS a script for reddit

Reply #10
Some hints for installation for the 'non-experts':

- foo_input_spotify or a Spotify Premium Account is not required

- to get the reddit credentials:
     - register at reddit to get username and password
     - to get client_id and client_secret:
          - click here:
          - in the template fill any name at the field 'Name'
          - check 'script'
          - Type any description
          - leave 'about url' blank
          - at 'redirect url' type ''  (that did at least work for me, don't ask me why)
          - then confirm and you see something like this:
            - the red underline string is the client_secret, the string 'p-jcoL...' right to the app icon on top of the page is the client_id
            - then include username, password, client_id, client_secret in the header of the js code as described by zeremy

- when first using the code the script crashed. Fix: I had to create the folder media\r2ys manually in my foobar directory (using portable installation)
- then the plugin worked great  :)
- in my skin the panel appeared to be white text on white background (referring only to status message, left-click reddit functions worked well). Fix: underlying PSS with black background and click 'pseudo-transparent' in the js panel

And then: enjoy ;D Thanks to zeremy!



Re: R2YS a script for reddit

Reply #11
Updated to Jscript Panel v2+

I didn't have the media folder in fb.ProfilePath and it errored when it was supposed to create it with
Microsoft JScript runtime error:
Path not found
Problem was solved by creating the media folder manually in shell:AppData\foobar2000\
I uncommented //gr.FillSolidRect(0, 0, ww, wh, g_backcolor); as well because the background was white and you couldn't see the text.

Re: R2YS a script for reddit

Reply #13
After the first shot where I had no problems to connect to reddit, I wanted to change my password (as I did not want to ues one of my 'good' passwords here). Old clident id with new pwd did not work, so I generated a new script and new client id and secret. However, since then I am not able to connect, not even with a fully new login at reddit (new email, new user,...). Any hints?

Re: R2YS a script for reddit

Reply #14
Try clearing the panel's properties and reload.
Right click the panel > Select Properties > Press the clear button > Apply.

Re: R2YS a script for reddit

Reply #15
Thanks very much!! Now works again perfect! (can't explain why I didn't even look into the properties.....)

Re: R2YS a script for reddit

Reply #16
To get it to work with JScript v2.3+:
Fix utils.CheckComponent(..) calls to only take first parameter

Code: [Select]
 utils.CheckComponent(name) (boolean)
The previously optional "is_dll" parameter was removed in v2.3.0.
The filename is now always checked (equivalent to "is_dll" being true).


SimplePortal 1.0.0 RC1 © 2008-2020