You can download the source here. I would make my repository available but unfortunately Olin is not forward thinking enough to provide an outward facing subversion repository.
Requirements
Since the framework is written in Python you would do well to have the following items installed on your computer before attempting to hack on the source code.
- Python 2.3
- Twisted 2.0.1
- GTK 2.6.0
- PyGTK 2.6.3
How to create your own plugin?
Before we begin: It is important that your version number is a floating number with no characters. Additionally, this number can only increase as releases come out. Otherwise Nearby will break horribly! Okay now on to the fun part.
- Come up with an idea.
- Write the application in your language of choice.
- In order to send data across the network you must open a connection on localhost port 8002.
- You must then register yourself with the following message:
REGISTER <service name> <service version>
If there is no other instance running locally then Nearby will add your subservice. Otherwise it will send:UNREGISTER
- In order to communicate with the network simply write messages to the socket in this format:
SEND <message>
- You will receive messages in this format:
RECEIVE <node id> <node name> <message>
Deployment
You need to create a zip file named <servicename>-<serviceversion>.zip with two directories named exactly "windows" and "linux". Now you need to put the different version of your program inside of those directories (if they are the same for Windows and Linux just duplicate them). Your executable must be named either "main.exe" for windows or "main.py" for Linux (this would be incredible simple to expand but I like Python). Place the properly named zip file in the dist subdirectory of Nearby. You must then extract the contents of either "windows" or "linux" into the plugin directory and name the directory <servicename>-<serviceversion>. Restart Nearby and if you did everything correctly your plugin should appear in the list of subservices to execute.
Further Help
If you need further help take a look at the chat program included with the framework. It is dead simple and uses everything that I have talked about here. Since its Open Source feel free to copy it and modify it to create your own plugin.