Please follow me at: https://steemit.com/@yuxi
This project is a wrapper of Utopian APIs. It provides an easy way to use Utopian APIs for Ruby developers.
Ruby V2.4 Gem V2.6.11
A set of rspec test has been written here: https://github.com/yuxir/utopian-ruby/blob/master/spec/utopian_ruby_spec.rb
Assuming you already have Ruby development configured, then run:
gem install utopian_ruby_api
require 'utopian_ruby_api'
UtopianRuby::UtopianRubyAPI.get_moderators()["results"]
UtopianRuby::UtopianRubyAPI.get_moderator('elear')
require 'utopian_ruby_api'
UtopianRuby::UtopianRubyAPI.get_moderators_obj().each do |m|
puts m.account
end
UtopianRuby::UtopianRubyAPI.get_moderator_obj('elear')
UtopianRuby::UtopianRubyAPI.is_moderator('elear')
UtopianRuby::UtopianRubyAPI.is_supervisor('espoem')
UtopianRuby::UtopianRubyAPI.get_sponsors()["results"]
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 post objects
UtopianRuby::UtopianRubyAPI.get_posts_obj({"limit":2}).each do |p|
puts p.author
puts p.moderator
end
Get a particular post object:
UtopianRuby::UtopianRubyAPI.get_post_obj('espoem','old-moderated-posts-are-received-and-shown-instead-of-the-recent-one')
Get posts by category
UtopianRuby::UtopianRubyHelper.get_posts_by_type("development",{"limit":5})
Get post objects by category
UtopianRuby::UtopianRubyHelper.get_posts_obj_by_type("development",{"limit":5})
Get post objects by moderator
UtopianRuby::UtopianRubyHelper.get_posts_obj_by_moderator("helo",{"limit":10,"type":"development"})
Get post repository
UtopianRuby::UtopianRubyHelper.get_post_repository('yuxi','utopian-api-ruby-client')
Get Utopian current status
UtopianRuby::UtopianRubyAPI.stats()
Check if Utopian bot is voting
UtopianRuby::UtopianRubyAPI.is_voting()
require 'utopian_ruby_api'
UtopianRuby::UtopianRubyAPI.get_categories()