Coder Social home page Coder Social logo

cc-workflows's Introduction

cc-workflows

Setup

Installation

First, install the node-canvas dependencies and then run

npm install

Run

Start up the server and go to http://localhost:3000

npm start

Examples

Here's a list of sample URLs for each of the sample workflows included:

workflows/image.json

workflows/twitter.json

workflows/uRL.json

Workflows

Workflows are stored under the data/workflows directory, which currently holds a few sample workflows for your consideration.

Accessing a workflow

Each workflow in the directory is executed by name via it's associated server URL:

image.json  ->  http://localhost:3000/w/image
test.json   ->  http://localhost:3000/w/twitter
test.json   ->  http://localhost:3000/w/url

Passing parameters

Parameters are passed in via the query string. For example, to pass a name parameter to the workflow, you would use a URL such as:

http://localhost:3000/v/image?name=Craig

If the workflow has a condition based around said parameter, the image may or may not change, depending on the workflow.

Output types

The server currently understands these different output types:

Images

Images are served by the server by streaming the image from the given url key valueto the users browsers in real-time.

{
    type: "image",
    url: "http://mydomain.com/image.jpg"
}
Dynamic image modification

The sever implements the Caman.js node module, which allows it to do dynamic image filtering based on a given set of parameters. For example, a vintage filter can be applied to any output image by specifying a vintage query parameter, like so:

http://localhost:3000/v/image?vintage
http://localhost:3000/v/image?name=Craig&vintage

Additionally, set properties like brightness and contrast can also be modified by specifying a value, like so:

http://localhost:3000/v/image?contrast=40
http://localhost:3000/v/image?contrast=10&brightness=30

A list of all available filters is available in the server/renderers/image file here

Twitter feeds

Twitter feeds are served by the server by producing a json file containing the top 10 tweets for a given username key value:

{
    type: "twitter",
    username: "commcorp"
}

URLs

URLs are served by the server by simply redirecting the user to the url key value:

{
    type: "url",
    url: "http://google.com"
}

cc-workflows's People

Contributors

craga89 avatar

Watchers

 avatar  avatar

Forkers

alfian878787

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.