{"id":13715548,"url":"https://github.com/RJ/irccat","last_synced_at":"2025-05-07T04:30:54.249Z","repository":{"id":477801,"uuid":"103213","full_name":"RJ/irccat","owner":"RJ","description":"IRC bot that simplifies posting to IRC from shell scripts","archived":true,"fork":false,"pushed_at":"2018-11-14T15:13:30.000Z","size":2362,"stargazers_count":276,"open_issues_count":5,"forks_count":37,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-05T13:13:54.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.metabrew.com/article/how-we-use-irc-at-lastfm/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-01-08T10:43:14.000Z","updated_at":"2024-06-15T18:08:15.000Z","dependencies_parsed_at":"2022-07-04T19:00:31.193Z","dependency_job_id":null,"html_url":"https://github.com/RJ/irccat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Firccat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Firccat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Firccat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJ%2Firccat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RJ","download_url":"https://codeload.github.com/RJ/irccat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252813683,"owners_count":21808370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T00:01:00.350Z","updated_at":"2025-05-07T04:30:52.739Z","avatar_url":"https://github.com/RJ.png","language":"Java","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"## Archived - See irccloud/irccat\n\nI'm not running this java version any more, please see this [irccat clone in go](https://github.com/irccloud/irccat).\n\n\n\n\n\n\n\n\nIRCcat\n======\n\nAs in `cat` to IRC. \n\nIRCcat does 2 things:\n\n1) Listens on a specific ip:port and writes incoming data to an IRC channel.\n   This is useful for sending various announcements and log messages to irc\n   from shell scripts, Nagios and other services.\n\n2) Hands off commands issued on irc to a handler program (eg: shell script)\n   and responds to irc with the output of the handler script. This only \n   happens for commands addressed to irccat: or prefixed with ?.\n   (easily extend irccat functionality with your own scripts)\n\n\nInstallation\n------------\nEdit the irccat.xml so it knows which irc server, channel etc..\nCheck you have sun jvm \u003e=1.5 (java -version)\n\nThis will build and package irccat as a jar:\n\n$ ant dist\n\nThen, using the appropriate config file:\n\n$ ant -Dconfigfile=./examples/irccat.xml run\n\nAlso, you'll probably want to install netcat.\n\n\nSending text to IRC\n-------------------\nBy default IRCCat listens on 127.0.0.1:12345, and sends data to the \ndefault (first) channels.  In a networked server environment you will p\nrobably want to make it listen on the private LAN interface.\n\nExamples: \n\n$ echo \"Hello World\" | netcat -q0 localhost 12345\n$ tail -f /var/log/www/error.log | netcat localhost 12345\n\nIn a server environment, consider adding a hostname to your internal DNS or \nusing a virtual IP for irccat to listen on, in case you want to move irccat\nto another box later.\n\n\nSending to specific channels\n----------------------------\nTo send to a specific channel rather than the default, put the channel name\nas the first word in the data (the channel name will be stripped):\n\n$ echo \"#mychannel hello world\" | netcat -q0 machinename 12345\n\nThis sends \"hello world\" to #mychannel\n\nFirst word defines the recipients, you can use comma separated list. \n# prefix indicates channel, @ indicates a nick.\n\nExamples:\n\t\n\t- \"#chan blah blah\"\n\t  just sends to #chan\n\t\n\t- \"@RJ psst, this is a pm\"\n\t  just sends via PM to user RJ\n\t\n\t- \"#channel1,#channel2,@RJ,@Russ blah blah this is the message\"\n\t  this sends to 2 channels, and 2 users (RJ, Russ)\n\t\n\t- \"#* Attention, something important\"\n\t  this sends to all channels the bot is in\t\n\t\n\t- \"#chan %REDroses are red%NORMAL, grass is #GREENgreen#NORMAL\"\n\t  you can use colors too, see IRCCat.java for the full list;\n\t  Either \"#\" or \"%\" will work.\n\n\n\nChanging topics in channels\n---------------------------\nTo change the topic in a channel (rather than sending a message), use\nthe prefix %TOPIC.\n\n$ echo \"%TOPIC #mychannel hello world\" | netcat -q0 machinename 12345\n\nThis changes the topic of #mychannel to \"hello world\" (assuming the bot\nhas permission to set the topic)\n\nSecond word defines the recipient channels. You can use a comma separated\nlist. Nick recipients will be accepted, but silently ignored.\n\nExamples:\n\n  - \"%TOPIC #chan new topic\"\n    just changes the topic of #chan\n\n  - \"%TOPIC #channel1,#channel2 this channel is great\"\n    this changes the topics of two channels\n\n  - \"%TOPIC #* Important Topic\"\n    this changes the topics in all channels the bot is in\n\n\nBuilt-in commands\n-----------------\nThere are a handful of built-in commands for instructing the bot at runtime.\n\nBuilt-in commands are prefixed with a !\n\n\t!join #chan pass\t\t- joins another channel. pass is optional\n\t!part #chan\t\t\t\t- parts chan\n\t!channels\t\t\t\t- lists channels the bot is in\n\t!spam blah blah..\t\t- repeats your message in all joined channels\n\t!exit\t\t\t\t\t- System.exit()\n\nTrust\n-----\n\nAny command (?.. !..) uttered in a channel with irccat in is executed and \nimplicitly trusted. \n\nAny command PMed to irccat is ignored unless the user \nis joined to the default (first) channel in the config file.\n\t\n\nSVN commit notifications\n------------------------\nsvn hooks let you announce commits etc.\nFor example, try this in your SVN repo/hooks/post-commit file:\n\nREPOS=\"$1\"\nREV=\"$2\"\nLOG=`/usr/bin/svnlook log -r $REV $REPOS`\nAUTHOR=`/usr/bin/svnlook author -r $REV $REPOS`\necho \"SVN commit by $AUTHOR (r$REV) '$LOG' http://web-svn-interface.example.com/?rev=$REV\" | netcat -q0 machinename 12345\n\n\nNagios alerts to irc\n--------------------\nBuried in our nagios config is this, from misccommands.cfg:\n\ndefine command {\n    command_name    host-notify-by-irc\n    command_line    /bin/echo \"#sys Nagios: Host '$HOSTALIAS$' is $HOSTSTATE$ - Info: $OUTPUT$\" | /bin/netcat -q 1 irccathost 12345\n}\n\ndefine command {\n    command_name    service-notify-by-irc\n    command_line    /bin/echo \"#sys Nagios: Service $SERVICEDESC$ on '$HOSTALIAS$' is $SERVICESTATE$ - Info: $OUTPUT$\" | /bin/netcat -q 1 irccathost 12345\n}\n\nAnd in contacts.cfg:\n\ndefine contact{\n        contact_name                    irccat\n        alias                   irccat\n        service_notification_period     24x7\n        host_notification_period        24x7\n        service_notification_options    w,c,r\n        host_notification_options       d,r\n        service_notification_commands service-notify-by-irc\n        host_notification_commands  host-notify-by-irc\n        email   blah@blah\n}\n\nFeedback\n--------\nEmail:  rj@metabrew.com\nWeb:    http://www.last.fm/user/RJ (work, and the reason irccat exists)\nWeb:    http://www.metabrew.com/   (blog)\nIrc:    irc://irc.audioscrobbler.com/audioscrobbler\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRJ%2Firccat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRJ%2Firccat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRJ%2Firccat/lists"}