1. DLP Flash Christmas Competition + Writing Marathon 2024!

    Competition topic: Magical New Year!

    Marathon goal? Crank out words!

    Check the marathon thread or competition thread for details.

    Dismiss Notice
  2. Hi there, Guest

    Only registered users can really experience what DLP has to offer. Many forums are only accessible if you have an account. Why don't you register?
    Dismiss Notice
  3. Introducing for your Perusing Pleasure

    New Thread Thursday
    +
    Shit Post Sunday

    READ ME
    Dismiss Notice

Filter FFN author favorites by category

Discussion in 'General Discussion' started by draykfyre, Apr 15, 2017.

  1. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    Howdy all, figured I'd share this little script I made today. It allows you to filter an author's favorites by fandom, so you can filter by fandom and then sort by reviews/words/etc instead of only being able to sort every fic from every fandom. I figured enough people probably use author favorites to find new fics, so maybe other people would like to have it too.

    Right now crossovers show up in the list by themselves, although I may eventually add a checkbox to include crossovers in the filtered fandom results.

    You should be able to add it in greasemonkey(firefox) or tampermonkey(chrome).

    Installation instructions:

    1. Install the Greasemonkey or Tampermonkey extension
    2. Go here and click the raw button. Greasemonkey or Tampermonkey will prompt you to install the script. Click the install button and you're good to go.



    EDIT: The forum appears to have turned the name and namespace into mentions inside the code section. And nicely turned the urls into links with ellipses in them. I've replaced them with gists.

    EDIT 2: Apparently there was no need for two versions - for me at least they both work just fine in chrome. This is my first greasemonkey/tampermonkey script, so I thought for whatever reason I'd need two versions. I'm going to stop making any modifications (if I choose to make any more at all) to the chrome version and only update the (formerly)firefox version. It's been renamed to reflect that, and I did update the update/download urls in the chrome version, so checking for updates should find the maintained one eventually instead of the chrome version.

    Script:
    https://gist.github.com/dspencer001/53d29af1d1187498167f87ce5ccb200e
     

    Attached Files:

    Last edited: Apr 22, 2017
  2. Nuit

    Nuit Dark Lord

    Joined:
    Feb 14, 2010
    Messages:
    1,934
    Location:
    The Peach State
    The require is truncated and it causes a bit of a problems with copy/pasting.

    Edit: The script, Firefox, doesn't seem to be working for me. The drop-down doesn't show.

    Edit2: Nevermind, I was thinking it's show for their stories too instead of just their favorites.
     
    Last edited: Apr 15, 2017
  3. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    The forum kindly replace the @ name with a mention, and truncated the urls. I've replaced the code sections with gists.
     
  4. Nuit

    Nuit Dark Lord

    Joined:
    Feb 14, 2010
    Messages:
    1,934
    Location:
    The Peach State
  5. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    Cool. I've added those to the gists as well.

    EDIT: I also just added it showing up on the author stories page as well.
    EDIT2: It now works if there isn't a favorites page at all as well.
     
    Last edited: Apr 15, 2017
  6. Nuit

    Nuit Dark Lord

    Joined:
    Feb 14, 2010
    Messages:
    1,934
    Location:
    The Peach State
  7. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    Thanks! I've added the update urls to the gists. I think after raw in the urls was a commit hash, or whatever gists have for the equivalent of commits. Removing that seems to work though.
     
  8. Download

    Download Auror ~ Prestige ~ DLP Supporter

    Joined:
    Aug 6, 2014
    Messages:
    640
    Location:
    Adelaide, Australia
    High Score:
    1918
    I thought the mention system only worked if you put @ before the name.
     
  9. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    Before when I had the scripts in code tags, there was metadata that had an @ symbol and then a name, i.e
    Code:
    //  [USER=54264]Download[/USER]Url [url]http://example.com[/url]
    The forum turned those into mentions.

    edit: See? That wasn't deliberate by the way, but worked out to be an excellent example
     
  10. Andrela

    Andrela Plot Bunny DLP Supporter

    Joined:
    Apr 19, 2012
    Messages:
    5,048
    Gender:
    Female
    Location:
    Silesia
    Works like a charm, thanks! :)
     
  11. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    I went ahead and fixed the fandom filtering wrongly weirdness after I realized that filtering by Final Fantasy VII would also include results for Final Fantasy VIII. It now will only show stories for the exact fandom you select. This does mean that crossovers for a fandom won't show up if you filter by the fandom, you have to specifically select which crossover you want in order to see them. I might add a checkbox eventually to include crossovers when filtering.

    I also removed the chrome version from the OP after I realized I didn't actually need two versions. It's still on my github as a gist, but the update urls have been changed to point to the other gist.
     
  12. Hawkin

    Hawkin Chief Warlock

    Joined:
    Apr 20, 2011
    Messages:
    1,453
    Location:
    QC, Canada
    So how does one go about installing this nifty thing?
     
  13. Nuit

    Nuit Dark Lord

    Joined:
    Feb 14, 2010
    Messages:
    1,934
    Location:
    The Peach State
    Have Tampermonkey / Greasmonkey then go to the link in the op and click Raw in the top right of the code. It should have a pop-up prompt that you can choose install from.
     
    Last edited: Apr 22, 2017
  14. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    Thanks, I probably should have had instructions in the OP from the beginning.
     
  15. draykfyre

    draykfyre Second Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    54
    At some point FFN changed how they sort their stories, which broke sorting after having selected a fandom in some cases. I've fixed that in an update.

    As a side note, this got a bit more fragile as I now have to deal with how FFN sorts in my code, whereas before it just worked without me having to touch it. So if they change that again this will probably break again.
     
Loading...