Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RamonGebben/figlefy
API for getting ascii art strings
https://github.com/RamonGebben/figlefy
Last synced: about 1 month ago
JSON representation
API for getting ascii art strings
- Host: GitHub
- URL: https://github.com/RamonGebben/figlefy
- Owner: RamonGebben
- License: isc
- Created: 2015-12-13T11:43:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-07T13:55:39.000Z (over 8 years ago)
- Last Synced: 2024-08-02T13:32:47.550Z (5 months ago)
- Language: HTML
- Homepage: http://figlefy.com
- Size: 20.5 KB
- Stars: 17
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# figlefy
API for getting ascii art strings
## Running the project
To run the project install all dependencies using npm:
```bash
npm i
```
Then you can run the project via node:
```bash
node app.js
```
Thats it. For development I use [Nodemon](https://github.com/remy/nodemon) which I can recommend for projects like this.### API Overview
The API works very simple. The request url should be build of like this: `http://figlefy.com/figlefy/{URI encoded string}/{font}`
The `{font}` is optional. If you de not specify any font you will get the default font. A small example using `fetch`:
```javascript
const figlefyAPI = 'http://figlefy.com/figlefy/';
let myString = 'Hello figlefy';fetch(figlefyAPI + encodeURIComponent(myString))
.then( res => res.text())
.then(figlefied => {
console.log(figlefied);
});
```This will return a `String` which looks like this when presented in a monospace font:
```
_ _ _ _ __ _ _ __
| | | | ___| | | ___ / _(_) __ _| | ___ / _|_ _
| |_| |/ _ \ | |/ _ \ | |_| |/ _` | |/ _ \ |_| | | |
| _ | __/ | | (_) | | _| | (_| | | __/ _| |_| |
|_| |_|\___|_|_|\___/ |_| |_|\__, |_|\___|_| \__, |
|___/ |___/
```
### FontsIf you want to get an overview of all the posible fonts make a request to `/fonts`:
```javascript
const fontListURL = 'http://figlefy.com/fonts/';fetch(fontListURL)
.then( res => res.json())
.then(fonts => {
console.log(fonts);
});
```Which would present you with a list like this:
```javascript
[
"3-d",
"3x5",
"5lineoblique",
"acrobatic",
// ....
]
```