Allowing auto-post to social media is pretty hot right now. Here’s how to do it via facebook. LinkedIn to follow.
- Get the koala gem. https://github.com/arsduo/koala/wiki/
- Get your facebook API keys. https://www.facebook.com/developers/createapp.php
- Create facebook.yml in your config directory
- Create koala.rb in your conifg/intializers directory
- Our app doesn’t yet integrate oauth to our registration process yet. Rather we use facebook/twitter/linkedIn as auto-post accounts (think posterous). So we have a notification screen in which users can link their account with linkedin/twitter/facebook. I currently store the user’s facebook access ID, uid, and facebook user name. The access ID is needed for the post. The username is just used by our app for display only. So create a migration. (rails g migration AddFBToUsers fbaccess:string fbuser:string). See below for the migration. Remember to run rake db:migrate.
- Ok – we are ready to post. We use Koala for this too.