https://github.com/aduth/api.libroipsum.com
API endpoint for LibroIpsum phrase generation
https://github.com/aduth/api.libroipsum.com
Last synced: about 1 year ago
JSON representation
API endpoint for LibroIpsum phrase generation
- Host: GitHub
- URL: https://github.com/aduth/api.libroipsum.com
- Owner: aduth
- License: mit
- Created: 2013-02-07T01:17:42.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-26T12:45:50.000Z (about 13 years ago)
- Last Synced: 2025-03-13T22:35:06.369Z (about 1 year ago)
- Language: CoffeeScript
- Homepage: http://api.libroipsum.com/
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# api.libroipsum.com
Source for LibroIpsum public API. Powers [LibroIpsum.com](http://www.libroipsum.com). Supports `.txt`, `.json`, `.jsonp`, and `.xml` content-type rendering.
[Read more about LibroIpsum](http://github.com/aduth/LibroIpsum)
Example API requests: [Cicero](http://api.libroipsum.com/literature/cicero.json?words=80¶graphs=2), [Plato's Republic](http://api.libroipsum.com/literature/republic.json), [Obama-Romney Debates (2012)](http://api.libroipsum.com/politics/obamaromneydebate.xml), [Huckleberry Finn](http://api.libroipsum.com/literature/huckleberryfinn.txt)
## Installation
To use the source locally, you must first have Node.js installed ([installer](http://nodejs.org/download/)). Then, in your terminal, clone the repository and install dependencies:
```bash
git clone git://github.com/aduth/api.libroipsum.com.git
cd api.libroipsum.com
npm install
```
Start the server with Node.js:
```bash
node index.js
```
To make use of the API, there must be source texts available in the `sources/` directory. These sources are automatically loaded and seeded (cached) by the server. For example, if `sources/books/example.txt` exists, generated LibroIpsum text can be accessed at `http://localhost:8080/books/example.json`.
To make changes, modify `.coffee` source files in the `src/` directory. A Gruntfile exists to easily watch and compile CoffeeScript to JavaScript:
```bash
npm install -g grunt-cli # If not already installed
grunt
```
## License
Copyright (c) 2013 Andrew Duthie
Released under the MIT License (see LICENSE.txt)