Coder Social home page Coder Social logo

kudos's Introduction

Kudos

This is a small script that allows you to create arbitrary works that people can leave kudos on by clicking a link. Each work allows one kudos per IP address. You also get a url for each work to display the number of kudos that have been left as an image, which is easily include-able most places. You can use it on your writing! You can use it for scripts like this! You can do WHATEVER YOU WANT ✨

How To

Basically, you can drop this onto a php-enabled webserver and have it Just Work, with one caveat. You have to have ImageMagick installed along with the php Imagick extension, and also make sure you have the Sqlite3 extension installed. This means you'll need a web host where you have admin access, or where you can get someone who has that access to install packages for you. DigitalOcean will get you that hosting for $4 a month if you so choose—it'll run on the smallest specs they have.

(It's totally reasonable to also share one of these instances with a group of friends.)

Assuming you're on an Ubuntu box, this should do it:

sudo apt-get install -y libmagickwand-dev 
sudo apt-get install -y imagemagick
pecl install imagick

sudo apt-get install -y libsqlite3-0 libsqlite3-dev php-sqlite3

If it says to enable any modules for your web server, use the provided commands. Then, reload your web server to load all the new extensions.

Using This Thing

The first thing you'll want to do is go to [web root]/kudos.php?addwork and, well, add some work IDs. These are arbitrary strings, so you can do numbers, or abbreviations, or whole-ass sentences, though they will get sanitized to prevent someone messing with your database. Once you submit the form, it'll give you a pair of links: one for people to visit to give kudos, and the other to an image that displays the number of kudos.

When you're linking to the /kudos?give=[id] link, you may want to add the target="_blank" attribute to the link so it opens in a new window and doesn't navigate people away from the page!

Customizing

There are some customizable settings in config.php! You don't need to edit them to have it work, but you might want to. You can change the font by dropping additional font files into your install and changing the file in the text settings.

If you like, you can also change the look and feel of the interface by editing the html in template.php and the css in style.css. Just don't touch the line that says <?= $content; ?> since that prints the page content.

Licensing, Modification, Etc

This is free! I may or may not make updates in the future to improve it and add functionality, but I wanted to make it as simple as possible so that the maximum number of people could use it easily. People are also welcome to fork it and adapt the code for their own purposes; no credit is required.

kudos's People

Contributors

cmho avatar

Stargazers

Billy Wilcosky avatar Rae Knowler avatar CMDonovann avatar  avatar

Watchers

 avatar

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.