示例#1
0
        public Tweet(string id, string text, IList <TweetMedia> media)
        {
            // v2 IList<TweetMedia> to <ITweetMedia>
            Id   = id;
            Text = text;


            Emojis = Emoji.Matches(Text);

            // v2 support multiple uris
            Uris = UrlParser.GetUris(Text);

            // v2 support multiple hashtags
            Hashtags = Hashtag.Get(Text);

            // where do we get media stuff?
            Media = media;
            GetAnys();
        }
示例#2
0
        public static List <Uri> GetUris(string rawText)
        {
            List <Uri> list = null;

            // v3 if know where this string ends, could feed rest of string back through parser
            // however since a possible 2nd URI would only be used by Top and the chance a second
            // URL would be a top URL may be unlikely, not needed at this time
            var uri = UrlParser.GetUri(rawText);

            if (uri != null)
            {
                list = new List <Uri>()
                {
                    uri
                }
            }
            ;

            return(list);
        }