Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

danbooru-style plugin #118

Open
wyrde opened this issue Jun 25, 2016 · 0 comments
Open

danbooru-style plugin #118

wyrde opened this issue Jun 25, 2016 · 0 comments

Comments

@wyrde
Copy link

wyrde commented Jun 25, 2016

Danbooru image boards have a handy "data-file-url" element in the "article" that includes the relative url of the image for that post. "Article" is also a container for the "a href".

Is there a way to get anticontainer to use the data-file-url? I've yet to figure out a way, but my understanding of regex and how AC functions is limited. (The thumbnail url's extension doesn't always match the image url.)

Notes:

  • The index page and the container page both have the data-file-url element.

  • data-id is used both in the index page and the container page to identify the post number

  • The danbooru style image boards I've found use "_blah_booru.ext/post/number" for post urls, so this should match them:

      ^http(?:[s]{0,1}):\/\/(?:\w+)booru\.(?:\w+)\/posts\/(\d+)
    

(and that reaches my limit on regex (: )

danbooru: https://danbooru.donmai.us/posts
Post format: https://danbooru.donmai.us/posts/2403447

Example "article"

<article itemscope itemtype="http://schema.org/ImageObject" id="post_2403447" class="post-preview post-status-has-parent" 
  data-id="2403447"
  data-has-sound="false"
  data-tags="1boy ahoge alpha_omega_nova belt blonde_hair bodysuit closed_eyes mt.somo multicolored_hair scar smile spoilers streaked_hair torn_clothes uchuu_patrol_luluco white_background yes-no_pillow"
  data-pools=""
  data-uploader="Zettamorose"
  data-approver-id=""
  data-rating="s"
  data-width="800"
  data-height="800"
  data-flags=""
  data-parent-id="2403445"
  data-has-children="false"
  data-score="0"
  data-views=""
  data-fav-count="0"
  data-pixiv-id="57589628"
  data-md5="069dc48e9e01b9c1636b0f320632b03e"
  data-file-ext="png"
  data-file-url=
      "/data/__alpha_omega_nova_uchuu_patrol_luluco_drawn_by_mt_somo__069dc48e9e01b9c1636b0f320632b03e.png"
  data-large-file-url=
      "/data/__alpha_omega_nova_uchuu_patrol_luluco_drawn_by_mt_somo__069dc48e9e01b9c1636b0f320632b03e.png"
  data-preview-file-url=
      "/data/preview/069dc48e9e01b9c1636b0f320632b03e.jpg"
  >
  <a href="/posts/2403447"><img itemprop="thumbnailUrl" src="/data/preview/069dc48e9e01b9c1636b0f320632b03e.jpg" alt="1boy ahoge alpha_omega_nova belt blonde_hair bodysuit closed_eyes mt.somo multicolored_hair scar smile spoilers streaked_hair torn_clothes uchuu_patrol_luluco white_background yes-no_pillow">
  </a>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant