Open Higakinn opened 1 month ago
notionDBに祭りのポスター画像データがある場合、画像付きでXにポストできるようにする
画像をbase64でencodeするコード(参考:https://stackoverflow.com/questions/38408253/way-to-convert-image-straight-from-url-to-base64-without-saving-as-a-file-in-pyt)
import base64 import requests def get_as_base64(url): return base64.b64encode(requests.get(url).content)
https://teratail.com/questions/195943
概要
notionDBに祭りのポスター画像データがある場合、画像付きでXにポストできるようにする
対応方法案
参考
画像をbase64でencodeするコード(参考:https://stackoverflow.com/questions/38408253/way-to-convert-image-straight-from-url-to-base64-without-saving-as-a-file-in-pyt)