Sharkey.cr is a Crystal library made for interacting with Sharkey's API.
-
Add the dependency to your
shard.yml
:dependencies: sharkey: github: valixym/sharkey.cr
-
Run
shards install
Using Sharkey.cr is fairly straightforward. All of the responses from Sharkey's API are formatted in JSON, and can be easily parsed using Crystal's built-in JSON library. I wrote some example code that you can base your project off of.
require "sharkey"
require "json"
resp = Sharkey::Misc.stats("https://kitsunes.club")
x = JSON.parse(resp)
notes_count = x["originalNotesCount"].as_i
users_count = x["originalUsersCount"].as_i
puts "Instance has #{notes_count} total notes, and #{users_count} total users <3"
TODO: Write development instructions here
- Fork it (https://github.com/valixym/sharkey/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Vi - creator and maintainer