1. Hey Guest, welcome back to DLP

    As you can see, we've changed our look. We've migrated from vBulletin to the Xenforo forum system. There may be issues or missing functionality, if you find anything or have feedback, please check out the new Xenforo Migration Feedback forum.

    Our dark ("Dark Lord Potter") theme is under heavy development. We also have a light ("Light Lord Potter") theme for those happier with a light background and darker text.

    Dismiss Notice
Dismiss Notice
Hey Guest! Are you any good at cooking? Got a favourite recipe that you love to cook or bring out to impress that special someone? Why not share it! A new forum called The Burrow has opened and it's all about homemaking!

Filter FFN author favorites by category

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

  1. draykfyre

    draykfyre First Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    41
    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. NuitTombee

    NuitTombee Supreme Mugwump

    Joined:
    Feb 14, 2010
    Messages:
    1,762
    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 First Year DLP Supporter

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

    NuitTombee Supreme Mugwump

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

    draykfyre First Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    41
    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. NuitTombee

    NuitTombee Supreme Mugwump

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

    draykfyre First Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    41
    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 Chief Warlock DLP Supporter

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

    draykfyre First Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    41
    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:
    4,172
    Gender:
    Female
    Location:
    Silesia
    Works like a charm, thanks! :)
     
  11. draykfyre

    draykfyre First Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    41
    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 Minister of Magic

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

    NuitTombee Supreme Mugwump

    Joined:
    Feb 14, 2010
    Messages:
    1,762
    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 First Year DLP Supporter

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

    draykfyre First Year DLP Supporter

    Joined:
    Sep 13, 2011
    Messages:
    41
    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.