Generates a random poem from rudimentary Markov chains.
- Shakespeare's sonnets and poems are used as a source for data found on the /shakespeare path. This gives a far better result than the random poems due to the much larger data set. Check it out on the heroku page linked in the description.
- The random poet data is taken from PoetryDB, hosted on Github at Poetry DB Github
- Using the /poem or /shakespeare route, you will recieve a JSONP response which contains the poet's name as well as the generated poem in form of a large string.
- To use this as an API go to this app's Mashape Page for a request link.
Example use with JQuery:
$.ajax({
url: "https://imtoobose-really-awful-poems-v1.p.mashape.com/shakespeare",
type: 'GET',
datatype: 'json',
success: function(data) { alert(JSON.stringify(data)); },
error: function(err) { alert(err); },
beforeSend: function(xhr) {
xhr.setRequestHeader("X-Mashape-Authorization", "YOUR-MASHAPE-KEY"); // Enter here your Mashape key
}
});
- bl for Buffer drains
- request for HTTP calls
- express.js for the back end