Coder Social home page Coder Social logo

cardcast-api's Introduction

Unofficial Cardcast API

This is an unofficial API for searching/retrieving decks from cardcastgame.com.

Disclaimer: This library is not associated with Cardcast, but they are aware of it's existence. If you use this library, you should contact them to make sure they are okay with how you intend to use it.

Usage

This api is promise based, and is basically just a thing wrapper around rest calls. Start by creating an instance of the api library:

var CardcastAPI = require('cardcast-api');

var api = new CardcastAPI();

Easy, right?

api.search()

  • search - Text to search by. (This is equivalent to what you put in the search box on the website.)
  • Returns a PaginatedResult object, containing a list of matching deck summaries.

This is just a simple wrapper around the search on the website. It's just useful enough to get play codes, if you have an idea of what the name of the deck is.

If you want to get a complete list, simply don't pass in anything for search.

api.deck()

  • playCode - The play code of the deck you're looking to retrieve.
  • Returns a Deck object.

This retrieves a deck and then populates the Deck object. This object is basically a convenience wrapper that also wraps all cards in Card objects, which should eventually support things like formatting.

Example

If you want to see a complete example, check out /example/test.js

Status

The api is complete working, but as you can see I'm very light on documentation. I need to document the various objects that get returned, and then focus on improving the Card object.

Please, keep in mind, this is a project that has had minimal effort. I'm more than willing to keep going with this, but it is not even remotely my primary focus. OTOH, the api is simple, and should be relatively robust and easy to maintain. Feel free to file bugs, or make improvements.

cardcast-api's People

Contributors

morgul avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

cardcast-api's Issues

Add improved documentation

Currently, our ReadMe is the only documentation. This needs to be expanded, and if possible we need to automatically generate some API docs with jsdoc, and host them through GitHub pages.

Add unit tests

We need to add unit tests for the current api. The tests should be done in Mocha.

Support underscores in call segments

When constructing card objects, joining a call's text segments using an underscore introduces ambiguity when underscores are used in the segment text.

Underscores in call segments should be escaped or otherwise distinguished from blanks.

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.