Code Monkey home page Code Monkey logo

yo-ruby's Introduction

Yo for Ruby

Yo! API for Ruby (v1.0.0)

Build Status Code Climate Coverage Status

This is a Ruby API wrapper that's fully tested. It works on Ruby 2.1 and above. This was originally written for the Yo! hackathon in New York (which I later won first place with YoAuth).

Installation

Do it through your terminal, yo.

$ gem install yo-ruby

No? Stick it in your Gemfile, yo.

gem 'yo-ruby', '~> 1.0'

Documentation

Before using the Yo! API, you need to obtain a free API key. It takes a few seconds.

Required: Now you need to include the library and set your API key.

require 'yo-ruby'

Yo::Configuration.setup do |config|
  config.api_key = "[insert api key here]"
end

# Alternatively: Yo::Configuration.api_key = "[insert api key here]"

Method: Send a yo to someone

yo = Yo.yo!("username")
yo.ok? # => true

Method: Send a yo to someone with a URL

yo = Yo.link!("username", "http://github.com/bih/yo-ruby")
yo.ok? # => true

Method: Subscriber count

Yo.subscribers

Method: Send a yo to all your subscribers

Yo.all!

Method: Send a yo to all your subscribers with a URL (New)

Yo.all!("http://github.com/bih/yo-ruby")

Lazy Documentation

require 'sinatra'
require 'yo-ruby'

Yo::Configuration.setup do |config|
  config.api_key = "[insert api key here]"
end

get '/yo/:username' do
  yo = Yo.yo!(params[:username])
  yo.ok?
end

get '/yoall' do
  yo = Yo.all!
  yo.ok?
end

get '/subscribers' do
  puts "Subscribers: #{Yo.subscribers}"
end

Testing

This gem is fully tested and you can find all the tests in the spec/yo-ruby/ folder. You can also execute them by running the rake command.

$ rake

Who made this?

Bilawal Hameed. Released freely under the MIT License.

yo-ruby's People

Contributors

bih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dam13n

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.