track

konakona.moe

konakona.png konata.gif autism.png drew.png panzergranate.gif debian-powered.gif hugo.png touhou.gif monero-now.gif wiby.gif notepad-fulvio.gif svenbutton.gif ls.jpg
Index Posts Photos Guestbook About Gitea↗ DMCA↗ 

shimmie2-js - javascript scrapper for Shimmie 2


Introduction

I wrote this piece of garbage library because the amazing people at shimmie don’t have an API, and I wanted to scrape soyjaks from the soybooru, which uses shimmie. It has worked for the past 6 months however these imbeciles added hCaptcha meaning that my scraper simply won’t work anymore. It will work on other instances though. Right now there is only one method because the bot that I used this library on only had basic functions to scrape and I didn’t want to complex things and I don’t have the motivation to make more methods.

Working on this was kinda fun but extremely annoying sometimes because of the amount of “edge cases” that shimmie2 has, for example, if every tag you put only gives you a result, instead of showing it in a list it will drop you into the post itself, neat, but annoying.

This scrapper is not the most efficient because I wanted to make sure it will never fail, or having the results not be optimal in some way.

Wait no, apparently shimmie2 has a GraphQL API but I couldn’t find anything about it sooo, I don’t know, honestly.

Sauce

https://git.konakona.moe/diowo/shimmie2-js
Thumbnail gitea | konakona.moe
shimmie2-js

Shimmie2-js is a library to scrape Shimmie2 instances.

README.md

shimmie2-js

Interact with Shimmie2 instances!

Tested on shimmie.shishnet.org and booru.soy.

Shimmie2 doesn’t have an API so I had to scrape the HTML, otherwise I would probably never have created this. Below are some examples.

Example

 1const Shimmie2js = require('./index.js')
 2
 3const Shimmie2 = new Shimmie2js('https://booru.soy')
 4// const Shimmie2 = new Shimmie2js('https://shimmie.shishnet.org')
 5
 6async function search(tags) {
 7    try {
 8        query = await Shimmie2.search(tags)
 9        console.log(query)
10    } catch (error) {
11        console.error(error)
12    }
13}
14
15search(tags = ['anime'])

License

MIT



Prev:
konakona.moe - this website
Next:
emailwizard - OpenBSD Email Wizard

Back to... Posts | Section

Created on: Monday, 15 April 2024