GetUrlsAndHashtagsFromStatusValueDictionary() public static method

public static GetUrlsAndHashtagsFromStatusValueDictionary ( Object>.Dictionary statusValueDictionary, System.Boolean expandUrls, String &urls, String &hashtags ) : void
statusValueDictionary Object>.Dictionary
expandUrls System.Boolean
urls String
hashtags String
return void
Esempio n. 1
0
        TryFromStatusValueDictionary
        (
            Dictionary <String, Object> statusValueDictionary,
            Boolean expandStatusUrls,
            out TwitterStatus twitterStatus
        )
        {
            Debug.Assert(statusValueDictionary != null);

            twitterStatus = null;

            // Get the status information.

            String statusID, statusText;

            if (
                !TwitterJsonUtil.TryGetJsonValueFromDictionary(
                    statusValueDictionary, "id_str", out statusID)
                ||
                !TwitterJsonUtil.TryGetJsonValueFromDictionary(
                    statusValueDictionary, "text", out statusText)
                )
            {
                return(false);
            }

            String statusDateUtc;

            if (TwitterJsonUtil.TryGetJsonValueFromDictionary(
                    statusValueDictionary, "created_at", out statusDateUtc))
            {
                statusDateUtc = TwitterDateParser.ParseTwitterDate(statusDateUtc);
            }

            String latitude, longitude;

            TwitterGraphMLUtil.GetLatitudeAndLongitudeFromStatusValueDictionary(
                statusValueDictionary, out latitude, out longitude);

            String statusUrls, statusHashtags;

            TwitterGraphMLUtil.GetUrlsAndHashtagsFromStatusValueDictionary(
                statusValueDictionary, expandStatusUrls, out statusUrls,
                out statusHashtags);

            String inReplyToStatusID;

            TwitterJsonUtil.TryGetJsonValueFromDictionary(
                statusValueDictionary, "in_reply_to_status_id_str",
                out inReplyToStatusID);

            // Note that null date, coordinates, URLs hashtags, and in-reply-to-ID
            // are acceptable here.

            twitterStatus = new TwitterStatus(
                statusID, statusText, statusDateUtc, latitude, longitude,
                statusUrls, statusHashtags, inReplyToStatusID);

            return(true);
        }