Browse files

updated documentation

  • Loading branch information...
1 parent 4ae1df3 commit 3f67c7072a742327f47d215bdc012d77ab5c830c @andrewhavens committed Feb 18, 2012
Showing with 36 additions and 12 deletions.
  1. +10 −11 README.md
  2. +26 −0 lib/mad_chatter/message_listeners/video.rb
  3. BIN screenshot.png
  4. +0 −1 templates/config.yml
View
21 README.md
@@ -2,7 +2,7 @@
Mad Chatter is a fun, easy to customize chat server. It's written in Ruby and utilizes HTML 5 Web Sockets for fast communication.
-The goal of Mad Chatter is to basically become an open-source version of [Campfire](http://campfirenow.com/), [HipChat](https://www.hipchat.com), or [FlowDock](https://www.flowdock.com). Or at least use those as inspiration.
+The goal of Mad Chatter is to basically become an open-source version of [Campfire](http://campfirenow.com/), [HipChat](https://www.hipchat.com), or [FlowDock](https://www.flowdock.com)...or at least use those as inspiration.
## Getting Started
@@ -22,7 +22,7 @@ This command will generate the following structure:
mychatroom/
config.yml # for general configuration
- extensions.rb # for writing your own extensions
+ extensions/ # for writing your own extensions
web/ # all of the html, css, and javascript live here
To start your chat server, navigate to the directory that was just created and run...
@@ -33,15 +33,15 @@ This will start up the Mad Chatter chat server as well as a simple web server fo
![Mad Chatter screenshot](https://raw.github.com/andrewhavens/mad_chatter/master/screenshot.png)
-When you're ready to have other people use your chat server (friends, family, co-workers, etc) you'll want to host the server and web directory some place that they can access (on a web server, for example, if it will be used outside your local network). You'll also want to start the chat server and leave it running for a long time in the background. This is known as a "daemon". Here are a few useful commands for that:
+When you're ready to have other people start using your new chat server (friends, family, co-workers, etc) you'll need to set up a web server so other people can access it. Set up your web server to serve the `web` directory that we created above. Now you're ready to start Mad Chatter and leave it running in the background. Here are a few useful commands for that:
mad_chatter start
mad_chatter stop
mad_chatter restart
## Chat Actions
-Mad Chatter can do some special things depending on the chat messages you send. Every chat message is parsed to see if it is a normal chat message, or if its a special action. These actions are much like IRC commands. For example, if I wanted to change my screen name from Andrew to Andy I could chat this message:
+Mad Chatter can do some special things depending on the chat messages you send. Every chat message is parsed to see if it is a normal chat message, or if it's a special action. These actions are much like IRC commands. For example, if I wanted to change my name from Andrew to Andy I could chat this message:
/nick andy
@@ -62,31 +62,30 @@ You can even create your own actions!
The goal of Mad Chatter is to make it easy to create, host, and customize your own chat server. Let's take a look at the different ways you can customize your new chat server.
-If you want to customize the html/css of your chatroom, you'll find it in the `web` directory.
+All of the HTML, CSS, and Javascript is available for you to customize in the `web` directory.
In the `config.yml` file you can see a few things you can customize.
-The `extensions.rb` file is for you to create your own chat extensions. You will find a few examples in that file.
+The `extensions` directory contains all of your extensions. If you wanted to create a custom action, this is where you would put it. You will find a few examples in that directory.
## Mac, Windows, and Linux Wrappers
-Once you've got your chat server running and being used by other people, you might be interested in using/distributing an installable application so your users have the convenience of clicking on an icon, receiving growl notifications, etc. Here's a list of the currently available "wrapper" applications:
+Once you've got your chat server running and being used by other people, you might be interested in using and distributing an installable application so your users have the convenience of clicking on an icon, receiving growl notifications, etc. Here's a list of the currently available "wrapper" applications:
* [Mad Chatter for Mac](https://github.com/andrewhavens/mad_chatter_for_mac)
## Getting Help / Providing Feedback
-Feel free to submit bug reports and feature requests to our [GitHub Issues page](https://github.com/andrewhavens/mad_chatter/issues), or post to the [Google Group](https://groups.google.com/group/mad-chatter), or send me a message on GitHub.
+If you need help or have feedback, feel free to submit bug reports and feature requests to our [GitHub Issues page](https://github.com/andrewhavens/mad_chatter/issues), or post to the [Google Group](https://groups.google.com/group/mad-chatter).
You can also vote on upcoming features: https://madchatter.uservoice.com
## Contributing
+Please fork and send pull requests! Or submit issues if you have suggestions on how to improve Mad Chatter.
[![Build Status](https://secure.travis-ci.org/andrewhavens/mad_chatter.png)](http://travis-ci.org/andrewhavens/mad_chatter)
-Please fork and send pull requests! Or submit issues if you have suggestions on how to improve.
-
##Copyright
-Copyright (c) 2011-2012 Andrew Havens. MIT license. See LICENSE.txt for further details.
+Created by Andrew Havens and released under the MIT license.
View
26 lib/mad_chatter/message_listeners/video.rb
@@ -0,0 +1,26 @@
+module MadChatter
+ module MessageListeners
+ class Video
+
+ include MadChatter::Actions
+
+ @@youtube = %r{^/youtube http://youtu.be/(.*)$}
+
+ def handle(message)
+ if message.original_text =~ @@youtube
+ youtube_id = parse_youtube_id(message.original_text)
+ img_msg = MadChatter::Message.new('message', nil, message.token, message.channel)
+ img_msg.html = "<iframe width='560' height='315' src='http://www.youtube.com/embed/#{youtube_id}' frameborder='0' allowfullscreen></iframe>"
+ img_msg.growl = message.username + ' has shared a YouTube video'
+ MadChatter.send_message(message)
+ stop_message_handling
+ end
+ end
+
+ def parse_youtube_id(text)
+ @@youtube.match(text).captures[0]
+ end
+
+ end
+ end
+end
View
BIN screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1 templates/config.yml
@@ -2,5 +2,4 @@
# Mad Chatter Configuration #
# ------------------------------------ #
-websocket_backend: MadChatter::Servers::EventMachineWebSocket
websocket_port: 8100

0 comments on commit 3f67c70

Please sign in to comment.