Project

hey

0.01
No commit activity in last 3 years
No release in over 3 years
Sends a yo to your yo followers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.3
~> 10.3
~> 4.1
~> 1.18
 Project Readme

Hey

A Ruby library for sending yo's from Yo.

github.com/jackjennings/hey

Gem Version Code Climate Build Status

Installation

gem install hey

Usage

First get an API token.

There are two ways of setting your API token and interacting with the library, depending on the requirements of you program. If you only need to work with a single API token, you can set it in an initializer or at the start of your script. If you set the API token this way, you can ineteract with either the class methods or the instance methods described below.

Hey.api_token = "3858f62230ac3c915f300c664312c63f"

If you need to use multiple API tokens, any hey class will accept an api_token on initialization.

Hey::Yo.new api_token: "3858f62230ac3c915f300c664312c63f"

An API token set when initializing an object takes precidence over the API token set on the Hey module.

Yo All

Sends a yo to all of the account's subscribers.

Hey::Yo.all
# or
yo = Hey::Yo.new api_token: "..."
yo.all

Accepts either link or location in a hash of parameters (optional).

Hey::Yo.all link: "https://github.com/jackjennings/hey"

Yo User

Sends a yo to a specific user.

Hey::Yo.user "WORLDCUP"
# or
yo = Hey::Yo.new api_token: "..."
yo.user "WORLDCUP"

Accepts either link or location in a hash of parameters (optional).

Hey::Yo.user "WORLDCUP" link: "https://github.com/jackjennings/hey"

Subscriber Count

Returns the number of subscribers.

Hey::Subscriber.count
# or
yo = Hey::Yo.new api_token: "3858f62230ac3c915f300c664312c63f"
yo.subscribers.count

Create Account

Creates a new Yo account.

Hey::Account.create "MYAPIACCOUNT", "********"
# or
yo = Hey::Yo.new api_token: "..."
yo.accounts.create "MYAPIACCOUNT", "********"

That's it!