great084 / twitter_tool

ツイッターツールの開発
0 stars 0 forks source link

[機能追加]ツイート保存時の取得条件追加 #65

Open great084 opened 3 years ago

great084 commented 3 years ago

概要

APIの上限回数などを踏まえて、ツイート保存時に取得条件を設定できるようにする。 具体的には、リツイート数、いいね数 (共に xx以上で指定)

実装内容

その他情報

domi10momo commented 3 years ago

検索API調べていますが、いいね数、リツイート数の下限を指定するクエリが出てきません。 https://developer.twitter.com/en/docs/twitter-api/premium/search-api/guides/operators

同様で、返信除外のためのクエリis:replyも使用できないようです。 API叩く前にいいね数、リツイート数、返信用のツイートかどうかの条件指定方法を見つけることができず、止まっています。

何か有効な手段があればご教授いただきたいです。

リクエスト①(いいね数指定) "query": "min_faves:100 from:#{search_params['login_user']}"

レスポンス① "{\"error\":{\"message\":\"There were errors processing your request: Reference to invalid field 'min_faves' (at position 1), Reference to invalid operator 'min_faves'. Operator is not available in current product or product packaging. Please refer to complete available operator list at http://t.co/operators. (at position 1)\",\"sent\":\"2021-01-04T14:04:20+00:00\",\"transactionId\":\"000c654d0064605d\"}}"



リクエスト②(返信ツイート判定) "query": "-is:reply from:#{search_params['login_user']}"

レスポンス② "{\"error\":{\"message\":\"There were errors processing your request: Reference to invalid operator 'is:reply'. Operator is not available in current product or product packaging. Please refer to complete available operator list at http://t.co/operators. (at position 5)\",\"sent\":\"2021-01-04T14:23:03+00:00\",\"transactionId\":\"002c8ff800499feb\"}}"

great084 commented 3 years ago

@domi10momo 私もmin_faves:, min_retweets:が使えるかと思っていたのですが、ダメみたいですね。 他の文献調べてみましたが、7daysのsearch tweetでは使えそうなのですが。。 現状打つ手なしですので、当タスク保留にしましょう。