Twitter Integration

Sirportly ships with built-in Twitter integration allowing you to automatically send & receive messages through Twitter. In order to enable this functionality within your application, you need to set up your own "Application" within the Twitter developer site. These instructions outline the process for creating your application and configuring Sirportly.

To begin, you will need a Twitter account. If you don't already have one, you can sign up for one through the twitter site.

Creating the application

Firstly, navigate to the Twitter Developer Site and select 'Login' from the top right and enter your credentials to login. Once you have logged in, go back to the top right, and head to the Developer Portal.

Next, head to Projects & Apps, and click through to create a new Standalone app.

Image

Give the app a unique name, then create it.

You'll be initially shown your API key and API secret, once only, so copy those now and you can add them to your Sirportly configuration as per the next section.

After copying the keys, you will need to set permissions for the app. Head to the app settings, then App Permissions, ensuring they are set to "Read + Write + Direct Messages".

Configuring Sirportly

Twitter will provide you with two strings which must be configured in your configuration file. These tokens are called the Consumer Key and the Consumer Secret and can be found on the 'Details' tab in the Twitter developer site.

Enter the following configuration into your configuration file at config/sirportly.rb and restart your server to apply the changes. The twitter_polling_interval is optional and defaults to 5 minutes. When setting this interval, you should bear in mind that Twitter has rate limits which may affect your service if you poll too frequently.

config.twitter_oauth = {:key => 'yourconsumerkey', :secret => 'yourconsumersecret'}
config.twitter_polling_interval = 5.minutes