Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

social_poster

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

social_poster

  • 0.0.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Description

SocialPoster is a gem that allows you easily post to different social networks. Supported networks are:

  • Facebook
  • Twitter
  • Livejournal
  • Vkontakte

Installation

In console:

gem install social_poster

or in your Gemfile:

gem 'social_poster'

Configuration

Can work with or without Rails. Here is an example of usage when you want to use it with Ruby on Rails framework. First you need to create a configuration file config/initializers/social_poster.rb:

SocialPoster.setup do |config|
  config.fb = {
    access_token: 'ACCESS_TOKEN'
  }

  config.vk = {
    access_token: 'ACCESS_TOKEN'
  }

  config.twitter = {
    consumer_key:       'CONSUMER_KEY',
    consumer_secret:    'CONSUMER_SECRET',
    oauth_token:        'OAUTH_TOKEN',
    oauth_token_secret: 'OAUTH_TOKEN_SECRET'
  }

  config.lj = {
    user:     'USER',
    password: 'PASSWORD'
  }
end

Usage

In controller or model you can post to different social networks like this:

SocialPoster.write(:fb, 'Something that will appear on your Facebook Wall...')
SocialPoster.write(:vk, 'Something that will appear on your Vkontakte Wall...')
SocialPoster.write(:twitter, 'Tweet tweet tweet')
SocialPoster.write(:lj, 'A long text of the post...', 'A short title of it')

For Vkontakte API there is a possibility of providing additional options. For instance, for posting on a group wall use this example:

SocialPoster.write(:vk, 'Text on the Group Wall...', nil, owner_id: '-GROUP_ID')

You can specify extra parameters for Facebook API too. For instance, you can post links, or pictures like this:

SocialPoster.write(:fb, 'Text on the Wall...', nil, link: 'http://google.com', picture: 'https://www.google.com/images/srpr/logo11w.png')

Contribute

  • fork
  • add changes
  • run tests:
ruby -I test test/*/*
  • create a pull request

FAQs

Package last updated on 22 Nov 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc