aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2017-08-05 15:47:29 +0200
committerThomas "Cakeisalie5" Touhey <thomas@touhey.fr>2017-08-05 15:47:29 +0200
commit3430fec2318d94b0387dafbb294c3112af2c9f72 (patch)
tree36e438b927386b5453d55ef5c4fccd3ff53eb8ef
parentd86a7374ea465ea23ea6e314ea06a48be7fb8663 (diff)
Modified way to post topic.
-rw-r--r--Utilities/AccountManager.py5
-rwxr-xr-xmain.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/Utilities/AccountManager.py b/Utilities/AccountManager.py
index daad76d..51d3dc3 100644
--- a/Utilities/AccountManager.py
+++ b/Utilities/AccountManager.py
@@ -104,4 +104,9 @@ class AccountManager:
Mastodon(client_id = mapp, api_base_url = mbase,
access_token = muser).toot(message)
+ def post_topic(self, topic):
+ msg = "Nouveau topic par {} : {}\n{}".format(topic.poster.name,
+ topic.title, topic.link())
+ self.post(msg)
+
# End of file.
diff --git a/main.py b/main.py
index e849c78..bfff8f6 100755
--- a/main.py
+++ b/main.py
@@ -56,8 +56,6 @@ if __name__ == "__main__":
for topic in cache:
print("[+] Publishing post for topic {}".format(topic.id))
- msg = "Nouveau topic par {} : {}\n{}".format(topic.poster.name,
- topic.title, topic.link())
- mgr.post(msg)
+ mgr.post_topic(topic)
# End of file.