diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2022-06-21 22:45:29 +0100 | 
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2022-06-21 22:45:29 +0100 | 
| commit | 790ca4d3083f8226360dc6eebe35a454f317bb15 (patch) | |
| tree | 4417819c0d1157ca9e39ca35cfd9a061cee98285 /onceaday | |
| parent | 71cfc302f7b6ace903eea828f5bd37956f511ddf (diff) | |
| download | SmallYTChannelBot-790ca4d3083f8226360dc6eebe35a454f317bb15.tar.gz SmallYTChannelBot-790ca4d3083f8226360dc6eebe35a454f317bb15.zip | |
Depreciated wiki editing, minimized docker images
Diffstat (limited to 'onceaday')
| -rw-r--r-- | onceaday/Dockerfile | 6 | ||||
| -rw-r--r-- | onceaday/onceaday.py | 13 | ||||
| -rw-r--r-- | onceaday/requirements.txt | 5 | 
3 files changed, 5 insertions, 19 deletions
| diff --git a/onceaday/Dockerfile b/onceaday/Dockerfile index 78c88f8..32e28bd 100644 --- a/onceaday/Dockerfile +++ b/onceaday/Dockerfile @@ -1,7 +1,7 @@ -FROM debian:latest +FROM jwansek/smallytchannelbot  MAINTAINER Eden Attenborough "eddie.atten.ea29@gmail.com" -RUN apt-get update -y -RUN apt-get install -y tzdata python3-pip python-dev build-essential pkg-config cron libjpeg-dev zlib1g-dev +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y tzdata cron  COPY . /app  WORKDIR /app  COPY onceaday/crontab /etc/cron.d/oad-crontab diff --git a/onceaday/onceaday.py b/onceaday/onceaday.py index 97705c7..7762d05 100644 --- a/onceaday/onceaday.py +++ b/onceaday/onceaday.py @@ -30,7 +30,7 @@ def main():      sidebar = subreddit.SUBREDDIT.mod.settings()["description"]      oldtable = sidebar.split("------")[-1] -    subreddit.SUBREDDIT.wiki['config/sidebar'].edit(sidebar.replace(oldtable, "\n\n## Monthly Lambda Leaderboard\n\n" + leaderboard)) +    subreddit.SUBREDDIT.wiki['config/sidebar'].edit(content = sidebar.replace(oldtable, "\n\n## Monthly Lambda Leaderboard\n\n" + leaderboard))      subreddit.display("Updated in old reddit...")      subreddit.display("Completed.") @@ -45,8 +45,6 @@ def update_tables(scores, data):      bylambda = [i for i in sorted(scores, key = itemgetter(1), reverse = True) if i[0] not in mods][:10]      byhelps = sorted(scores, key = itemgetter(2), reverse = True)[:10] -    subreddit.SUBREDDIT.stylesheet.upload("wikigraph", imagepath) -      content += "\n\n##/r/SmallYTChannel lambda tables: %s" % date      content += "\n\n###By lambda:" @@ -66,15 +64,8 @@ def update_tables(scores, data):      content += "the most up-to-date graph will be shown below. To see the graph at this date, follow [this link.](%s)" % (imageurl)      content += "\n\n\n\nTotal λ in circulation|Useful advice given|Unique users\n:--|:--|:--\n%i|%i|%i" % (data[-1][1], data[-1][2], data[-1][3]) -    subreddit.REDDIT.subreddit("u_SmallYTChannelBot").submit("/r/SmallYTChannel Statistics: %s" % date, url = imageurl).reply(content).mod.distinguish(sticky = True) - -    subreddit.SUBREDDIT.wiki["lambdatables"].edit(content, reason = "Update: %s" % date) -    subreddit.SUBREDDIT.wiki[date].edit(content, reason = "Update: %s" % date) - -    currentdata = subreddit.SUBREDDIT.wiki["index"].content_md -    currentdata += "\n\n* [%s](/r/SmallYTChannel/wiki/%s)" % (date, date) +    subreddit.REDDIT.subreddit("u_SmallYTChannelBot").submit("/r/SmallYTChannel Statistics: %s" % date, url = imageurl).reply(content) -    subreddit.SUBREDDIT.wiki["index"].edit(currentdata, reason = "Update: %s" % date)  def get_mods():      return [str(i) for i in subreddit.SUBREDDIT.moderator()] + ["AutoModerator"] diff --git a/onceaday/requirements.txt b/onceaday/requirements.txt index 23c2cef..e3a623c 100644 --- a/onceaday/requirements.txt +++ b/onceaday/requirements.txt @@ -1,6 +1 @@ -praw==7.1.0  matplotlib==3.3.4 -PyMySQL==0.9.3 -imgurpython==1.1.7 -google_api_python_client==1.12.8 -js2py==0.70 | 
