diff --git a/quiz/management/commands/auto_publish.py b/quiz/management/commands/auto_publish.py
index 5ed9a9e..85db793 100644
--- a/quiz/management/commands/auto_publish.py
+++ b/quiz/management/commands/auto_publish.py
@@ -12,23 +12,23 @@
class Command(BaseCommand):
def add_arguments(self, parser):
- parser.add_argument('--skip-tweet', action='store_true')
+ parser.add_argument('--skip-socials', action='store_true')
def handle(self, *args, **options):
- skip_tweet = options["skip_tweet"]
+ skip_socials = options["skip_socials"]
for q in Question.objects.filter(state='SCH', publish_time__lte=timezone.now()):
print(f"Publishing question {q}")
q.state = 'PUB'
q.save()
- if (q.tweet_text):
- print(f"Posting to Twitter: '{q.tweet_text}'")
- if skip_tweet:
- print("Skipping!")
+ if (q.socials_text):
+ if skip_socials:
+ print("Skipping posting to social media!")
else:
- self.tweet(q.tweet_text)
+ self.post_to_x(q.socials_text)
- def tweet(self, content):
+ def post_to_x(self, content):
+ print(f"Posting to X: '{content}'")
try:
secrets_file = Path.home() / ".cppquiz-secrets.json"
with secrets_file.open() as f:
@@ -41,7 +41,7 @@ def tweet(self, content):
response = client.create_tweet(
text=content
)
- print(f"Posted https://twitter.com/user/status/{response.data['id']}")
+ print(f"Posted https://x.com/user/status/{response.data['id']}")
except Exception as e:
- print(f"Failed to tweet '{content}' due to exception '{e}'")
+ print(f"Failed to post '{content}' to X due to exception '{e}'")
sys.exit(1)
diff --git a/quiz/management/commands/text_generator.py b/quiz/management/commands/text_generator.py
index d4a30ca..fdfda79 100644
--- a/quiz/management/commands/text_generator.py
+++ b/quiz/management/commands/text_generator.py
@@ -106,7 +106,7 @@ def get_result_display(question):
- Other ideas for help are also welcome, please get in touch (see [Questions](#questions) below).
### Questions
-If you have any questions, either file an issue in this repo, contact [@knatten on Twitter](https://twitter.com/knatten), or email me at anders@knatten.org.
+If you have any questions, either file an issue in this repo, contact [@knatten on X](https://x.com/knatten), or email me at anders@knatten.org.
"""
pull_request_template = """ Fixes #C++ Quiz
CoC |
Mastodon |
Bluesky |
-
Twitter |
+
X |
© Anders Schau Knatten {% now "Y"%}.
diff --git a/templates/quiz/finished.html b/templates/quiz/finished.html index 3d9cbed..42feb41 100644 --- a/templates/quiz/finished.html +++ b/templates/quiz/finished.html @@ -20,9 +20,9 @@
You finished with {{quiz_in_progress.score|floatformat:2}} out of {{quiz_in_progress.get_total_nof_questions|floatformat:1}} possible points.
-Now boast about it on Twitter!
+Now boast about it on X!
-(This link takes you to Twitter.com, we would never post on your behalf).
+(This link takes you to x.com, we would never post on your behalf).
diff --git a/templates/quiz/help.html b/templates/quiz/help.html index f771e2b..0d88404 100644 --- a/templates/quiz/help.html +++ b/templates/quiz/help.html @@ -4,7 +4,7 @@ Continue quiz
-C++ Quiz is written by Anders Schau Knatten with valuable input from Olve Maudal, Fernando Cacciola, other members of the ACCU, and several other contributors. If you discover any errors, or would like to contribute, please contact me at anders AT knatten.org, on Twitter, or on GitHub. +C++ Quiz is written by Anders Schau Knatten with valuable input from Olve Maudal, Fernando Cacciola, other members of the ACCU, and several other contributors. If you discover any errors, or would like to contribute, please contact me at anders AT knatten.org, on X, or on GitHub.
If you know C++, by adding more questions, or joining our mailing-list cppquiz-discuss@cppquiz.org. If you know Python/Django/JavaScript, by extending functionality. If you know web-design, by improving the design. Please contact me at anders AT knatten.org or Twitter.
+If you know C++, by adding more questions, or joining our mailing-list cppquiz-discuss@cppquiz.org. If you know Python/Django/JavaScript, by extending functionality. If you know web-design, by improving the design. Please contact me at anders AT knatten.org or X.