starmut / pfpet Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Affero General Public License v3.0
License: GNU Affero General Public License v3.0
Heroku's removing free dynos, which means pfpet will have to switch host to something else to continue working
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.