Site policy on userscripts

jt4703 wrote 9 years ago: 1

Alex2k wrote:
Hi guys, what is site's policy on userscript ? I tinkered a little userscript that do this:
1) Show - Episode list
2) Show - Watchlist
3) Watchlist
Fourth radio button make episode skipped.

Yes please!! This looks great to me for single click actions.


Jan wrote 9 years ago: 1

Hi Alex2k,

You're welcome to create userscripts to service yourself and others. However you should make users aware that TVmaze itself is not affiliated or responsible for the scripts nor does it provide any kind of support.

cheers,

Jan

Alex2k wrote 9 years ago: 1

Thank you Jan.

DISCLAIMER: You can use this script as you want, install it in any browser you could figure out how, modify and create derivative works. It can broke at any time if site design changes, but you probably could be able to fix it - it's very simple script not rocket surgery. You are on your own. Figure it out.

Script link: https://gist.github.com/anonymous/8e30b799f174bacb660838af0f109506

INSTALLATION:

Mozilla Firefox:

1) If needed install Greasemonkey add-on https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
2) Go to https://gist.githubusercontent.com/anonymous/8e30b799f174bacb660838af0f109506/raw/35b90bc1cdd0fb684d687d8af019c6d284872233/tvmaze_episodes_list_enhancement.user.js and accept (press install button).

Google Chrome (accordingly to http://superuser.com/questions/450893/how-to-install-a-private-user-script-in-chrome-21#450903):
1) Download https://gist.githubusercontent.com/anonymous/8e30b799f174bacb660838af0f109506/raw/35b90bc1cdd0fb684d687d8af019c6d284872233/tvmaze_episodes_list_enhancement.user.js
2) Open chrome://chrome/extensions/.
3) Drag and drop the user script file on the page you opened in step 2.

Personally, i only use Firefox, so installation for Google Chrome could be outdated.

jt4703 wrote 9 years ago: 1

Thank you!! Is it be possible to add the labels U W A S above the radio button columns? This is great!

Alex2k wrote 9 years ago: 1

jt4703 wrote:
Thank you!! Is it be possible to add the labels U W A S above the radio button columns? This is great!

You are welcome. New script version (1.01): https://gist.github.com/anonymous/80b2a1036a06ede16d7b8be3ec53758f

To download/install script push button "Raw" on script's page.

Also important note: icons/titles/radiobuttons are created based on Status dropdown box content. So, if new states will be added or order of the states changed, script should survive that.

vBm wrote 9 years ago: 1

For Chrome it's best to use TamperMonkey since it's 100% compatible with GreaseMonkey's API and functioning.

Unfortunately I couldn't get the script to work neither in Chrome nor in Firefox. I keep getting "String.substring is not a function" error.

Alex2k wrote 9 years ago: 1

vBm wrote:
For Chrome it's best to use TamperMonkey since it's 100% compatible with GreaseMonkey's API and functioning.
Unfortunately I couldn't get the script to work neither in Chrome nor in Firefox. I keep getting "String.substring is not a function" error.

I use FireFox 47 & Greasemonkey 3.8 on Windows XP & Ubuntu 16.04. Try this version https://gist.github.com/anonymous/10115287cd69c1524c70babf32dea5c5#file-tvmaze_episodes_list_enhancement-user-js

If it won't work try to use first version of the script - it work exactly the same way except fancy column headers.

vBm wrote 9 years ago: 1

Thanks, that fixed it.

Alex2k wrote 9 years ago: 1

vBm wrote:
Thanks, that fixed it.

You welcome.

jt4703 wrote 9 years ago: 1

Thanks for the fancy column headers! Looks great!!

I notice odd behavior when I have multiple episodes for a show listed and I change one from acquired to watched. It refreshes that part of the page but the radio buttons disappear. I have to reload the page entirely to get them back. Is this expected behavior due to the way the page updates or something fixable? It is also possible this occurs for any status change where multiple episodes are listed but all I have on my watchlist with multiple episodes are marked acquired from before the script use. Thanks for working on this! I love it :)

Alex2k wrote 9 years ago: 1

jt4703 wrote:
I notice odd behavior when I have multiple episodes for a show listed and I change one from acquired to watched. It refreshes that part of the page but the radio buttons disappear. I have to reload the page entirely to get them back. Is this expected behavior due to the way the page updates or something fixable? It is also possible this occurs for any status change where multiple episodes are listed but all I have on my watchlist with multiple episodes are marked acquired from before the script use. Thanks for working on this! I love it :)

Aha ! That's because i only lightly tested changing states on watchlist before and didn't tested changing states at all after adding columns headers. I don't use watchlist to mark episodes as watched, i use show's episode list, so this issue was unknown to me. Will be trying to fix it.

vBm wrote 9 years ago: 1

Would be quite nice if you'd start using openuserjs.org or greasyfork.org. That way GM/TM would be able to automatically update script.

Or even non anon gist would be good for that matter xD

Thanks tho.

Alex2k wrote 9 years ago: 1

Po-zh-aa-loo-st-aa

jt4703 wrote 9 years ago: 1

The update isn't working for the expected results. Going from acquired to any other state the section refreshes and radio buttons do not come back. They flash but don't stay. I don't remember them flashing before so that's new!

Further testing. Going from unwatched to acquired and back to unwatched the radio buttons disappear but if I go to another episode in the same show and change the status to acquired by the drop down menu, the section refreshes and the radio buttons return.

Appreciate your time on this script!

Alex2k wrote 9 years ago: 1

jt4703 wrote:
They flash but don't stay. I don't remember them flashing before so that's new!

Well, i tried to catch page refresh and add radio buttons so that is flashing, but it's inherently brittle. I'm afraid without deeper page logic modification it's impossible to achieve predictable results. And believe me, you don't want this deep modifications, because site could broke instantly after slightest modifications. My goal always was slight correction/rearrangement of controls, so script could survive minor site modifications or at least fail gracefully and not broke silently and start corrupting data while presenting appearance that's everything still OK.

So, for now refreshing page then needed (hopefully not every time) or using episodes list/show's watchlist instead of watchlist seems as your choice. I i'll take another crack at it, but as i said that's inherently unpredictable.

jt4703 wrote 9 years ago: 1

OK!! It looks great with the columns and I can deal with refreshing when I binge watch, or head into the view all list since THAT list is stable. Thanks again for the great tool! :)

Alex2k wrote 9 years ago: 1

jt4703 wrote:
Thanks again for the great tool! :)

Enjoy it!

Try 30 days of free premium.