Code Monkey home page Code Monkey logo

qson's Introduction

qson

Reads QR codes that have a URL in them, and expects a JSON response formatted like this example:

{
    data: {
        ImageKey: {
            type: "picture",
            data: "base64 encoded image string",
            subdata: "jpeg"
        },
        HeaderKey: {
            type: "text",
            data: "Some Person",
            subdata: "Some Subdued Text"
        },
        AvatarKey: {
            type: "picture"
            data: "base64 encoded image string",
            subdata: "png"
        },
        ActionKey: {
            type: "action",
            subtype: "call",
            data: "Call Person",
            subdata: "1234567890"
        },
        TextKey: {
            type: "text",
            data: "Person Name",
            subdata: "Person Date of Birth"
        },
        TitleKey: {
            type: "text",
            data: "List Title"
        }
    },

    display: [
        {
            cardType: "glance",
            image: "ImageKey",
            header: "HeaderKey",
            avatar: "AvatarKey",
            footerActions: [
                "ActionKey"
            ],
            footerTexts: [
                "TextKey"
            ]
        },
        {
            cardType: "list",
            title: "TitleKey",
            data: [
                "LiteralString",
                "LiteralString2"
            ]
        }
    ]
}

Data Objects

Data Objects (eg, those in data) have this general format:

{
    type (required)
    subtype
    data (required)
    subdata
}
  • type is one of picture, text, action, or list.

  • subtype currently only applies to action, and it can be email or call. The contact information is stored in subdata.

  • data and subdata are arbitrary strings. subdata only currently applies to text, action, and picture. For text it is some subdued text shown beneath. For picture it is the image type (ie, png, or jpeg). action is described above.

Card Objects

Card Objects (eg, those in display) vary in format based on the card type. Currently, there are two card types: glance and list.

glance follows this format:

{
    cardType (required)
    image
    header
    avatar
    footerActions
    footerTexts
}
  • cardType is "glance".
  • image is a key to a Data Object (with the type picture).
  • header is a key to a Data Object (with the type text).
  • avatar is a key to a Data Object (with the type picture).
  • footerActions is an array of keys to Data Objects (with the type action).
  • footerTexts is an array of keys to Data Objects (with the type text).

list follows this format:

{
    cardType (required)
    title
    data
}
  • cardType is "list".
  • title is an arbitrary string.
  • data is a key to a Data Object (with the type list).

qson's People

Contributors

seiyria avatar

Watchers

 avatar James Cloos avatar  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.