リンク・カード追加

このコミットが含まれているのは:
2024-09-07 01:31:14 +09:00
コミット 5da0335c50
+11 -6
ファイルの表示
@@ -82,7 +82,7 @@ def main (
'content': 'content':
record['text']}, record['text']},
reversed (records[1:]))]) reversed (records[1:]))])
client.send_post (answer, client.post (answer,
reply_to = models.AppBskyFeedPost.ReplyRef ( reply_to = models.AppBskyFeedPost.ReplyRef (
parent = records[0]['strong_ref'], parent = records[0]['strong_ref'],
root = records[-1]['strong_ref'])) root = records[-1]['strong_ref']))
@@ -91,15 +91,20 @@ def main (
if e['contentId'] not in watched_videos]: if e['contentId'] not in watched_videos]:
watched_videos += [datum['contentId']] watched_videos += [datum['contentId']]
client.send_post (Talk.main (f""" embed_external = models.AppBskyEmbedExternal.Main (
external = models.AppBskyEmbedExternal.External (
title = datum['title'],
description = datum['description'],
uri = f"https://www.nicovideo.jp/watch/{ datum['contentId'] }"))
client.post (Talk.main (f"""
ニコニコに『{ datum['title'] }』という動画がアップされました。 ニコニコに『{ datum['title'] }』という動画がアップされました。
つけられたタグは「{ '」、「'.join (datum['tags']) }」です。 つけられたタグは「{ '」、「'.join (datum['tags']) }」です。
概要には次のように書かれています: 概要には次のように書かれています:
```html ```html
{ datum['description'] } { datum['description'] }
``` ```
このことについて、みんなに告知するとともに、ニジカちゃんの感想を教えてください。 このことについて、みんなに告知するとともに、ニジカちゃんの感想を教えてください。 """),
""")) embed = embed_external)
if now.hour == 14 and has_got_snack_time: if now.hour == 14 and has_got_snack_time:
has_got_snack_time = False has_got_snack_time = False
@@ -121,7 +126,7 @@ def main (
'日本語のテキストが表示されている。'), '日本語のテキストが表示されている。'),
image = client.com.atproto.repo.upload_blob (f).blob) image = client.com.atproto.repo.upload_blob (f).blob)
client.send_post (Talk.main ('おやつタイムだ!!!!'), client.post (Talk.main ('おやつタイムだ!!!!'),
embed = models.app.bsky.embed.images.Main ( embed = models.app.bsky.embed.images.Main (
images = [image])) images = [image]))
last_posted_at = now last_posted_at = now
@@ -131,7 +136,7 @@ def main (
has_got_snack_time = True has_got_snack_time = True
if now - last_posted_at >= timedelta (hours = 6): if now - last_posted_at >= timedelta (hours = 6):
client.send_post (Talk.main ('今どうしてる?')) client.post (Talk.main ('今どうしてる?'))
last_posted_at = now last_posted_at = now
time.sleep (60) time.sleep (60)