Git Product home page Git Product logo

duckiesays's Introduction

DUCKIESAYS REST API

Synopsis

DUCKIESAYS RESTful service API.

Code Example

REST services of the form:

GET /api/vN/duckie/:sayId

Motivation

Provides basic REST services API.

Installation

To create database and schema: db> ./create_db.sh

To populate test data db> psql -U postgres duckiedb < create_test_data.dmp

API Reference

GET:

duckie

Tests

Mocha test examples live in the test directory

Contributors

License

MIT

duckiesays's People

Contributors

cadeon avatar mpeter88 avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

phishen

duckiesays's Issues

Links don't generate preview on Facebook

See image for an example. Links shared from xkcd create a visually appealing preview image. Content you are sharing is easily seen without others having to clink on the link. The result could potentially be more people sharing links instead of screen shot and stealing.
screen shot 2017-05-04 at 8 28 45 am

Duckie dies sometimes

  • Put Duckie in a process monitor

  • Change the default 503 page in nginx to show a "dead Duckie"

Console mode Duckie

"cowsay" exists for terminal users:

caduffy@Dr-Link-Talbot ~ $ fortune | cowsay


/ Now there's three things you can do in
| a baseball game: you can win or you can |
| lose or it can rain. |
| |
\ -- Casey Stengel /

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

caduffy@Dr-Link-Talbot ~ $

Develop "duckiesay" that accepts piped input and displays a traditional ascii interpretation of a Duckiesays page. If input is not available to duckiesay, have it make an api request to get a quote.

Can't live update the db

"adding ducks" requires adding the quote to create_db.dmp, stopping node, running create_db.sh to replace the sqlite db, and restarting node. There's currently no easy way to update the database while node is running to add ducks without a server restart.

Running create_db.sh while node is running does generate a new sqlite db, but the new DB isn't used because it's not the one loaded in memory.

The downtime is short, but the downtime should be non-existent.

The right answer is to create some kind of 'update_db.sh' which will create or connect to and update an existing db.

Duck Personas

Duckie should have multiple personas, not just the programming / design vertical duck speaks about now.

e.g. "Dark Duck" could give bad or vengeful advice, coupled with a different color palette. A child-focused duckie could give advice for children such as "Be nice to people" and "Do your chores" and perhaps even read these sayings aloud.

One way to implement this would be with subdomains, e.g. https://dark.duckiesays.com or https://little.duckiesays.com and even https://racing.duckiesays.com

Selectable Duck Preference

Multiple duck graphics should be available for a user to choose which duck they would like to talk to. --Beth

Persona: fortune.duckiesays.com

Need a new Duckie that is a fortune teller. Basically, this would be the same Duckie graphic we have now, but with a basic clipart fortune teller outfit.

Instead of using a database of curated quotes, fortune Duckie would simply run the unix "fortune" command - https://en.wikipedia.org/wiki/Fortune_(Unix) ("brew install fortune" on macOS)

and pipe the output to the web browser.

Fortunes are not indexed, so there will be no way to capture and share a particular fortune. It will be a random event every time the page is hit.

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.