https://github.com/mamantoha/foaas_client
A Crystal client for FOAAS - a modern, RESTful, scalable solution to the common problem of telling people to fuck off
https://github.com/mamantoha/foaas_client
api-client api-wrapper crystal foaas fuck fuck-off-as-a-service
Last synced: 3 months ago
JSON representation
A Crystal client for FOAAS - a modern, RESTful, scalable solution to the common problem of telling people to fuck off
- Host: GitHub
- URL: https://github.com/mamantoha/foaas_client
- Owner: mamantoha
- License: mit
- Created: 2018-04-11T14:02:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-27T10:30:45.000Z (11 months ago)
- Last Synced: 2025-05-12T18:57:58.107Z (5 months ago)
- Topics: api-client, api-wrapper, crystal, foaas, fuck, fuck-off-as-a-service
- Language: Crystal
- Homepage: https://mamantoha.github.io/foaas_client/
- Size: 65.4 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FOAAS Client
[](https://github.com/mamantoha/foaas_client/actions/workflows/crystal.yml)
[](https://mamantoha.github.io/foaas_client/)A Crystal client for [FOAAS](https://github.com/tomdionysus/foaas)(Fuck Off As A Service) - a modern, RESTful, scalable solution to the common problem of telling people to fuck off.
> This library was writter to demonstrate a powerful macro system in [Crystal](https://crystal-lang.org/).
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
foaas_client:
github: mamantoha/foaas_client
```## API Version
Version `2.3.2` of the FOAAS API is supported.
## Usage
```crystal
require "foaas_client"client = Foaas::Client.new
client.rtfm("Me")
# => Read the fucking manual! - Meclient.awesome("You", accept_type: :text)
# => This is Fucking Awesome. - Youclient.you("Nvidia", "Linus Torvalds", accept_type: :text)
# => Fuck you, Nvidia. - Linus Torvaldsclient.dosomething("Do", "work", "Ruby", accept_type: :text)
# => Do the fucking work! - Rubyclient.awesome("Everyone", accept_type: :json, i18n: "uk")
# => "{\"message\":\"Це, чорт забирай, класно. Усі \",\"subtitle\":\" undefined\"}"
```Will respond to the following `accept_type` values:
- `:text` - Content will be returned as a plain string.
- `:json` - Content will be returned as a JSON object.
- `:html` - Content will be returned as an HTML page with a twitter bootstrap hero unit, containing the message and the subtitle.
- `:xml` - Content will be returned as a XML document.## Development
```console
crystal ./utils/generate_operations.cr
```## Contributing
1. Fork it ( https://github.com/mamantoha/foaas_client/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [mamantoha](https://github.com/mamantoha) Anton Maminov - creator, maintainer