Apachai.Apachai.FetchTweetInformations C# (CSharp) Method

FetchTweetInformations() private method

private FetchTweetInformations ( IManosContext ctx, string id ) : void
ctx IManosContext
id string
return void
        public void FetchTweetInformations(IManosContext ctx, string id)
        {
            if (string.IsNullOrEmpty (id))
                 ctx.Response.HandleEmptyJson ();

            string json;
            if (store.TryGetCachedTwitterInfos (id, out json)) {
                ctx.Response.HandleJson (json);
                return;
            }

            string avatar, tweet, screenname, name, url, desc;
            store.GetTwitterInfosFromImage (id, out avatar, out tweet, out screenname, out name, out url, out desc);

            JsonStringDictionary dict = new JsonStringDictionary ();
            dict["avatar"] = avatar;
            dict["tweet"] = System.Web.HttpUtility.HtmlEncode (tweet);
            dict["name"] = name;
            dict["screenname"] = screenname;
            dict["url"] = url;
            dict["desc"] = desc;

            json = dict.Json;
            store.SetCachedTwitterInfos (id, json);

            ctx.Response.HandleJson (json);
        }