GithubHelp home page GithubHelp logo

lulu's Introduction

lulu

forthebadge

Dependency Status

This is an instance of GitHub's Campfire bot, hubot. It's pretty cool.

This instance is deployed on the ACM IRC Server for our IRC uses.

Playing with Hubot

You'll need to install the necessary dependencies for hubot. All of those dependencies are provided by npm.

HTTP Listener

Hubot has a HTTP listener which listens on the port specified by the PORT environment variable.

For the lulu implementation, it is recommended to run it with --disable-httpd since irc.case.edu is a public-facing server.

Persistence

The hubot-redis-brain package is currently activated for lulu. This requires an implementation of Redis in some way or another and the appropriate configuration. For further information, see hubot-redis-brain doc.

For remote redis, the URL must be formatted as redis://:[email protected]:port/prefix by experimental testing. Note the unexpected additional :.

Testing Hubot Locally

To get started with hubot, you will need node.js and its associated package manager npm. Downloading node.js directly or through your favorite package manage, likely as nodejs and npm.

Once you have the runtime installed, fork this repo and clone to your development computer. In the root of the repo, run npm install to install all of the dependencies in package.json.

With all the dependencies installed, run bin/hubot to start shell interaction. You'll see some start up output about where your scripts come from and a prompt. Some status or error messages are expected if environment variables are not fully configured.

Then you can start interacting with hubot by typing anything that may be picked up by a listener. Run hubot help .* (the shell will not respond to the name lulu) to generate a list of available commands. This may have a very long output due to the number of scripts installed.

Adapter: IRC

Adapters are the interface to the service you want your hubot to run on. This can be something like Campfire or IRC. There are a number of third party adapters that the community have contributed. Check the hubot wiki for the available ones.

As our IRC bot, lulu expects to be run with the IRC adapter as listed in package.json under the dependencies. Part of lulu's run script should include running it as:

% bin/hubot -a irc [... other options]

external-scripts

Hubot is now able to load scripts from third-party npm packages! To enable this functionality you can follow the following steps.

  1. Add the packages as dependencies into your package.json
  2. npm install to make sure those packages are installed

More easily, you can skip manually managing the dependency list and manage the correct dependencies using npm install --save [package-name]. This will update package.json for you. However, if there are version restrictions on the dependency you are adding, be sure to update the package.json to reflect the requirement.

To enable third-party scripts that you've added you will need to add the package name as a double quoted string to the external-scripts.json file in this repo.

Any new scripts that you want to make generally available should be implemented as independent repositories that are connected to npm.

Deployment

Check DOCUMENTATION for information on deploying lulu. This generally will require setting the appropriate environment variables before running bin/hubot with any appropriate parameters.

Expected Environment Variables

Deploying lulu currently expects the following environment variables to be set. This should be done by the un-committed script with requisite keys/passwords/tokens that lives on irc.case.edu.

  • HUBOT_HOME
  • HUBOT_IRC_NICK
  • HUBOT_IRC_ROOMS
  • HUBOT_IRC_SERVER
  • HUBOT_DNSIMPLE_USERNAME
  • HUBOT_DNSIMPLE_API_TOKEN
  • HUBOT_YOUTUBE_API_KEY
  • HUBOT_YOUTUBE_DETERMINISTIC_RESULTS (optional flag)
  • REDIS_URL (optional if redis is hosted at localhost:6379 relative to lulu)
  • NAMER_NAME
  • NAMER_NICK
  • HUBOT_WEB_TITLE_LEN (optional, int for maximum length of web titles. defaults to 200)

For a full list of environment variables detected that might be used, see this page.

lulu's People

Contributors

thomasrussellmurphy avatar unforced avatar raidancampbell avatar grygon avatar

Stargazers

 avatar

Watchers

Josh Snyder avatar James Cloos avatar  avatar Rebecca R. Carter avatar Stephen Brennan avatar

lulu's Issues

support for ping-pong response

usage:

!ping

expected result:

[nick]: pong!

very useful for debugging IRC client woes, and ensuring the bot is really alive

Deciding on correct dependency states

Currently, https://david-dm.org/hacsoc/lulu shows that we're up to date with everything except redis. Notably, everything other than redis uses the version requirement >=, which seems like a poor plan, particularly given that this has caused issues earlier due to node.js/io.js splitting and reconverging. What dependency specificity do we want?

User Agent spoofing

Lulu's HTML title response (when you post a link, this is Lulu's response), commonly comes across errors (406, 403, etc). When I click the link, I am transferred to the expected site without error.

This is likely because the user agent that Lulu uses to visit these sites indicates it is a bot in some way. A simple solution would be to change the user agent that Lulu sends in its HTTP header.

marco polo

Similar to ping pong, it would be great if I could say lulu marco and lulu responds with "polo!"

support for reminders

usage:

!remind [n] minutes [reminder text]

expected result:

response saying [nick]: okay, reminding in [n] minutes

additional response [n] minutes later: [nick]: [reminder text]

incomplete help text

doing a query against lulu with "lulu help", or, more preferably "/msg lulu help", produces an instant flood of returned text.

lulu is likely hitting the IRC's preconfigured flood limit, and being cut off.

This could also explain why lulu sometimes doesn't provide URL about text for links sometimes.

Save and load state

This is more a thought for a future feature, when there is time for more exciting development.

Hubot looses the associations (e.g. siretrm is a despot) and the karma when it restarts. Maybe we can find a way to save hubot's state and load it again, so that we don't lose these (airquotes) "gems".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.