Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-rss2irc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jérôme Charaoui
python-rss2irc
Commits
163d78d5
Commit
163d78d5
authored
Sep 5, 2016
by
lavamind
Browse files
Options
Downloads
Patches
Plain Diff
Use irc.bot facility
parent
6ae1005c
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bot.py
+5
-7
5 additions, 7 deletions
bot.py
with
5 additions
and
7 deletions
bot.py
+
5
−
7
View file @
163d78d5
...
...
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
import
threading
import
irc.
clien
t
import
irc.
bo
t
import
tinyurl
import
time
import
re
...
...
@@ -12,20 +12,18 @@ from db import FeedDB
from
config
import
Config
import
lxml.html
class
IRCBot
(
irc
.
client
.
SimpleIRCClien
t
):
class
IRCBot
(
irc
.
bot
.
SingleServerIRCBo
t
):
def
__init__
(
self
,
config
,
db
,
on_connect_cb
):
irc
.
client
.
SimpleIRCClient
.
__init__
(
self
)
self
.
__config
=
config
irc
.
bot
.
SingleServerIRCBot
.
__init__
(
self
,
[(
self
.
__config
.
HOST
,
self
.
__config
.
PORT
)],
self
.
__config
.
NICK
,
self
.
__config
.
NICK
)
self
.
__db
=
db
self
.
connect
(
self
.
__config
.
HOST
,
self
.
__config
.
PORT
,
self
.
__config
.
NICK
)
#
self.connect(self.__config.HOST, self.__config.PORT, self.__config.NICK)
self
.
__on_connect_cb
=
on_connect_cb
self
.
num_col
=
self
.
__config
.
num_col
self
.
date
=
self
.
__config
.
date
self
.
feedname
=
self
.
__config
.
feedname
def
on_welcome
(
self
,
connection
,
event
):
"""
Join the correct channel upon connecting
"""
if
irc
.
client
.
is_channel
(
self
.
__config
.
CHANNEL
):
connection
.
join
(
self
.
__config
.
CHANNEL
)
def
on_join
(
self
,
connection
,
event
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment