Ignore:
Timestamp:
2015-05-02T21:03:35Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
cd60710
Parents:
40cfbc5
Message:

Add "url" command to Twitter module to get web URL for a Tweet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    r40cfbc5 r9ed8175  
    10031003                in_reply_to = id;
    10041004                allow_post = TRUE;
     1005        } else if (g_strcasecmp(cmd[0], "url") == 0) {
     1006                id = twitter_message_id_from_command_arg(ic, cmd[1], &bu);
     1007                if (!id) {
     1008                        twitter_log(ic, "Tweet `%s' does not exist", cmd[1]);
     1009                } else {
     1010                        /* More common link is twitter.com/$UID/status/$ID (and that's
     1011                         * what this will 302 to) but can't generate that since for RTs,
     1012                         * bu here points at the retweeter while id contains the id of
     1013                         * the original message. */
     1014                        twitter_log(ic, "https://twitter.com/statuses/%lld", id);
     1015                }
     1016                goto eof;
     1017
    10051018        } else if (g_strcasecmp(cmd[0], "post") == 0) {
    10061019                message += 5;
Note: See TracChangeset for help on using the changeset viewer.