前提
Twitterの自分がいいねしたツイートをNotionへ保存したく、
下記コードをダウンロードしてみたのですが400エラーが出てしまいます
https://github.com/yukinakai/fav_tweet_to_notion
実現したいこと
Twitterの自分がいいねしたツイートをNotionへ保存
元々はzapierを使用していたのですが、ギャラリービューでのサムネ画像の取得が難しく、下記noteに辿り着きました
https://note.com/yukinakai1020/n/n7fe38a5917e1
発生している問題・エラーメッセージ
2022-07-14 22:08:02,165:INFO:main.py:9:{'status': 'success', 'action': 'get tweets in notion'} 2022-07-14 22:08:02,388:ERROR:twitter.py:26:{'action': 'post notion endpoint', 'statud_code': 400, 'message': '{"errors":[{"parameters":{"id":["xxxx"]},"message":"The `id` query parameter value [xxxx] is not valid"}],"title":"Invalid Request","detail":"One or more parameters to your request was invalid.","type":"https://api.twitter.com/2/problems/invalid-request"}', 'data': {'max_results': 100, 'expansions': 'attachments.media_keys,author_id,referenced_tweets.id,referenced_tweets.id.author_id', 'tweet.fields': 'attachments,author_id,created_at,id,text,referenced_tweets', 'user.fields': 'name,username,profile_image_url', 'media.fields': 'url'}}
xxxxは自分のTwitter ID名が入っています。
該当のソースコード
https://github.com/yukinakai/fav_tweet_to_notion
試したこと
- python-dotenv、requests、requests-oauthlibはインストール済みです
- 各種APIコード等は環境変数で自分の発行したものに変更しています。
- Twitter APIはStandalone AppsではなくElevatedにしています(エラーの原因になることがあるという記事を読んだため)
- Notionは作者のデモページを自分のNotionにコピーし、データベースIDもそのコピーしたページのものを指定しました
補足情報(FW/ツールのバージョンなど)
Python3.8.12
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。