Forum › Dynasty Reader Userscripts

Cinnabar-profile
joined Aug 3, 2015

Alice Cheshire posted:
Not entirely certain what this means and Git's help page on the reset command doesn't have any functional examples (a very common issue with documentation for most programming related things in my experience) that might indicate what parameter I'm messing up and how.

I'm not familiar with the Mercurial client, but it looks like reset in the console might not be bound to the actual Git reset command? Try something like git reset --hard HEAD~1

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

Ah, that's a good point. Git commands in Mercurial need to have "git" before the command since a lot of them are the same commands between Git and Mercurial. I completely spaced that.

I still get this though:

Dynasty Thingifier% git reset --hard    
fatal: Not a git repository (or any of the parent directories): .git    

This is with my Thingifier repository selected so I'm not sure what to do. I may need to look into Mercurial's reset command instead. (Didn't do the HEAD~1 part since I need to revert back a fair distance and that only goes back one commit from what I was reading in the help file.)

last edited at Oct 13, 2017 10:41PM

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

(Ignore these, I'm using them for script testing)

4-koma Kabedon Space

Cinnabar-profile
joined Aug 3, 2015

Alice Cheshire posted:

Ah, that's a good point. Git commands in Mercurial need to have "git" before the command since a lot of them are the same commands between Git and Mercurial. I completely spaced that.

I still get this though:

Dynasty Thingifier% git reset --hard    
fatal: Not a git repository (or any of the parent directories): .git    

This is with my Thingifier repository selected so I'm not sure what to do. I may need to look into Mercurial's reset command instead. (Didn't do the HEAD~1 part since I need to revert back a fair distance and that only goes back one commit from what I was reading in the help file.)

Well, that's odd. My best guess is that the Mercurial client does not actually clone into a local git repository, but simply interfaces with the remote repository and stores everything in its own format locally. I know nothing about Mercurial so I'm afraid I can't help in this case.

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

cyricc posted:

Well, that's odd. My best guess is that the Mercurial client does not actually clone into a local git repository, but simply interfaces with the remote repository and stores everything in its own format locally. I know nothing about Mercurial so I'm afraid I can't help in this case.

I had to discard my repository and create a new one to get things working again but it looks like I've got it all fixed now and pushed my update from yesterday (removing http support like gwennie-chan suggested) to Github. That was a total mess, lol. Looks like it may take me a bit to get used to this.

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

Hey Alice, would you remove the pendtags stuff from the Thingifier, I've created my own little script that surpasses it.?

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

gwennie-chan posted:

Hey Alice, would you remove the pendtags stuff from the Thingifier, I've created my own little script that surpasses it.?

Yeah, it can be removed. I'll deal with it later.

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

Dynasty Tagifier

Current Version: 1.15 || Released: September 17, 2020


Dynasty Tagifier is a Tampermonkey userscript that adds functionality regarding site tags and stats.

Changelog News - Added FSNS feature, check out the description below!


Features

Forum Tagger

Forum Tagger scans forum posts and image comments looking for Tag objects, checks if the tags are valid, and, if so, turns them into clickable links to each tag's page. (If you have the script installed, this Yuri tag should be linked.)
(For the nerds, it does this dynamically pulling and parsing Dynasty's JSON and then scanning all <code> elements.)

Tag Suggestions Switcher (TSS)

TSS puts a controller bar on the tag suggestions status page (link requires account) so users can select the type of tag suggestions (Approved, Rejected, or Pending) the page displays, whether a single type, a mixture, or all of them.

Forum Stats Number Shortener (FSNS)

FSNS converts the stats numbers on the Forum navigation pages for views and posts to automatically shorten, round anything over 1000 and insert the appropriate abbreviation ("K" or "M") after the shortened number.


Installation

Make sure you have Tampermonkey installed. Once that is done, if necessary, click this install link and follow the extension's instruction to install.

last edited at Sep 17, 2020 4:47PM

F4x-3lwx0aa0tcu31
joined Apr 20, 2013

"Script has been updated" and with that none of the functions are available now lo/

I tried reinstalling, I'm using firefox with greasemonkey but ... no, it's gone, it appears to be active according to the monkey but I can't see it. Gallery viewer works fine

Edit: Works with Tamper!

last edited at Oct 14, 2017 11:23PM

Cinnabar-profile
joined Aug 3, 2015

gwennie-chan posted:

Dynasty Tagifier

Current Version: 1.01 || Released: October 14, 2017


Dynasty Tagifier is a Tampermonkey userscript that adds functionality regarding site tags.


Features

Forum Tagger

Forum Tagger scans forum post Tag objects for valid tags and turns them into clickable links to each tag's page.
(For the nerds, it does this dynamically pulling and parsing Dynasty's JSON and then scanning all <code> elements.)

Tag Suggestions Switcher (TSS)

TSS puts a controller bar on the tag suggestions status page (link requires account) so users can select the type of tag suggestions (Approved, Rejected, or Pending) the page displays, whether a single type, a mixture, or all of them.


Installation

Make sure you have Tampermonkey installed. Once that is done, if necessary, click this install link and follow the extension's instruction to install.

Whoa, I didn't realize Dynasty supported a JSON API for tags. Any others you're aware of? Very cool!

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

Serenata posted:

"Script has been updated" and with that none of the functions are available now lo/

I tried reinstalling, I'm using firefox with greasemonkey but ... no, it's gone, it appears to be active according to the monkey but I can't see it. Gallery viewer works fine

Edit: Works with Tamper!

Yeah, if your Greasemonkey recently updated to their new shit version that's to be expected. It'll only work on Tampermonkey now. I'll fix up the OP's info on it when I go to add gwennie-chan's new script to it later. (Which I intend to do when I remove her pending tags code from the Thingifier which I'll probably end up doing tomorrow.)

cyricc posted:

Whoa, I didn't realize Dynasty supported a JSON API for tags. Any others you're aware of? Very cool!

I by no means have a comprehensive list but I went through at some point last year and figured out a fair few of them:
http://dynasty-scans.com/chapters/lovesick_girl.json for any chapter/series
http://dynasty-scans.com/chapters.json
http://dynasty-scans.com/chapters/added.json for recently released/added chapters.
http://dynasty-scans.com/pairings.json for all the directory indexes.
http://dynasty-scans.com/scanlators/dynasty_scans.json for all the specific directory pages.

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

Alice Cheshire posted:

cyricc posted:

Whoa, I didn't realize Dynasty supported a JSON API for tags. Any others you're aware of? Very cool!

I by no means have a comprehensive list but I went through at some point last year and figured out a fair few of them:
https://dynasty-scans.com/chapters/lovesick_girl.json for any chapter/series
https://dynasty-scans.com/chapters.json
https://dynasty-scans.com/chapters/added.json for recently released/added chapters.
https://dynasty-scans.com/pairings.json for all the directory indexes.
https://dynasty-scans.com/scanlators/dynasty_scans.json for all the specific directory pages.

Fixed. Dynasty is HTTPS-only now. Anyway also include
https://dynasty-scans.com/tags.json for all current tags

(I had to ask omn0 to add this.)

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

gwennie-chan posted:

Fixed. Dynasty is HTTPS-only now.

Hah, whoops. I didn't even notice that the links were still http. I just copy+pasted them out of a scrap file I use for miscellaneous notes and code snippets for the Thingifier.

Cinnabar-profile
joined Aug 3, 2015

Sweet, thanks. Unfortunate that there's no API for user defined lists, now that would be quite interesting to have.

By the way Alice, put in another PR that should stop the expanded menu from flashing on screen every time a page is loaded (I found it mildly infuriating :P).

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

cyricc posted:

By the way Alice, put in another PR that should stop the expanded menu from flashing on screen every time a page is loaded (I found it mildly infuriating :P).

Merged it. (I noticed the issue but it didn't bug me enough to bother fixing it, lol.) Also removed gwennie-chan's pending tags code. I'll be getting the OP updated with her script and replacing Greasemonkey with Tampermonkey for Firefox's install instructions.

Edit: OP updated now.

last edited at Oct 16, 2017 12:01AM

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

I redesigned the user id system and submitted a pull request for it.

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

gwennie-chan posted:

I redesigned the user id system and submitted a pull request for it.

I don't have time right now to give it a comprehensive look but I gave it a cursory look and it's fairly similar to an idea I had awhile back to replace the system that I hadn't gotten around to implementing yet. It relied on avatars though which would make it function on image pages as well. But to elaborate, this is the url for your avatar:

https://dynasty-scans.com/system/users_avatars/000/022/861/medium/face3.jpg
And this is the url for your posts:
https://dynasty-scans.com/forum/posts?user_id=22861

Note the numbers in the url for your avatar. 000/022/861 If you just remove the slashes from it then it can be used even without trimming the zeroes. (Example)

last edited at Oct 16, 2017 8:11AM

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

gwennie-chan posted:

I redesigned the user id system and submitted a pull request for it.

Gone through it a bit more thoroughly and there's one issue that needs to be fixed. Rather than incrementing the version in the header and the ver variable in the script itself you just added +gwendev to the version in the header for some reason. You should have incremented the version to 2.242 both in the header and the ver variable. Since the ver variable is setup for use for any migrations we might need to do for settings and it gets parsed as a float plus needs to match the header version they both need to be the same value and valid floating point variables.

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

Alice Cheshire posted:

gwennie-chan posted:

I redesigned the user id system and submitted a pull request for it.

Gone through it a bit more thoroughly and there's one issue that needs to be fixed. Rather than incrementing the version in the header and the ver variable in the script itself you just added +gwendev to the version in the header for some reason. You should have incremented the version to 2.242 both in the header and the ver variable. Since the ver variable is setup for use for any migrations we might need to do for settings and it gets parsed as a float plus needs to match the header version they both need to be the same value and valid floating point variables.

Fixed. Sorry it's a habit from Inkscape versioning methods.

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

gwennie-chan posted:

Fixed. Sorry it's a habit from Inkscape versioning methods.

Alright, got it merged now.

Cinnabar-profile
joined Aug 3, 2015

Forum tagger functionality for the Tagifier is not working for me. From what I can tell it seems to be an issue with callback chains running out of sequence (sortJSON() can run before mainJSON is loaded).

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

cyricc posted:

Forum tagger functionality for the Tagifier is not working for me. From what I can tell it seems to be an issue with callback chains running out of sequence (sortJSON() can run before mainJSON is loaded).

I'll work on it. However are you running on Chrome? That's probably the issue.

last edited at Oct 20, 2017 8:21PM

Cinnabar-profile
joined Aug 3, 2015

Both Chrome and FF for me. Try clearing the local storage if you're testing, I believe having the JSON cached may mask the error (without existing cache data, the error terminates the script before it has a chance to save it).

Here's the debugger right before it crashes:

And here's some console output at that point. As you can see, both GM_getValue and mainJSON are not initialized. The following error occurs when that line gets executed.

67351033_10220293459155029_8283322322757091328_n
joined Jul 22, 2015

cyricc posted:

Both Chrome and FF for me. Try clearing the local storage if you're testing, I believe having the JSON cached may mask the error (without existing cache data, the error terminates the script before it has a chance to save it).

Here's the debugger right before it crashes:

And here's some console output at that point. As you can see, both GM_getValue and mainJSON are not initialized. The following error occurs when that line gets executed.

Honestly this is confusing, because I specifically have it only execute sortjson() once the function containing pulljson() is completely done:

Alice Cheshire Moderator
Dynasty_misc015
joined Nov 7, 2014

gwennie-chan posted:

Honestly this is confusing, because I specifically have it only execute sortjson() once the function containing pulljson() is completely done:

This isn't an outright solution but I'd recommend against using stuff like $.when().done(). Stuff like that can easily result in code not actually executing when you'd expect it. It'd be best to use events or maybe even timers (setTimeout or setInterval depending on whether you need a one time deal or a repeating deal respectively) instead in my experience.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
https://developer.mozilla.org/en-US/docs/Web/Events
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval

To reply you must either login or sign up.