Giter Club home page Giter Club logo

ifttcat's Introduction

ifttcat

cat

API Documentation

Our extensible API is designed for the internet of things, but only where things are cats. We provide a number of API endpoints to empower cats via connections to a variety of feline services.

We provide API libraries for:

  • Cat++
  • Purrl
  • Catskell
  • Pascat
  • Objective Cat
  • KittyScript

Our RESTful architecture ensures all felids can nap without being restricted to a particular platform, scratching post, or bed.

AUTHENTICATION

We use a proprietary OAuth implementation that ultimately rests on you being accepted by the particular cat object with which you wish to interact. We recommend not being too eager โ€” make soft, gentle API calls until the cat trusts you. Completely ignoring the cat is the best way to ensure an valid HTTP response.

HTTP CALLS:

Fuck your standards, cats say. We've implemented a whole set of custom HTTP verbs designed to please our grimalkin overlords. For example:

  • PET /cat/:name?attempt_belly_rub=true&injury_waiver_token=ab53498eff90
  • FEED /cat/:name?amount=as_much_as_she_wants
  • LETOUT /cat:name?just_leave_the_door_open=true

FUNCTIONAL IMPLEMENTATION:

For spite, the Felid data constructor implements Monad, and details of its exact usage are hidden in a secret place in your basement.

instance Monad Felid where
  Felid cat >>= fc = fc $ none of your goddamned business.

FEEDING:

Cats are extremely finicky eaters and will refuse to compile unless their type inference system (veterinarians call it the "nose") can determine what exactly it is you're trying to shove into their IO.

PERSISTENCE:

Retrieval:

All cats are given the id of 1 by default, as none is willing to be anything other than first. It's your job as developers to figure out how to work around this.

cat = Cat.find(1) #=> every cat ever

Updates:

Cats can be updated or "saved" a total of 8 times. Saving a cat for the 9th time will kill it. You monster.

MOOD STATE MACHINE

Cats can exist in the following states:

  1. content: The cat has no complaints about its physical environment or wellbeing. This state automatically times out after 7 minutes, or upon any API request.
  2. indifferent: The default state. The cat will not care about being pinged by your server, and will either ignore or murder your packet.
  3. pissed: All API calls will incur an additional charge, which will be converted to paper currency for shredding.
  4. irate: The cat will frame you for running the Silk Road and murder-for-hire.

AVAILABLE CALLBACKS

  • on_purr
  • on_scratch
  • on_hate
  • on_shit_in_a_box

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.