Exemple #1
0
 void Callback(bool success, string response)
 {
     if (success)
     {
         StatusesHomeTimelineResponse Response = JsonUtility.FromJson <StatusesHomeTimelineResponse>(response);
         for (int i = 0; i < 4; i++)
         {
             string rawString = Response.items[i].text;
             string tweet     = "";
             for (int j = 0; j < rawString.Length; j++)
             {
                 tweet += rawString[j];
                 if (j % 12 == 11)
                 {
                     tweet += "\n";
                 }
             }
             tweets[i] = tweet;
         }
     }
     else
     {
         Debug.Log(response);
     }
 }
Exemple #2
0
 void ImageCallback(bool success, string response)
 {
     if (success)
     {
         StatusesHomeTimelineResponse Response = JsonUtility.FromJson <StatusesHomeTimelineResponse>(response);
         url = Response.items[0].user.profile_image_url;
         Debug.Log(url);
     }
     else
     {
         Debug.Log(response);
     }
 }
Exemple #3
0
 void OnGetStatusesHomeTimeline(bool success, string response)
 {
     if (success)
     {
         StatusesHomeTimelineResponse Response = JsonUtility.FromJson <StatusesHomeTimelineResponse>(response);
         //			foreach (Tweet tweet in Response.items) { GenerateTweetCard (tweet); }
         TweetsNowLoaded = Response.items;
         StartCoroutine(_TweetPanelManager.LoadTweets(TweetsNowLoaded));
         StartMyStream();
     }
     else
     {
         _SystemMessageHandler.GenerateSystemMessage(response);
     }
 }
Exemple #4
0
        static void Callback(bool success, string response)
        {
            if (success)
            {
                StatusesHomeTimelineResponse Response = JsonUtility.FromJson <StatusesHomeTimelineResponse> (response);

                // Print the tweets and their author.
                Debug.Log("Success");
                Debug.Log(Response.items[0].user.name);
                Debug.Log(Response.items[0].text);
            }
            else
            {
                Debug.Log(response);
            }
        }
Exemple #5
0
    void callback(bool success, string response)
    {
        if (success)
        {
            StatusesHomeTimelineResponse Response = JsonUtility.FromJson <StatusesHomeTimelineResponse> (response);
            float y_offset = 0.0f;
            for (int i = 0; i < Response.items.Length; i++)
            {
                var lp = this.tweets[i].transform.localPosition;
                lp.y = y_offset;

                this.tweets[i].transform.localPosition = lp;

                y_offset -= this.tweets[i].create_tweet(Response.items[i]) + this.tweet_spacing;
            }
        }
    }