Skip to content

Ruby library for interacting with the Ow.ly API

Notifications You must be signed in to change notification settings

opallabs/owly-owly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ow.ly

Ruby implementation around the ow.ly API. Leverages Faraday and Net::HTTP for HTTP interactions.

This implementation currently only supports photo uploads.

Usage

To upload a photo ow.ly requires that you verify your identity through Twitter. As such, it will require a valid Twitter OAuth token and Twitter OAuth token secret to use. See the ow.ly docs for more information.

Create a {Owly::Client} and upload a photo:

@client = Owly::Client.new do |c|
  c.consumer_key = 'twitter-application-key'
  c.consumer_secret = 'twitter-application-secret'
  c.oauth_token = 'my-twitter-oauth-token'
  c.oauth_secret = 'my-twitter-oauth-secret'
  c.api_key = '123456789'
end

# Read a file to upload
@file = File.open('/path/to/allthethings.jpg', 'r')
@client.upload_photo(@file)
{"hash"=>"hijnz",
 "caption"=>"placecage_400x250.jpg",
 "url"=>"http://ow.ly/i/hijnz",
 "score"=>1,
 "static_url"=>"http://static.ow.ly/photos/original/hijnz.jpg"}

Testing

All tests are written in RSpec

$ bundle exec rspec spec

About

Ruby library for interacting with the Ow.ly API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages