Exemple #1
0
 /// <summary>
 /// ホームを読み込む
 /// </summary> 
 void ReloadTimeLine_REST(TimeLineSetting tl)
 {
     string query = "";
     switch (tl.TimeLineType)
     {
         case TimeLineTypes.Home:
             query = TwitterOAuth.MakeHomeQuery(0);
             break;
         case TimeLineTypes.List:
             query = TwitterOAuth.MakeListQuery(tl.Text, 0);
             break;
     }
     twitter.GetTimeline(query, (success, body) =>
     {
         string errorMessage = null;
         if (success)
         {
             try
             {
                 Tweets newTweets = Tweets.ParseTimelineFromJson(body);
                 AddTweets(newTweets);
             }
             catch (Exception e)
             {
                 success = false;
                 errorMessage = e.Message;
             }
         }
         else
         {
             errorMessage = body;
         }
         ReloadTimeLineCompleted(success, errorMessage);
     });
 }
Exemple #2
0
 void ReloadTimeLine_Search(TimeLineSetting tl)
 {
     twitter.GetTimeline(TwitterOAuth.MakeSearchQuery(tl.Text, tl.NextID), (success, body) =>
     {
         string errorMessage = null;
         if (success)
         {
             try
             {
                 ulong id;
                 Tweets newTweets = Tweets.ParseSearchFromJson(body, out id);
                 AddTweets(newTweets);
                 tl.NextID = id;
             }
             catch (Exception e)
             {
                 success = false;
                 errorMessage = e.Message;
             }
         }
         else
         {
             errorMessage = body;
         }
         ReloadTimeLineCompleted(success, errorMessage);
     });
 }
Exemple #3
0
        void reloadTimeLineMain(TimeLineSetting tl)
        {
            SetStatus("q", Colors.Cyan, string.Format("{0}を取得中...", tl.Description));

            try
            {
                switch (tl.TimeLineType)
                {
                    case TimeLineTypes.Home:
                        ReloadTimeLine_REST(tl);
                        break;
                    case TimeLineTypes.Search:
                        ReloadTimeLine_Search(tl);
                        break;
                    case TimeLineTypes.List:
                        ReloadTimeLine_REST(tl);
                        break;
                }
            }
            catch (Exception err)
            {
                ReloadTimeLineCompleted(false, err.Message);
            }
        }