Project

croudia

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the Croudia API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.1.0
~> 4.0.1
~> 2.14.0
~> 1.13.0

Runtime

 Project Readme

Notice: Croudia has shut down since Dec 31, 2017. This rubygem will no longer work as it depends on Croudia's API.

Croudia

Build Status

Ruby wrapper for the Croudia API

This software is not affiliated with Croudia Inc. Croudia is a registered trademark of Croudia Inc. in Japan.

Installation

Add this line to your application's Gemfile:

gem "croudia", "~> 1.0"

And then execute:

$ bundle

Or install it yourself as:

$ gem install croudia

Usage

Getting an access token

require "croudia"

# Initialize a new instance
croudia = Croudia::Client.new(
  client_id: "client_id",
  client_secret: "client_secret"
)

# Get URL
url = croudia.authorize_url

# Or add state query in URL
url = croudia.authrorize_url(state: "state_value")

# Retrieve an access token
access_token = croudia.get_access_token("code param returned by user")
#=> { "access_token" => " ... ", "refresh_token" => " ... ", ... }

# Refresh an access token
new_access_token = croudia.get_access_token(
  grant_type: :refresh_token,
  refresh_token: "refresh_token"
)

Using the API

require "croudia"

# Create an instance
croudia = Croudia::Client.new(access_token: "access_token")

# Get home_timeline
home_timeline = croudia.home_timeline

# Post a status
posted_status = croudia.update("Hello!")

The full documentation of Croudia::Client is available at: http://rdoc.info/gems/croudia/Croudia/Client

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request