Laika

Description

Laika (Russian: Лайка, "barker") is a simple script to monitor an RSS feed, and post to Yammer when new articles are detected.

Currently, only the Yammer posting functionality is implemented.

Installation

Laika is delivered as a RubyGem:

sudo gem install mcornick-laika --source http://gems.github.com

Usage

There are two steps you'll need to do to authenticate your application to Yammer. First, you'll need to register your application with Yammer. Log in to Yammer as the user under whose account the messages should appear. Then go to https://www.yammer.com/client_applications/new. You will be asked to describe your application. Fill out the form and submit it. This will provide you with a client key and secret. Make note of them as you will need them for the next step.

Then, you'll need to do the OAuth exchange, which will give you an access token and secret. Open up a terminal and run:

laika-auth

This will prompt you for the client key and secret you just obtained. It will then echo a URL which you will need to visit while still logged in to Yammer as the user from the previous step. You'll be asked to authorize your application. Click the Authorize button, then go back to your terminal and hit Return. The script will then get the access token and secret from Yammer, and store all four pieces of information in a file called laika.yml. Don't lose this file! It constitutes the credentials that you will need to do anything useful with Laika. It is not encrypted, so keep it secure. Once you have the laika.yml file, you will not need to do these steps again unless you de-authorize the application.

When the RSS polling functionality is ready, it will be documented here, but for now, you can use Laika to post messages to Yammer like so:

require 'rubygems'
require 'laika'
yammer = Laika::Yammer.new('laika.yml') # path to the laika.yml file; default is laika.yml in your current directory
yammer.post('I HAZ A SPASE DOG')

There is a script called laika-post that demonstrates how to do this.

License

Copyright (C) 2008 Mark Cornick of Viget Labs (http://www.viget.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.