ArmindoFlores / ao3_api

An unofficial archiveofourown.org (AO3) API for python
MIT License
175 stars 64 forks source link

Add recommended status to returned bookmarks #80

Closed williln closed 2 years ago

williln commented 2 years ago

Returns whether the user has "recommended" the bookmark.

I wound up subclassing Session so I could override _load_bookmarks() and get this info myself, so I though I would submit a PR in case this was something you wanted to add. I'm working on a better way to manage my TBRs and fics I've read, so getting some facsimile of the "read" status was helpful for me.

Example of the UI for a "recommended" bookmark -- note the little heart: Screen Shot 2022-10-24 at 12 19 53 PM

And the HTML:

    <p class="status" title="702 Bookmarks">
       <a class="help symbol question modal" title="Bookmark symbols key" aria-controls="#modal" href="/help/bookmark-symbols-key.html">
        <!-- This is the line we are looking at -->
        <span class="rec" title="Rec"><span class="text">Rec</span></span>
      </a>
      <span class="count"><a href="/works/33285814/bookmarks">*</a></span>
    </p>

Here is the UI for a bookmark that doesn't have "recommended" selected: Screen Shot 2022-10-24 at 12 20 00 PM

And the HTML for that as well:

    <p class="status" title="3490 Bookmarks">
       <a class="help symbol question modal" title="Bookmark symbols key" aria-controls="#modal" href="/help/bookmark-symbols-key.html">
        <!-- This is the line we are looking at -->
        <span class="public" title="Public Bookmark"><span class="text">Public Bookmark</span></span>
      </a>
      <span class="count"><a href="/works/13625910/bookmarks">*</a></span>
    </p>