Skip to content

Releases: octet-stream/dinky

0.7.1

06 Jul 16:23
Compare
Choose a tag to compare

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

23 Jun 19:03
Compare
Choose a tag to compare

Add

  • List class that brings /lists.json request using Lists#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 parameter

    import 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 moved Search#{ascending,descending}();
  • Improve documentation and tests;
  • Bump dependencies.

All changes: v0.6.0...v0.7.0

0.6.0

01 May 01:03
Compare
Choose a tag to compare

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 uploads

      import 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 of order={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

15 Apr 21:42
Compare
Choose a tag to compare

Update:

  • Improve documentation

0.5.0

15 Apr 21:35
Compare
Choose a tag to compare

Add:

  • New methods for Search handler:
    • Search#watched() – add my:watched parameter to the search request to receive only watched images
    • Search#faves() – add my:watched parameter to the search request to receive only faved images
    • Search#upvotes() – add my: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 and export statements). Formerly dinky was written for CommonJS 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

08 Apr 19:57
Compare
Choose a tag to compare

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

02 Apr 21:30
Compare
Choose a tag to compare

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

08 Feb 23:11
Compare
Choose a tag to compare

Update:

  • Use URLSearchParams to build query string in Query class.

All changes: v0.2.0...v0.2.1

0.2.0

07 Feb 22:28
Compare
Choose a tag to compare

Add:

  • Images#id method that allows to get an image by given ID
  • Search#{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

03 Feb 18:06
Compare
Choose a tag to compare

Minor fixes for docs.