Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including yiff-rocks with all npm packages installed. Try it out:

var yiffRocks = require("yiff-rocks")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

yiff-rocks v1.0.0

A module for the yiff.rocks url shortener.

Yiff-Rocks

A module for the yiff.rocks url shortener.

This module is used for shortening urls using yiff.rocks.

How To Use:

const YiffRocks = require("yiff-rocks");

// Shorten URL
// see "Result of all functions" for result
// This one should *not* throw an error under normal circumstances
// Warning: Image is NSFW
// This function can take between 1 and 3 parameters
// 1 - URL
// 2 - Credit (You can provide your name here for it to be tracked that you created the short url)// 3 - Code (Override the random generated code, will throw an error if it's already used)

YiffRocks.create(
    "https://yiff.media/V2/furry/yiff/gay/2c9249179940a575c45d9835f0d5affe.jpg" // URL
);
YiffRocks.create(
    "https://yiff.media/V2/furry/yiff/gay/2c9249179940a575c45d9835f0d5affe.jpg", // URL
    "Someone" // Credit
);
YiffRocks.create(
    "https://yiff.media/V2/furry/yiff/gay/2c9249179940a575c45d9835f0d5affe.jpg", // URL
    "Someone", // Credit
    "OwOWhatsThis" // Code
    );

// Get Info By URL
// see "Result of all functions" for result
// This one should *not* throw an error under normal circumstances
// Warning: Image is NSFW
// this function takes 1 parameter
// 1 - URL
YiffRocks.create(
    "https://yiff.media/V2/furry/yiff/gay/2c9249179940a575c45d9835f0d5affe.jpg"
);

// Get Info By Code
// see "Result of all functions" for result
// This one will throw an error if the code is not used
// this function takes 1 parameter
// 1 - Code
YiffRocks.create(
    "OwOWhatsThis"
);

Result of all functions:

If you don't know how to read typescript, just pretend it's an object with all of those properties.

export interface Result {
    /**
     * The code of this short url.
     * @type {string}
     * @memberof Result
     */
    code: string;
    /**
     * The time this short url was created at.
     * @type {string}
     * @memberof Result
     */
    createdAt: string;
    /**
     * The url this short url leads to.
     * @type {string}
     * @memberof Result
     */
    url: string;
    /**
     * The position of this short url in creation order.
     * @type {number}
     * @memberof Result
     */
    pos: number;
    /**
     * The credit for creating this short url.
     * @type {string}
     * @memberof Result
     */
    credit: string;
    /**
     * The url this short url should be visited at.
     * @type {string}
     * @memberof Result
     */
    fullURL: string;
}
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free