Utopian API Ruby client

in #utopian-io7 years ago (edited)

What is the project about?

This project is a wrapper of Utopian APIs. It provides an easy way to use Utopian APIs for Ruby developers.

Technology Stack

Ruby V2.4
Gem V2.6.11

Roadmap

The current implementation is a wrapper of Utopian API and the returned values are all in JSON. Next release will be focusing on modelling Utopian entities e.g. add classes including moderator, supervisor, post etc to make developers’ life easier.

Test

A set of rspec test has been written here: https://github.com/yuxir/utopian-ruby/blob/master/spec/utopian_ruby_spec.rb

How to contribute?

Just fork this project, create your feature branch, commit your changes and send a pull request!
https://github.com/yuxir/utopian-ruby

Installation

This gem has been registered in rubygems.org:
image.png

Assuming you already have Ruby development configured, then run:

gem install utopian_ruby_api

How to use it?

Get moderator information

Get all moderators JSON:

require 'utopian_ruby_api'
UtopianRuby::UtopianRubyAPI.get_moderators()["results"]

Get a particular moderator’s metadata

UtopianRuby::UtopianRubyAPI.get_moderator('elear')

Check if a user is a moderator

UtopianRuby::UtopianRubyAPI.is_moderator('elear')

Check if a user is a supervisor

UtopianRuby::UtopianRubyAPI.is_supervisor('espoem')

Get sponsor information

Get all sponsors in JSON

UtopianRuby::UtopianRubyAPI.get_sponsors()["results"]

Check if a user is a sponsor

UtopianRuby::UtopianRubyAPI.is_sponsor('ned')

Get a post information in JSON

UtopianRuby::UtopianRubyAPI.get_post('espoem','old-moderated-posts-are-received-and-shown-instead-of-the-recent-one')

Get Utopian status

Get Utopian current status

UtopianRuby::UtopianRubyAPI.stats()

Check if Utopian bot is voting

UtopianRuby::UtopianRubyAPI.is_voting()

Proof of work

I have added my Steemit account link in the README:

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

Please add a LICENSE file to your repository.

You can contact us on Discord.
[utopian-moderator]

Thanks, will do.

Hey @yuxi I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x