GithubHelp home page GithubHelp logo

lolcat-as-a-service's Introduction

Lolcat-as-a-Service (LaaS)

An API to lolcat (and figlet, cowsay etc. coming soon!) your text.

Source code Hoster Example request

Backstory: A friend and I were talking about how a lot of older stuff is re-sold as an EaaS and how ridiculous it is that M$ says that Windows 365 (basically a Windows PC in M$'s cloud) "enables a variety of new scenarios for the new world of work", even though VM's in the Cloud for personal usage have been around for a while. I jokingly said that we need Lolcat-as-a-service, and then I said, "screw it, I'm making this a thing". And here we are.

Note for cURL users: Use https://laas.cf instead of https://LaaS.cf when using cURL because Deta, the provider that hosts this service for free doesn't recognize uppercase URL's and cURL sends the domain in uppercase if you type it in uppercase, unlike browsers like Chrome.

APIs

Lolcat

Query parameters: (?)

Parameter Required Type Effect Default
spread No float Inclination of the rainbow stripes (character widths per line height. High values (>1000) give almost horizontal stripes, low values (0.1) almost vertical ones) 8.0
freq No float Frequency of the rainbow (low values around 0.0001 give almost monochrome screens) 0.3
html No boolean Use HTML tags instead of ANSI escape codes false
text GET only string Text to lolcat POST body

Special query param syntax

You can request GET /lolcat?[text] with no other query params to emulate a POST request with the body set to [text].

Endpoint: POST /

Alias for /lolcat. Use this endpoint with a text post body to lolcat the text. Example:

curl -d "$(fortune)" https://laas.cf  

Endpoint: POST/GET /lolcat

Use this endpoint with a text post body or the text parameter to lolcat the text. Example:

curl -d "$(fortune)" https://laas.cf/lolcat # or  
curl "https://laas.cf/lolcat/\?text=$(fortune | urlencode)"  

FIGlet

Query parameters: (?)

Parameter Required Type Effect Default
font No string The FIGlet font to use (see Fonts) Standard
horizontalLayout, verticalLayout No string The horizontal / vertical layout to use. Possible values:
  • default: Does the kerning the way the font designer intended
  • full: Uses full letter spacing
  • fitted: Moves the letters together until they almost touch
  • controlled smushing & universal smushing: Common FIGlet kerning setups
default
width No number Limit the width of the output. For example, if you want your output to be a max of 80 characters wide, you would set this option to 80. -
whitespaceBreak No boolean Works in conjunction with width, will attempt to break text up on whitespace when limiting the width. false

Special query param syntax /!\ NOT YET IMPLEMENTED

You can request GET /figlet?[text] with no other query params to emulate a POST request with the body set to [text].

Fonts

You can use every font from FIGlet.org. You can go to the Font examples or to the Font database.

Endpoint: POST/GET /figlet /!\ NOT YET IMPLEMENTED

Use this endpoint with a text post body or the text parameter to lolcat the text. Example:

curl -d "$(fortune)" https://laas.cf/figlet # or  
curl "https://laas.cf/figlet/\?text=$(fortune | urlencode)"  

FAQ

What are Query parameters?

  • Query parameters are how you send key-value pairs in a URL. They are structured like this: ?key=value or ?key=value&second_key=second_value.
  • You just append them after the path like this: https://laas.cf/lolcat/?text=Hello.
  • You might have to escape ? and & when using your command-line like this: ?key=value&second_key=second_value.
  • You need to encode special characters that aren't @, *, _, +, -, . or /. Most browsers do that automatically, but you need a tool to encode it in the command like urlencode, but you can use a POST with cURL if you don't want to encode stuff.

lolcat-as-a-service's People

Contributors

lxhom avatar

Stargazers

 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.