https://github.com/dougal/wase_endpoint
WaseEndpoint is a library for building daemons that act as WASE Endpoints for the EngineYard Wase competition: http://bit.ly/3qRMbv
https://github.com/dougal/wase_endpoint
Last synced: 6 months ago
JSON representation
WaseEndpoint is a library for building daemons that act as WASE Endpoints for the EngineYard Wase competition: http://bit.ly/3qRMbv
- Host: GitHub
- URL: https://github.com/dougal/wase_endpoint
- Owner: dougal
- Created: 2009-11-05T13:23:23.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2009-11-05T21:24:42.000Z (almost 16 years ago)
- Last Synced: 2025-03-13T17:36:23.288Z (7 months ago)
- Language: Ruby
- Homepage:
- Size: 82 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
= WaseEndpoint
WaseEndpoint is a library for building daemons that act as WASE Endpoints for the EngineYard Wase competition: http://bit.ly/3qRMbv
== Install
WaseEndpoint is hosted by http://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}
endend
The init file:
# example/init.rbrequire '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: http://github.com/dougal/wase_endpoint/issues
All of the above are most welcome. mailto:dougal.s@gmail.com
== Credits
Douglas F Shearer - http://douglasfshearer.com