Git Product home page Git Product logo

rss2irc's Introduction

Python RSS2IRC Bot

This is a simple IRC bot that'll return feeds from an RSS source to 1 or more IRC channels.


Configuration

To configure the bot open config/config.py with any text editor and being with the configuration. All the details about different fields are already included as comments in the file.


Commands

Command Description
!feedReturns last 3 feeds
!feed last (1-5)Returns last 'n' number of feeds
!feed listReturns the feed list currently being used
!feed helpView this help dialogue
!creditsView bot credits

Admin commands

!loginUses NickServ to login with the bot password set in the config
!killsocketKills the bot connection

The bot can have only 1 admin. The admin is determined by the complete nick, ident and hostmask and hence, you need to configure this properly. You can look at the debug messages in the console while the bot is running to get your nick, ident and hostmask string.


Possible Snags

1. Bot is not joining the channel

Check if the bot actually connected to the network by using /whois <bot_nick> or <bot_alt_nick> if the bot is not connected then both the nick and alt_nick are occupied. If the bot is connected and yet it is not joining the channels then check the channel settings (ban masks, invite only, registered only etc.).

2. No feeds

Check if the URL you provided is working and it is a valid feed source. Here's what an RSS page looks like: https://github.com/areebbeigh.atom

3. Bot is not logging in

This bot uses NickServ to login which will happen only if the nick name it uses is regsitered. Make sure the nickname is registered and the password you have entered is correct. Also try the !login command and see if it identifies. If it still does not work the network you're connecting to probably does not use NickServ.

4. Bugs

If you find any bugs / miss typed stuff in the code please feel free to make a pull request / open an issue on this repo. You can also contact me via [email protected]

Cheers โ˜•


Developer: Areeb Beigh [[email protected]]
Version: 2.2
GitHub Repo: https://github.com/areebbeigh/RSS2IRC

rss2irc's People

Contributors

areebbeigh avatar gitter-badger avatar kcchouette avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rss2irc's Issues

Broken pipe

When using many rss sources it seems it can't coup with that, and and throws a Broken pipe when connecting to the irc channel/idenitfing. I tried adding sleep()s but didn't worked .
The traceback is bellow:

Traceback (most recent call last):
  File "rss2irc.py", line 138, in <module>
    update()
  File "rss2irc.py", line 136, in update
    feed_refresh()
  File "rss2irc.py", line 93, in feed_refresh
    msg(defaultChannel, m)
  File "rss2irc.py", line 65, in msg
    s.send('PRIVMSG '+str(defaultChannel)+' :'+str(msg)+'\r\n')
socket.error: [Errno 32] Broken pipe

RSS2IRC flood the channel

RSS2IRC print the latest feed, every 2 minutes. It should print it only once, when a new entry is created.

From the chan :

[11:30:54] --> [RSS]Cassandre ([email protected]) a rejoint #Genshiken
[11:30:54] <[RSS]Cassandre> [RSS]Cassandre Now Online - Checking latest feed - !feed help to view commands
[11:30:54] <[RSS]Cassandre> [GSK]Yolocr-OCR | https://www.nyaa.se/?page=download&tid=897339
[11:32:59] <[RSS]Cassandre> [RSS]Cassandre Now Online - Checking latest feed - !feed help to view commands
[11:32:59] <[RSS]Cassandre> [GSK]Yolocr-OCR | https://www.nyaa.se/?page=download&tid=897339
[11:33:28] <YamashitaRen> k
[11:33:38] <-- [RSS]Cassandre ([email protected]) est parti (Remote host closed the connection)

From the console :

