advice.cr

advice.cr - a random, by id or search advice, simple and fast

advice.cr

A Crystal API wrapper for AdviceSlip.

"My life was changed after this got released"

Features

  • Get a random advice
  • Get advice by ID
  • Returns JSON parsed as key-value hashes

Installation

Clone the repository and require the SDK in your project:

require "path/to/advice"
client = Advice.new

advice = client.advice.by_id(13)

puts advice #{"slip" => {"id" => 13, "advice" => "If you're feeling tired or anxious, a pint of water will almost always make you feel better."}}
# again parsed to key value hashes!!
require "path/to/advice"

client = Advice.new

advice = client.advice.by_id(13)

puts advice #{"slip" => {"id" => 13, "advice" => "If you're feeling tired or anxious, a pint of water will almost always make you feel better."}}
# again parsed to key value hashes!!
require "path/to/advice"

client = Advice.new

query = client.advice.search("coffee")
puts advice #{"total_results": "1", "query": "coffee", "slips": [{"id":219,"advice":"Try buying a coffee for the creator of a free public API, now and then.","date":"2021-08-16"}]}

So simple!

Roadmap

  • Maybe better error handling
  • transform to a shard
Repository

advice.cr

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • 23 days ago
  • September 29, 2025
License

Links
Synced at

Wed, 22 Oct 2025 19:56:12 GMT

Languages