quotee

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2015 License: MIT Imports: 9 Imported by: 0

README

quotee

Build Status Coverage Status

Quotee is a simple web app using Martini + angularJS. Show quotes from a variety of sources.

Usage

Quotee is intended for use with a high-definition media panel. With that in mind, the quotee front-end is designed to be simple and elegant. You can see an example at https://quotee.herokuapp.com/.

The front-end also takes a few parameters:

Sources

Quotee exposes an extremely simple REST API and can pull quotes from a variety of sources. To get a quote from a random source, you can use:

GET /api/quote/

Each source is exposed via its name on the api

GET /api/quote/{sourceName}

Quotes are returned as simply as possible:

{ 
    "body" : "body of quote",
    "author" : "author of quote"
}

Any source can also render a quote as xml - just add .xml to the path

GET /api/quote.xml

<result>
    <Quote>
    <body>Body of Quote</body>
    <author>Author of Quote</author>
    </Quote>
</result>

By default, Quotee comes with 3 standard sources:

  • File: Loads quotes from a csv file in the form of body,author
  • QuoteDB: Returns quotes from quotedb.com
  • TheySaidSo: Returns quotes from the theysaidso.com Quote of the Day, using a specified set of categories.
Adding New Sources

Adding new sources is easy. A source must implement the QuoteSource interface

type QuoteSource interface {
    GetQuote() (Quote, error)
}

See models/fileSource.go for an example

Once you've implemented a new source, add it to the source map in server.go

sourceMap["mynewsource"] = MyNewSource{}

The source will be added to the list of sources when using the /api/quote endpoint. It will also be available directly at /api/quote/mynewsource.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/inject
Package inject provides utilities for mapping and injecting dependencies in various ways.
Package inject provides utilities for mapping and injecting dependencies in various ways.
_workspace/src/github.com/go-martini/martini
Package martini is a powerful package for quickly writing modular web applications/services in Golang.
Package martini is a powerful package for quickly writing modular web applications/services in Golang.
_workspace/src/github.com/onsi/ginkgo
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
_workspace/src/github.com/onsi/ginkgo/config
Ginkgo accepts a number of configuration options.
Ginkgo accepts a number of configuration options.
_workspace/src/github.com/onsi/ginkgo/ginkgo
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
_workspace/src/github.com/onsi/ginkgo/internal/remote
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
_workspace/src/github.com/onsi/ginkgo/reporters
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
_workspace/src/github.com/onsi/gomega
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
_workspace/src/github.com/onsi/gomega/format
Gomega's format package pretty-prints objects.
Gomega's format package pretty-prints objects.
_workspace/src/github.com/onsi/gomega/gbytes
Package gbytes provides a buffer that supports incrementally detecting input.
Package gbytes provides a buffer that supports incrementally detecting input.
_workspace/src/github.com/onsi/gomega/gexec
Package gexec provides support for testing external processes.
Package gexec provides support for testing external processes.
_workspace/src/github.com/onsi/gomega/ghttp
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
_workspace/src/github.com/onsi/gomega/matchers
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
_workspace/src/github.com/sclevine/agouti/core
Package core is a WebDriver API for Go.
Package core is a WebDriver API for Go.
_workspace/src/gopkg.in/jmcvetta/napping.v1
Package napping is a client library for interacting with RESTful APIs.
Package napping is a client library for interacting with RESTful APIs.
_workspace/src/gopkg.in/jmcvetta/napping.v1/examples/github_auth_token
Example demonstrating use of package napping, with HTTP Basic authentictation over HTTPS, to retrieve a Github auth token.
Example demonstrating use of package napping, with HTTP Basic authentictation over HTTPS, to retrieve a Github auth token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL