How do I create a thread of tweets? 🧵 #400
-
Due to the character limitation of tweets, threads are a popular method of communicating much more detailed information in the form of a series of tweets which are chained to each other. How can I implement a thread with this package? Would love an example. Example of a thread: https://twitter.com/argentHQ/status/1516831519599472641 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @MarkOSullivan94 , thanks for using this package! 🐦 This package supports tweeting for making a thread, you can make it with following code :) import 'package:twitter_api_v2/twitter_api_v2.dart' as v2;
Future<void> main() async {
final twitter = v2.TwitterApi(bearerToken: 'YOUR_TOKEN_HERE');
try {
await twitter.tweetsService.createTweet(
text: 'This is a thread!',
// To represent a thread, the reply feature is used.
reply: v2.TweetReplyParam(
// Specify the ID of the tweet for which you want to create a thread.
inReplyToTweetId: '1561165898718752769',
),
);
} on v2.TwitterException catch (e) {
print(e);
}
} And the following tweet is the result of executing the above code. You can see that a thread has been created in the form of a connection to the parent tweet :) |
Beta Was this translation helpful? Give feedback.
-
Hi @MarkOSullivan94 , thanks for very interesting suggestions :) This package does not yet provide such utilities, but such features would improve the UX for developers. I think the method of creating threads by prefixing or suffixing them with a page number is a great idea. If we were to implement this, we could add a method that accepts multiple objects representing the pages of the thread. That way, the developer can create threads without being aware of paging. This is a very interesting idea, although there will be things to consider :) |
Beta Was this translation helpful? Give feedback.
Hi @MarkOSullivan94 , thanks for using this package! 🐦
This package supports tweeting for making a thread, you can make it with following code :)
And the followin…