Releases: octet-stream/dinky
0.7.1
Update
-
Search#random()
requests now applies the*
wildcard when no tags has been set:import dinky from "dinky.js" // This following request will search for any random image: // https://derpibooru.org/search.json?q=*&random_image=true dinky().search().random() .then(console.log)
All changes: v0.7.0...v0.7.1
0.7.0
Add
-
List class that brings
/lists.json
request usingLists#last()
method. It also have some shortcuts for Search requests such as:Lists#topScoring()
– Creates a Search request that gets top scoring images of last 3 days;Lists#topScoringAllTime()
– Creates a Search request that gets top scoring images of the all time;Lists#topCommented()
– Creates a Search request that gets top commented images of last 3 days;
-
Search#uploadedBy()
method that allows to get images uploaded be given user. Takes a username as the search parameterimport dinky from "dinky.js" dinky().search().uploadedBy("vedont") .then(console.log) .catch(console.error)
-
Dinky#lists()
methods to create a Lists instance and search for some images categories:import dinky from "dinky" dinky().lists().last("4w") .then(console.log) .catch(console.error)
Update
Request#{ascending,descending}()
methods are deprecated since this release, brcause they doesn't seems to work for/images.json
. They has been movedSearch#{ascending,descending}()
;- Improve documentation and tests;
- Bump dependencies.
All changes: v0.6.0...v0.7.0
0.6.0
Add
- Node 12 is now supported;
- New methods for Search class:
-
Search#downvotes()
– allows to search for images downvoted by a user (requires a key to identify the user)import dinky from "dinky.js" // You will get all downvotes for user whose key was used // https://derpibooru.org/search.json?q=my:downvotes dinky({key: "yourkeyhere"}).search().downvotes() .then(console.log) // You can also filter results by tags: dinky({key: "yourkeyhere"}).search("oc:nyx").downvotes() .then(console.log)
-
Search#uploads()
– allows to search for the user's uploadsimport dinky from "dinky.js" // Works as well as the previous method // https://derpibooru.org/search.json?q=my:uploads dinky({key: "yourkeyhere"}).search().uploads() .then(console.log)
-
Search#favedBy(user: string)
– Allows to search for images faved by given user. Takes account name of the user (e. g. username).import dinky from "dinky.js" // Works as well as the previous method // https://derpibooru.org/search.json?q=pinkie+pie,safe,faved_by:octetstream dinky().search(["pinkie pie", "safe"]).favedBy("octetstream") .then(console.log)
-
Update
- Improve development environment: add
eslint-plugin-markdown
that allows to lint JavaScript code in Markdown files; - Fix ordering for Search class since Derpibooru uses different parameters for that: It uses
sd={asc | desc}
instead oforder={a | d}
; - Improve link helper;
- Update dependencies.
Remove
- The
url
option is not longer supported. All requests will use derpibooru.org domain.
All changes v0.5.1...v0.6.0
0.5.1
Update:
- Improve documentation
0.5.0
Add:
- New methods for Search handler:
Search#watched()
– addmy:watched
parameter to the search request to receive only watched imagesSearch#faves()
– addmy:watched
parameter to the search request to receive only faved imagesSearch#upvotes()
– addmy:upvotes
parameter to the search request to receive only upvoted images
Note that all of those methods require a key that can be found on your account page.
- Native ES modules support (see:
import
andexport
statements). Formerly dinky was written forCommonJS
modules and this release brings native support of an ECMAScript modules, it allows you to use named import of dinky like so:
import {dinky, NetworkError} from "dinky.js"
or just use default export:
import dinky from "dinky.js"
Note that currently Node.js require the --experimental-modules
flag to run this code.
- For non 2xx response the
NetworkError
error will be thrown.
Update:
- Improvements for docs.
All changes: v0.4.0...v0.5.0
0.4.0
Add:
- Allow to set per-request options from
Request#exec()
method (on child classes):
import dinky from "dinky.js"
// Will use "Maximum Spoilers" instead of "Default" because per-request
// options have priority over the initial one.
dinky({filter: 100073}).images().exec({filter: 37430}).then(console.log)
Update:
- Bunch fixes and improvements for link utility
- Improve tests
All changes: v0.3.0...v0.4.0
0.3.0
Add:
- Drop Node 9 support because of AVA requirements.
- Allow
Search#tags()
method to take multiple arrays and/or strings:
import dinky from "dinky.js"
dinky().search("scootaloo", "princess luna", "safe")
.then(console.log)
// ...or...
dinky().search(["scootaloo"], ["princess luna"], ["safe"])
.then(console.log)
// ...or...
dinky().search(["scootaloo", "princess luna"], ["safe"])
.then(console.log)
// All of these examples are equivalent.
Update:
- Improvements for documentation
- Bump dependencies
All changes: v0.2.1...v0.3.0
0.2.1
0.2.0
Add:
Images#id
method that allows to get an image by given IDSearch#{min,max}Score
methods that allows to set images filtering by rating
Update:
- Bump deps
- Improve documentation
- Bunch fixes here and there
All changes: d6c7a68...cc7efe1
0.1.2
Minor fixes for docs.