Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pmarkert/yolinkage

Link generator with randomized message for multiple http://www.justyo.co apps
https://github.com/pmarkert/yolinkage

Last synced: about 1 month ago
JSON representation

Link generator with randomized message for multiple http://www.justyo.co apps

Awesome Lists containing this project

README

        

This is a simple app for the [justyo](http://www.justyo.co) service where you can listen for yo messages
and then respond with a custom url formatted with a randomly selected item from a configured list.

Initial use-cases for this are:
* Magic eight-ball (YOEIGHTBALL)
* Random Bible-verse (YOBIBLE)
* Heads or Tails

To use the app, environment variables need to be specified:
* YO_API_KEY - Your api key from justyo
* MESSAGES - a pipe "|" delimited list of your custom messages
* RESPONSE_URL_FORMAT - a formatted string containing the response url

For the RESPONSE_URL_FORMAT the default value is "${SCHEME}://${HOST}/message.html?${MESSAGE}"
SCHEME and HOST are relative to the current request. MESSAGE is the url-encoded randomly selected item
from your messages list.

The RESPONSE_URL needs to be an absolute url, and it does not need to live within the application.

For example, the "YOBIBLE" application has the following configuration values:
* RESPONSE_URL_FORMAT = https://www.bible.com/bible/111/${MESSAGE}
* MESSAGE = "john.3.16.niv|rom.8.28.niv"

The "Yo" endpoint for the service is "/yo" and the justyo service will append the username of the user
as a querysting parameter.

To test the service directly, you can use the "/go" endpoint instead.

"/about" will redirect to the URL specified in the "ABOUT" environment variable.