Update linktitler for new reddit api
This commit is contained in:
parent
493a966a03
commit
5a08b449c7
|
@ -1,4 +1,10 @@
|
||||||
{
|
{
|
||||||
"agent": "pyircbot3 by /u/(changeme)",
|
"reddit": {
|
||||||
|
"user_agent": "pyircbot3 by /u/(changeme)",
|
||||||
|
"client_id": "",
|
||||||
|
"client_secret": "",
|
||||||
|
"username": "",
|
||||||
|
"password": ""
|
||||||
|
},
|
||||||
"youtube_api_key": ""
|
"youtube_api_key": ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ RUN sed -i -e 's/archive.ubuntu.com/mirrors.digitalocean.com/' /etc/apt/sources.
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y python3 python3-setuptools python3-requests curl unzip sqlite3 && \
|
apt-get install -y python3 python3-setuptools python3-requests curl unzip sqlite3 && \
|
||||||
easy_install3 pip && \
|
easy_install3 pip && \
|
||||||
pip3 install praw pytz && \
|
pip3 install praw==5.0.1 pytz && \
|
||||||
cd /tmp && \
|
cd /tmp && \
|
||||||
curl -o bitcoinrpc.tar.gz https://codeload.github.com/dpedu/python-bitcoinrpc/tar.gz/master && \
|
curl -o bitcoinrpc.tar.gz https://codeload.github.com/dpedu/python-bitcoinrpc/tar.gz/master && \
|
||||||
tar zxvf bitcoinrpc.tar.gz && \
|
tar zxvf bitcoinrpc.tar.gz && \
|
||||||
|
|
|
@ -58,9 +58,8 @@ class LinkTitler(ModuleBase):
|
||||||
if submissionId in done:
|
if submissionId in done:
|
||||||
continue
|
continue
|
||||||
done.append(submissionId)
|
done.append(submissionId)
|
||||||
# TODO configurable user agent
|
r = praw.Reddit(**self.config["reddit"])
|
||||||
r = praw.Reddit(self.config["agent"])
|
submission = r.submission(id=submissionId)
|
||||||
submission = r.get_submission(submission_id=submissionId)
|
|
||||||
msg = "👽 \x02\x031,15REDDIT\x0f\x02 :: %(title)s \x02on \x02%(domain)s%(nsfw)s\x02 - points " \
|
msg = "👽 \x02\x031,15REDDIT\x0f\x02 :: %(title)s \x02on \x02%(domain)s%(nsfw)s\x02 - points " \
|
||||||
"\x02%(points)s\x02 (%(percent)s↑) - comments \x02%(comments)s\x02 - by \x02%(author)s\x02 on " \
|
"\x02%(points)s\x02 (%(percent)s↑) - comments \x02%(comments)s\x02 - by \x02%(author)s\x02 on " \
|
||||||
"\x02%(date)s\x02" % {
|
"\x02%(date)s\x02" % {
|
||||||
|
|
Loading…
Reference in New Issue