Coder Social home page Coder Social logo

t0ggah / mingle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperoslo/mingle

0.0 0.0 0.0 264 KB

Social media integration for Ruby on Rails

Home Page: http://rubygems.org/gems/mingle

License: Other

Ruby 90.87% JavaScript 0.89% CSS 1.01% HTML 7.23%

mingle's Introduction

Mingle

Gem Version Build Status Dependency Status Code Climate Coverage Status

Mingle makes it really easy to syndicate tweets from Twitter and photos from Instagram in your Ruby on Rails application.

Installation

Add this line to your application's Gemfile:

gem 'mingle'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mingle

Install the migrations:

rake mingle:install:migrations

Run the migrations:

rake db:migrate

Usage

# Create some hashtags to syndicate content from
Mingle::Hashtag.create tag_name: "#hyper"

# Fetch tweets from Twitter
Mingle::Twitter.fetch

# Fetch photos from Instagram
Mingle::Instagram.fetch

Mingle also ships with rake tasks:

$ rake mingle:twitter:fetch
$ rake mingle:instagram:fetch

Jobs

Mingle ships with Sidekiq jobs for your perusal.

Configuration

Mingle is configured through Mingle.configure, like this:

Mingle.configure do |config|
  config.twitter_api_key = ENV['TWITTER_API_KEY']
  # ...
end

You can also configure it temporarily:

Mingle.temporarily twitter_api_key: 'ABC123' do
  # ...
end

The following configurations can be made through Mingle.configure:

  • twitter_api_key - A Twitter application's API key.
  • twitter_api_secret - A Twitter application's API secret.
  • twitter_access_token - A Twitter application's access token.
  • twitter_access_token_secret - A Twitter application's access token secret.
  • instagram_client_id - An Instagram application's client id.
  • since - A date before which posts, tweets and photos will be ignored.

Note: We recommend you store your application configuration in your environment, like in the example above. In fact, we recommend it so much that Mingle will automatically look for environment variables with specific names, unless you configure them through Mingle.configure.

Mingle checks for following environment variables by default:

  • TWITTER_API_KEY - the equivalent of twitter_api_key
  • TWITTER_API_SECRET - the equivalent of twitter_api_secret
  • TWITTER_ACCESS_TOKEN - the equivalent of twitter_access_token
  • TWITTER_ACCESS_TOKEN_SECRET - the equivalent of twitter_access_token_secret
  • INSTAGRAM_CLIENT_ID - the equivalent of instagram_client_id

Contributing

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

Credits

Hyper made this. We're a digital communications agency with a passion for good code, and if you're using this library we probably want to hire you.

License

Mingle is available under the MIT license. See the LICENSE file for more info.

mingle's People

Contributors

jgorset avatar sindrenm avatar 3lvis avatar timkurvers avatar toothfairy avatar t0ggah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.