redouane59 / twittered

Twitter API client for Java developers
Apache License 2.0
238 stars 66 forks source link

Add method to get tweet url from Tweet or tweet id #283

Closed redouane59 closed 3 years ago

redouane59 commented 3 years ago

Issue just as a reminder.

    public static Optional<String> getTweetUrl(Tweet tweet) {
        if (tweet.getUser() == null || tweet.getUser().getName() == null || tweet.getId() == null) {
            return Optional.empty();
        }
        return Optional.of("https://twitter.com/" + tweet.getUser().getName() + "/status/" + tweet.getId());
    }