Skip to content

valixym/sharkey.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sharkey.cr

Sharkey.cr is a Crystal library made for interacting with Sharkey's API.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      sharkey:
        github: valixym/sharkey.cr
  2. Run shards install

Usage

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"

Development

TODO: Write development instructions here

Contributing

  1. Fork it (https://github.com/valixym/sharkey/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

  • Vi - creator and maintainer

About

Sharkey API library, now for Crystal!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published