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); } }
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); } }
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); } }
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); } }
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; } } }