[':[RSS][email protected]', 'JOIN', ':#Genshiken']
Joined to: set()
Kicked from: set()
[':irc.rizon.systems', '332', '[RSS]Cassandre', '#Genshiken', ':Releases', ':', 'card', 'captor', 'Sakura??', '|Macross', 'Delta', 'complete', '|', 'Tricksters', '17/24', '|', 'Kab$neri', 'complete', '(BD)', '|', 'Genshiken', 'Nidaime', '04/13', 'on', 'need', 'un', 'enco', '|', 'http://www.genshiken.tk/', '|', 'USA', 'MAKE', 'AMERICA', 'GREAT', 'AGAIN', '|', $YoloCR', ':', 'http://v.gd/jC23ic']
[':irc.rizon.systems', '333', '[RSS]Cassandre', '#Genshiken', '[email protected]', '1486578119']
[':irc.rizon.systems', '353', '[RSS]Cassandre', '=', '#Genshiken', ':[RSS]Cassandre', '@YamashitaRen', '@Tintalle', '@cavallone', '@Shuuta', 'Nala_Alan', 'Alexandre1er', 'Usavich', 'Muse-Kami-Sama', '@AnimeHQ', '+[XDCC]Genshiken|NEW']
[':irc.rizon.systems', '366', '[RSS]Cassandre', '#Genshiken', ':End', 'of', '/NAMES', 'list.']

['PING', ':irc.rizon.systems']
Responded to PING

[':[email protected]', 'PRIVMSG', '#Genshiken', ':k']

Everytime the console shows "Responded to PING", rss2irc flood the channel with the entry message.

The chan is #Genshiken on irc.rizon.net/

Can't connect to Rizon

$ python3 rss2irc.py

    ---------------------------------------------
    RSS2IRC Bot by Areeb - github.com/areebbeigh
    ---------------------------------------------
    
Attempting to identify...
b'PRIVMSG NickServ :IDENTIFY [RSS]Cassandre MyPassword\r\n'

line: [':irc.uworld.se', 'NOTICE', '*', ':***', "Couldn't", 'look', 'up', 'your', 'hostname', '(cached)']
line: [':irc.uworld.se', 'NOTICE', '*', ':***', 'Checking', 'Ident']
line: [':irc.uworld.se', 'NOTICE', '*', ':***', 'No', 'Ident', 'response']
line: ['PING', ':1254255970']
line: [':irc.uworld.se', '451', '[RSS]Cassandre', ':You', 'have', 'not', 'registered']
line: [':irc.uworld.se', '451', '[RSS]Cassandre', ':You', 'have', 'not', 'registered']
line: [':irc.uworld.se', '451', '[RSS]Cassandre', ':You', 'have', 'not', 'registered']

line: [':irc.uworld.se', '451', '[RSS]Cassandre', ':You', 'have', 'not', 'registered']

Then the console goes blank.
No issue on Freenode.

Can't connect to Recycled

$ python3 rss2irc.py 

    ---------------------------------------------
    RSS2IRC Bot by Areeb - github.com/areebbeigh
    ---------------------------------------------
    
Attempting to identify...
b'PRIVMSG NickServ :IDENTIFY RSS r\r\n'
b'PRIVMSG NickServ :IDENTIFY r\r\n'

[':Moldy.recycled-irc.net', 'NOTICE', 'AUTH', ':***', 'Looking', 'up', 'your', 'hostname...']
[':Moldy.recycled-irc.net', 'NOTICE', 'AUTH', ':***', 'Checking', 'ident...']
[':Moldy.recycled-irc.net', 'NOTICE', 'AUTH', ':***', "Couldn't", 'resolve', 'your', 'hostname;', 'using', 'your', 'IP', 'address', 'instead']
[':Moldy.recycled-irc.net', 'NOTICE', 'AUTH', ':***', 'No', 'ident', 'response;', 'username', 'prefixed', 'with', '~']
['PING', ':C844221B']
Responded to PING
[':Moldy.recycled-irc.net', '451', 'PRIVMSG', ':You', 'have', 'not', 'registered']
[':Moldy.recycled-irc.net', '451', 'PRIVMSG', ':You', 'have', 'not', 'registered']
[':Moldy.recycled-irc.net', '451', 'JOIN', ':You', 'have', 'not', 'registered']
[':Moldy.recycled-irc.net', '451', 'PRIVMSG', ':You', 'have', 'not', 'registered']

[':Moldy.recycled-irc.net', '451', 'PRIVMSG', ':You', 'have', 'not', 'registered']
:Moldy.recycled-irc.net 005 RSS STATUSMSG=@%+ EXCEPTS INVEX :are supported by 
[':Moldy.recycled-irc.net', '001', 'RSS', ':Welcome', 'to', 'the', 'Recycled', 'IRC', 'IRC', 'Network', '[email protected]']
[':Moldy.recycled-irc.net', '002', 'RSS', ':Your', 'host', 'is', 'Moldy.recycled-irc.net,', 'running', 'version', 'Unreal3.2.10.2']
[':Moldy.recycled-irc.net', '003', 'RSS', ':This', 'server', 'was', 'created', 'Thu', 'May', '22', '2014', 'at', '12:22:27', 'CEST']
[':Moldy.recycled-irc.net', '004', 'RSS', 'Moldy.recycled-irc.net', 'Unreal3.2.10.2', 'iowghraAsORTVSxNCWqBzvdHtGpI', 'lvhopsmntikrRcaqOALQbSeIKVfMCuzNTGjZ']
[':Moldy.recycled-irc.net', '005', 'RSS', 'CMDS=KNOCK,MAP,DCCALLOW,USERIP,STARTTLS', 'UHNAMES', 'NAMESX', 'SAFELIST', 'HCN', 'MAXCHANNELS=50', 'CHANLIMIT=#:50', 'MAXLIST=b:80,e:80,I:80', 'NICKLEN=30', 'CHANNELLEN=32', 'TOPICLEN=307', 'KICKLEN=307', 'AWAYLEN=307', ':are', 'supported', 'by', 'this', 'server']
[':Moldy.recycled-irc.net', '005', 'RSS', 'MAXTARGETS=20', 'WALLCHOPS', 'WATCH=128', 'WATCHOPTS=A', 'SILENCE=15', 'MODES=12', 'CHANTYPES=#', 'PREFIX=(ohv)@%+', 'CHANMODES=beIqa,kfL,lj,psmntirRcOAQKVCuzNSMTGZ', 'NETWORK=Recycled-IRC', 'CASEMAPPING=ascii', 'EXTBAN=~,qjncrRa', 'ELIST=MNUCT', ':are', 'supported', 'by', 'this', 'server']
:Moldy.recycled-irc.net 372 RSS :-                 
['this', 'server']
[':Moldy.recycled-irc.net', '251', 'RSS', ':There', 'are', '141', 'users', 'and', '593', 'invisible', 'on', '2', 'servers']
[':Moldy.recycled-irc.net', '252', 'RSS', '11', ':operator(s)', 'online']
[':Moldy.recycled-irc.net', '253', 'RSS', '1', ':unknown', 'connection(s)']
[':Moldy.recycled-irc.net', '254', 'RSS', '225', ':channels', 'formed']
[':Moldy.recycled-irc.net', '255', 'RSS', ':I', 'have', '592', 'clients', 'and', '0', 'servers']
[':Moldy.recycled-irc.net', '265', 'RSS', '592', '654', ':Current', 'local', 'users', '592,', 'max', '654']
[':Moldy.recycled-irc.net', '266', 'RSS', '734', '7576', ':Current', 'global', 'users', '734,', 'max', '7576']
[':Moldy.recycled-irc.net', '375', 'RSS', ':-', 'Moldy.recycled-irc.net', 'Message', 'of', 'the', 'Day', '-']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '9/4/2013', '20:35']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '..,;++HHHH+H+;;,.']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ',;+HHMMMMMMMMMMMMHH+;.']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.;+MMMMMMMMMMMMMMMMMMMMMH;,']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.+HHMMMMMMMMMMMMH#MMMMMMMMMMH;']
:
['.;HMMMMMMMMMMMMMMH', '+HMMMMMMMMMMMH,']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ',+MMMMMMMMMMMMMMMMH', '+MMMMMMMMMMMH;']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ';MMMMMMMMMMMMMMM#MMH', '+MMMMMMMMMMM+.']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '+HMMMMMMMMMMMMMMM##MH', ';HMMMMMMMMMM+.']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.+MMMMMMMMMMMMMMMMMMMMH', ';HMMMMMMMMMM+,']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.+MMMMMMMMMMMMMMMMMMMMMH', ';HMMMMMMMMMM+,']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.+MMMMMMMMMMMMMMMMMMMMMH', ';HMMMMMMMMMM+,']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.+MMMMMMMMMMMMMMMMMMMMMMH', ';HMMMMMMMMMM;']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '+MMMMMMMMMMMMMMMMMHHH+++;', ';HMMMMMMMMMH']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ';MMMMMMMMMMMMMMMH+;', ';HMMMMMMMMM+']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ',HMMMMMMMMMMMMMH+', ';MMMMMMMMMH']
:Moldy.recycled-irc.net 372 RSS :-         .+
['Moldy.recycled-irc.net', '372', 'RSS', ':-', '.HMMMMMMMMMMMMH+', '+MMMMMMMMM+']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ';MMMMMMMMMMMM+', 'HMMMMMMMMH']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ',HMMMMMMMMMMH;', ';MMMMMMMMM+']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '+MMMMMMMMMMH;', 'HMMMMMMMMH']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ',HMMMMMMMMM+', ';MMMMMMMMM']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', '.;MMMMMMMMM+', 'HMMMMMMMM+']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ',HMMMMMMMM+', ';HMMMMMMMMH']
[':Moldy.recycled-irc.net', '372', 'RSS', ':-', ';MMMMMMMMH', 'Recycled-IRC', '+MMMMMMMMMH']
Traceback (most recent call last):
  File "rss2irc.py", line 314, in <module>
    main()
  File "rss2irc.py", line 58, in main
    irc.connect()
  File "rss2irc.py", line 81, in connect
    read_buffer = "" + self.s.recv(1024).decode("UTF-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 118: invalid continuation byte

IRC server is irc.recycled-irc.net, port 6667, the nickname is not registred

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.