Repository is archived
No commit activity in last 3 years
No release in over 3 years
Posting to the most popular social media
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 2.7
~> 3.5.0
~> 10.0
~> 3.6.0
~> 0.50.0
~> 3.0.3
~> 3.0.1

Runtime

~> 0.3.1
~> 3.0.0
~> 6.1.0
 Project Readme

Postwill

Gem Version CircleCI Maintainability

Posting to the most popular social media

Installation

Add this line to your application's Gemfile:

gem 'postwill'

And then execute:

$ bundle

Or install it yourself as:

$ gem install postwill

Usage

List of available providers is here.

Single provider

postwill = Postwill::Client.new(
                   twitter: {
                     access_token: 'access_token',
                     access_token_secret: 'access_token_secret'
                   }
                 )

postwill.to(:twitter, text: 'text', image: 'image')

Success:

{
  twitter: {
    status: :ok,
    response: {} # Hash of response data depends on provider
  }
}

Failure:

{
  twitter: {
    status: :error,
    response: '' # String error message
  }
}

Application credentials

config/initializers/postwill.rb

Postwill::Settings.configure do |config|
  config.providers.twitter = {
    consumer_key: 'your_consumer_key',
    consumer_secret: 'your_consumer_secret'
  }
end

Multiple providers

postwill = Postwill::Client.new(
                   twitter: {
                     access_token: 'access_token',
                     access_token_secret: 'access_token_secret'
                   },
                   facebook: {
                     access_token: 'access_token'
                   }
                 )

postwill.to(%i[twitter facebook], text: 'text', image: 'image')

Result:

{
  twitter: {
    status: :ok,
    response: {} # Response data
  },
  facebook: {
    status: :ok,
    response: {} # Response data
  }
}

Application credentials(for providers which need them)

config/initializers/postwill.rb

Postwill::Settings.configure do |config|
  config.providers.twitter = {
    consumer_key: 'your_consumer_key',
    consumer_secret: 'your_consumer_secret'
  }
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/postwill/postwill.

License

The gem is available as open source under the terms of the MIT License.