BabbageBot - written by on 2015-10-15

BabbageBot

BabbageBot is a Python bot for Slack. Modular, easy to use and fun.

BabbageBot is a Python made bot for Slack, the communication tool for teams. The bot provides easy to add and easy to modify commands that can greatly expand the experience of chatting.

It was made with the intention of being modular, enabling anyone that wants to modify it to do the changes very easily. The structure of the bot is:


├── LICENSE
├── main.py
├── modules
│   ├── btc.py
│   ├── calc.py
│   ├── help.py
│   ├── __init__.py
│   ├── iss.py
│   ├── list.py
│   ├── ping.py
│   ├── rand.py
│   ├── translate.py
│   ├── weather.py
│   └── wiki.py
└── README.rst

The main.py contains the main methods for connecting to the Slack API through a Websocket. An API key is required. This file also loads the modules/list.py. List.py enumerates all the available modules (aka commands), and main.py uses this list as the message filter. When a string is detected to be in the list, this message gets delivered to the appropriate module. Result is then returned from the specific module and sent back to Slack.

The modules folder, as already said, contains all the modules that can be used by the bot. Each command should have its own file. Not required, but recommended.

For example, calc.py computes any kind of mathematical expression by sending the data to a server and then retrieving the result. Modules like the weather one require an API key. (In this case, from Openweathermap)

Adding a command is pretty simple. Create a .py file with any name in the modules/ folder. Then create the 'execute' function, with an string as a parameter (even if you don't use it). For example, I'll use the file 'wiki.py' (Fetches the Wikipedia). Inside the execute function I have all the necessary code to fetch the relevant Wikipedia article based on the given arguments.

After the code is properly written and working, an entry should be added in modules/list.py. First, importing it (eg, 'import wiki'); and then adding the entry itself in 'commandModules'. In this case I would add ''wiki': wiki'. The first 'wiki' is the keyword the bot will be listening for executing the command specified on the second half, 'wiki'. You could also have ''potato': wiki', and then sending to the bot 'potato Trees' would return the Wikipedia article about trees.

BabbageBot is distributed under the GNU Affero GPL v3 license.

For more information on installing, modifying and redistributing, please visit this GitHub repository: BabbageBot


Tagged in Software. 0 comments

RSS is now working! - written by on 2015-09-24

The RSS feed is ready to use and read!

(Yes, right now almost all posts are about the server having new features. Sorry about that :3)

A new fancy feature started working just a few minutes ago! Prepare your RSS feed reader, for the most fractal-ish RSS feed ever. Really, take a look at this magnificent Menger Sponge: https://nixijav.com/rss


Tagged in Server Stuff. 0 comments

Support Free Software! - written by on 2015-09-24

Support Free Software!

Why is free software important? Because our freedom matters.

'Free software' means software that respects users' freedom and community. Roughly, it means that the users have the freedom to run, copy, distribute, study, change and improve the software. Thus, 'free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech', not as in 'free beer'. We sometimes call it 'libre software' to show we do not mean it is gratis. (Source)

Why is Free Software important? Because our freedom matters. Because we should have the right to learn and share what we learn with others. Currently, many people use propietary software that denies users these freedoms and benefits. With propietary software, if we give a copy to a friend, if we try to figure out how the program works, or even if we put a copy on more than one of our own computers in our own home, we could be caught and fined or put in jail. This won't happen with Free Software.

A program can be considered Free Software if the program's users have this four essential freedoms:

  1. The freedom to run the program as you wish, for any purpose.
  2. The freedom to study how the program works, and change it so it does your computing as you wish. Access to the source code is a precondition for this.
  3. The freedom to redistribute copies so you can help your neighbor.
  4. The freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.

So, what are you waiting for? Don't let them steal your freedom. Go ahead and make a move. Change starts with you, and now, it is necessary. We are in the time of cloud computing and proprietary SaaSS, and these companies are taking over people's freedom.

Things to read:
The FS Philosohpy
The GNU Project
Free Software Foundation

And remember, it's not a matter of price. It's a matter of liberty.


Tagged in Free Software. 0 comments