

You can also privately message other users in most cases. It’s also possible to configure your user account on a network, or your client, not to get such messages.

A channel usually has a specific topic, and a name that starts with a “#”, such as #hyundai-cars. When you enter or join that channel, it’s because you want to discuss that topic. Each network has one or more servers around the world that work together to relay messages.Įach network also has many channels, sometimes called rooms, where users can gather. There are many separate IRC networks on the internet. The clients all use the IRC protocol, a set of agreed upon rules for communication. IRC servers on the internet accept and relay messages to connected users, each of whom is running an IRC client. However, it’s also simple to get started using it with tools in Fedora. It’s a time-tested system with a wealth of features. Although there are new apps like Slack that mimic it, IRC itself has been around for decades.
#IRC RSS BOT CODE#
The source code in this article is released under the CC 0 licence.IRC, short for Internet Relay Chat, is a great way for individuals and teams to communicate and work together. This article is released under the CC BY-SA licence. Project has a blog, why not fetching the RSS or Atom feed and pushing it back And since making the bot sending new messages is as easyĪs writing to a file, it should not be difficult to add new services. The core logic of the bot allows you to play around with the git hook without If you keep the commit author in its messages, you will get highlighted forĪs you have seen, that was pretty simple. Now you should have a working IRC bot sending commit messages to your channel.

#IRC RSS BOT MANUAL#
If you want to change how commits are displayed, I can point you to the prettyįormats section of the manual page for git log. It should work in most of the cases: only some rare actions (e.g.Ĭreating of a new tag) are expected to send non accurate messages to the IRC Nothing really complex here, just plain bash code getting data from gitĬalls. Git log -format = ' %h %an %s%n' $commits -reverse > $out $newrev " fi # count number of commits num = $(git log -format = '%h' $commits |wc -l ) s = $( & echo 's' ) # plural # generate messages echo " $num commit $s pushed to $repo / $branch " > $out
#IRC RSS BOT FREE#
Need to create a Git hook named post-receive on the server with the followingĬontent: #!/bin/bash # configuration path =/tmp/gitircbot # where the files created by ii go server = '' channel = '#yourproject' # file to append messages to out = " $path / $server / $channel /in" # read input, extract branch&repo names read oldrev newrev refīranch = $ repo = $(basename $( pwd ) |sed 's/\.git$//' ) # feel free to hardcode it # commits to consider if then # new branch! echo " New branch: $repo / $branch " > $out # get all revisions specific to this branch commits = " $(git for-each-ref -format = '%(refname)' 'refs/heads/*' \ |grep -v " $ref " |sed 's/^/\^/' ) $newrev " else # range of revisions commits = " $oldrev. Generated by ii when someone pushed some commits. Sleep 5 echo "/j $channel " > " $path / $server /in" # if the bot disconnects, go back to square one wait " $pid " done Git hookĪt that point, you only need your Git server to write to one of the out files Ii -s " $server " -i " $path " -n " $bot_pseudo " -f " $bot_realname " & pid = " $! " # connect to the IRC channel #!/bin/bash # configuration path =/tmp/gitircbot # where the files created by ii go server = '' channel = '#yourproject' bot_pseudo = 'GitIRCBotMadeSimple' bot_realname = 'My super Git IRC bot that I created in 5 minutes' # launch the bot while true do # connect to the IRC server Just make sure that theįollowing bash script gets executed when your computer starts (doing so depends Reconnects to the IRC channel if anything went wrong. Then, you want it to be run when your computer starts, and automagically Probably already in the repositories of your distribution. In the out files, and if you write into the in files, your messages willĮnd up in the channel. Messages sent in those channels will written When run, it creates an architecture of files to match theĬhannels you are connected to.
#IRC RSS BOT SOFTWARE#
This IRC software is simple, small,īeautiful, KISS. In other words, you needĪn IRC bot announcing git commits as they are pushed! Set up iiįirst, you need a program which connects to your IRC channel and stay there all Gitolite which is very handy when it comes to managing users andĪnd now you have an IRC channel for your project, and would like to letĮveryone see when a commit is pushed to your server. You have probably moved from a bare Git server to something like Your own Git server to serve your own projects.īut then, people have started to get interested and are contributing as well: At some point, you have decided to set up
