github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

dougal / wase_endpoint

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (7)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

WaseEndpoint is a library for building daemons that act as WASE Endpoints for the EngineYard Wase competition: http://bit.ly/3qRMbv — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

A new Twitterer object now makes a test call to twitter to validate the 
authentication. 
dougal (author)
Thu Nov 05 13:19:49 -0800 2009
commit  22649ac71c9a6ce271de38e3f6a9c25135ca3df8
tree    11f2f6a021eff30d2057962f2f742f6bc9690d3f
parent  7694df3bbf63d06cac544cd445faa5b7714fbb6e
wase_endpoint /
name age
history
message
file .gitignore Loading commit data...
file README.rdoc
file Rakefile Thu Nov 05 05:24:22 -0800 2009 Initial commit. [dougal]
file VERSION Thu Nov 05 05:25:30 -0800 2009 Version bump to 0.0.0 [dougal]
directory example/ Thu Nov 05 12:21:03 -0800 2009 Can now pass back a custom counter increment. C... [dougal]
directory lib/ Thu Nov 05 13:19:49 -0800 2009 A new Twitterer object now makes a test call to... [dougal]
directory spec/ Thu Nov 05 13:19:49 -0800 2009 A new Twitterer object now makes a test call to... [dougal]
file wase_endpoint.gemspec
README.rdoc

WaseEndpoint

WaseEndpoint is a library for building daemons that act as WASE Endpoints for the EngineYard Wase competition: bit.ly/3qRMbv

Install

WaseEndpoint is hosted by gemcutter.com. Please make sure you have added them to your gem sources.

  $ sudo gem install wase_endpoint

Usage

The following are all in the example directory.

Your endpoint logic:

  # example/my_endpoint.rb

  require 'rubygems'
  require 'wase_endpoint'

  class MyEndpoint < WaseEndpoint

    # This where our logic goes.
    # A json encoded String is the only argument. You can deal with this however
    # you want. The JSON library is already loaded should you wish to use it.
    # Return another String, or a Hash containing the String and the program
    # counter increment you wish to use.
    def secret_sauce(raw_json)

      # Just pass it back. Program counter increment will be 1.
      raw_json

      # Or pass it back with a custom program counter.
      # { :data => raw_json, :increment => 2}
    end

  end

The init file:

  # example/init.rb

  require 'my_endpoint'

  MyEndpoint.new( :username => 'twitter_username',
                  :password => 'twitter_password',
                  :logfile => 'my_endpoint.log',
                  :sleep_period => 60 )

Now running the init file will start your daemon. The PID will be returned to allow you to monitor it or kill it later.

  ruby init.rb

That’s it! I also included a basic sinatra server in ‘server.rb’ that can be used as an input/output/program-listing node.

Problems, Comments, Suggestions?

Issues can be tracked on github: github.com/dougal/wase_endpoint/issues

All of the above are most welcome. dougal.s@gmail.com

Credits

Douglas F Shearer - douglasfshearer.com

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server