Giter Club home page Giter Club logo

pfpet's Issues

Twitter API support

I looked into the possibility of adding Twitter to the list of possible petting endpoints, but Twitter is quite increasingly hostile to webscraping, so that doesn't seem to be a possibility.

I could go do this kind of stuff through the Twitter API, but that requires me getting developer keys and then maintainer will be forced to make a developer account and then also require anyone hosting this to get devkeys aswell.... not fun.

What do you think about adding twitter support? What else could receive endpoint support?

[README IDEA] Userscript/bookmarklet for pets/bonks?

As the title says: maybe have a userscript on the readme (definition, a manager i use) or bookmarklet to automatically make pets or bonks?

Example userscript:

/* pfpet generator; tested on chrome, working as of today */
// ==UserScript==
// @name        Profile Pet Generator!
// @match       *://*/*
// @grant       none
// @version     0.1
// @author      someone
// @description A simple userscript to generate pet urls using dheerajpv's pfpet api!
// ==/UserScript==
(async function() {
    console.log("Petter loaded! Press `SHIFT` + `F2` to generate a pet!");

    let petGeneratorKeyHandler = async (e) => {
        let k = e.key;
        let out;
        let p;
        if (e.shiftKey && k == "F2") {
            p = prompt("Input the Discord userid to pet below: ");
            out = p === "null" ? "Invalid userid!" : `Copied the pet to your clipboard!`;
            try {
                setTimeout(async () => console.log(await navigator.clipboard.writeText(`https://pfpet.herokuapp.com/d/${p}.gif`)), 0);
            } catch (e) {
                return alert("Failed to copy it to your clipboard! Find your pet at", `https://pfpet.herokuapp.com/d/${p}.gif`)
            }
            return alert(out);
        }
    }

    document.addEventListener("keydown", petGeneratorKeyHandler, false);
})();

Example bookmarklet (minified with some online stuff, basically same code as userscript's petGeneratorKeyHandler):

javascript:!async function(){console.log("Petter loaded! Press `SHIFT` + `F2` to generate a pet!"),(async t=>{o=prompt("Input the Discord userid to pet below: "),e="null"===o?"Invalid userid!":"Copied the pet to your clipboard!";try{setTimeout((async()=>console.log(await navigator.clipboard.writeText(`https://pfpet.herokuapp.com/d/${o}.gif`))),0)}catch(t){return alert("Failed to copy it to your clipboard! Find your pet at",`https://pfpet.herokuapp.com/d/${o}.gif`)}alert(e)})()}();

These aren't API functionality obviously but they'd make getting pet urls easy, and including them on the readme might help people. "Just a click away" or whatever.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.