The following key technical points need to be focused on to realize voting tweets:
- API version selection: must be configured
TWITTER_API_KEYetc. v2 credentials with thesendTweetV2()Method Invocation (Basic)sendTweet(Not supporting the vote). - Option parameter format: Voting options should be passed as an array, for example:
await scraper.sendTweetV2('问卷内容', {
poll_options: ['选项1', '选项2'],
poll_duration: 1440 //分钟数
}); - Validity Period Limit: Twitter mandatory voting is from 5 minutes to 7 days long (need to convert to minutes to pass in).
- error handling: Capture required"Poll options must be between 2 and 4 choices".and other formatting anomalies.
Note: A maximum of 25 polls can be created within 24 hours on the same account, and poll tweets cannot be modified/ended early via the API.
This answer comes from the articleagent-twitter-client: send and retweet tweets without Twitter API keyThe































