Coder Social home page Coder Social logo

tarot-api's Introduction

Tarot Api

Requests

GET / [run]

Returns an array of every card

GET /cards [run]

Returns an array of every card

GET /cards/[suit]/[rank] [run]

argument values required
suit one of: swords, wands, cups, coins, or major yes
rank one of: king, queen, 1-10 for swords/wands/cups/pentacles or 0-21 for major yes

Returns a single card in the form of

field type description
meanings hash
meanings["upright"] array of strings meanings for this card in the upright position
meanings["reversed"] array of strings meanings for this card in the reverse position
name string the name of the card written out in words
rank string or int rank of the card in the suit up to 21 for major arcana, king through 10 for all other suits
suit string major, wands, cups, swords, or pentacles
planet string planet associated with this card
signs array of strings astrological sign(s) associated with this card
element string element associated with this card

Example

GET /cards/swords/10

returns the following JSON
 {
    "name": "Ten of Swords",
    "rank": 10,
    "suit": "swords",
    "planet": null,
    "element": "air",
    "sign": [
       "gemini",
       "libra",
       "aquarius"
    ],
    "meanings": {
       "upright": [
          "failure",
          "defeat",
          "deep wounds",
          "loss",
          "crisis",
          "betrayal"
       ],
       "reversed": [
          "recovery",
          "rebirth",
          "moving on",
          "restoration"
       ]
    }
 }

GET /draw/[n] [run]

Returns n randomly selected cards

argument values required
n positive int yes

GET /find/[name] [run]

Returns the card by the specified name. Note that the numbers will be spelled out

argument values required
name string name of the card (eg: The Magician) yes

GET /suits [run]

Returns an array of all the suits of the tarot with key information

GET /suits/[suit]/cards [run]

Returns an array of all the cards in a given suit

argument values required
suit string name of the suit (eg: cups ) yes

GET /suits/[suit] [run]

argument values required
suit string name of the suit (eg: cups ) yes

Returns a single suit in the form of

field type description
name string the name of the tarot suit
element string the element associated with this tarot suit
direction string the cardinal direction associated with this tarot suit
season string the season associated with this tarot suit
time string the time of day associated with this tarot suit
signs array of strings astrological signs associated with this suit
keywords array of strings words associated with this suit

Testing

bundle exec rake test

Getting Started

bundle install
bundle exec rackup

Deploying

gcloud config set project tarot-api-316423 # set the correct project
gcloud app deploy                          # deploy the app
gcloud app logs tail -s default            # tail the logs to make sure things are gucci

๐Ÿฆ

Thanks

tarot-api's People

Contributors

dependabot[bot] avatar lindseyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ymow nattsukun

tarot-api's Issues

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.