Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.67 KB

README.md

File metadata and controls

62 lines (44 loc) · 1.67 KB

Pastemyst.java

What is pastemyst.java?

pastemyst.java is a pastemyst API Wrapper, written in Java. The library is in early development, and all contributions are welcome.

Check out pastemyst here: paste.myst.rs

Examples

Get the language by name and extension

import io.github.yeffycodegit.pastemystjava.lib.Pastemyst;
import io.github.yeffycodegit.pastemystjava.types.Language;

import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        Pastemyst pastemyst = new Pastemyst();

        Language langByName = pastemyst.data.getLangByName("Python");
        Language langByExt = pastemyst.data.getLangByExtension("py");
    }
}

Get when the paste should expire

import io.github.yeffycodegit.pastemystjava.lib.Pastemyst;

public class Main {
    public static void main(String[] args) {
        Pastemyst pastemyst = new Pastemyst();

        System.out.println(pastemyst.time.whenPasteShouldExpire("1588441258", "1w"));
    }
}

Get a user on pastemyst/if a user exists on pastemyst

import io.github.yeffycodegit.pastemystjava.lib.Pastemyst;
import io.github.yeffycodegit.pastemystjava.types.User;

import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        Pastemyst pastemyst = new Pastemyst();

        User user = pastemyst.user.getUser("YeffyCodeGit");
        boolean exists = pastemyst.user.getIfUserExists("CodeMyst");
    }
}