Giter Club home page Giter Club logo

pfpet's Introduction

pfpet

A quick and easy way to apply filters to your friend's online avatars! Just place their username/id in the right route and voilà, you have their avatar being petted or bonked or what have you.

Current base URL: https://pfpet.herokuapp.com/

Endpoints

Note: The .gif extension in the URL is required because the Discord client will only render as a static image if there is no "extension".

URL Description
/d/{id}.gif Gets a Discord user's avatar and pets it
/d/bonk/{id}.gif Gets a Discord user's avatar and bonks it
/gh/{username}.gif Gets a GitHub user's avatar and pets it
/gh/bonk/{username}.gif Gets a GitHub user's avatar and bonks it
/ru/{username}.gif Gets a Reddit user's avatar and pets it
/ru/bonk/{username}.gif Gets a Reddit user's avatar and bonks it
/ga/{email}.gif Gets a Gravatar user's avatar and pets it
/ga/bonk/{email}.gif Gets a Gravatar user's avatar and bonks it

More endpoints will be added soon... You can help too!

Contributing

PRs adding new filters or image sources, or any other new features, are encouraged. Just fork this repository, make your changes, and open a pull request.

License

pfpet is licensed under version 3 of GNU Afferro General Public License, or at your option, any later version.

pfpet's People

Contributors

ariscript avatar rstar284 avatar rubyowo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pfpet's Issues

[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.

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?

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.