Skip to content

Commit

Permalink
Merge pull request #16 from leanprover-community/bryangingechen-patch-2
Browse files Browse the repository at this point in the history
post_issue_on_zulip.py: various mathlib4 fixes
  • Loading branch information
kim-em authored Sep 7, 2023
2 parents 640811f + bc2a66a commit d626a6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions post_issue_on_zulip.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def message_date(id):
return history['message_history'][0]['timestamp']

posted_topics = zulip_client.get_stream_topics(zulip_client.get_stream_id('triage')['stream_id'])['topics']
pattern = re.compile(r'#(\d+)')
pattern = re.compile(r'!4#(\d+)')
posted_topics = {int(v[0]): message_date(t['max_id']) for (t, v) in ((t, pattern.findall(t['name'])) for t in posted_topics) if len(v) > 0}

print(posted_topics)
Expand All @@ -48,12 +48,12 @@ def message_date(id):

def post_random(select_from, kind):
random_issue = random.choice(select_from)
topic = f'{kind} #{random_issue.number}: {random_issue.title}'
topic = f'{kind} !4#{random_issue.number}: {random_issue.title}'

content = f"""
Today I chose {kind} {random_issue.number} for discussion!
**[{random_issue.title}](https://github.com/leanprover-community/mathlib/issues/{random_issue.number})**
**[{random_issue.title}](https://github.com/leanprover-community/mathlib4/issues/{random_issue.number})**
Created by @**{random_issue.user.name}** (@{random_issue.user.login}) on {random_issue.created_at.date()}
Labels: {', '.join(l.name for l in random_issue.labels)}
Expand Down

0 comments on commit d626a6d

Please sign in to comment.