Exemplo n.º 1
0
    void Callback(bool success, string response)
    {
        if (success)
        {
            // if you successfully receive the twitter info,
            // execute this area
            SearchTweetsResponse Response = JsonUtility.FromJson <SearchTweetsResponse> (response);

            // statuses[0] returns the most recent tweet

            // anatomy of the JSON object that it returns
            Debug.Log(Response.statuses[0].text);
            Debug.Log(Response.statuses[0].user);
            Debug.Log(Response.statuses[0].created_at);


            // call a function from another script!
            GetComponent <GenText>().DropText(Response.statuses[0].text);
        }
        else
        {
            // if you dont successfully retrieve the info, execute this
            Debug.Log(response);
        }
    }
Exemplo n.º 2
0
 void OnGetSearchTweets(bool success, string response)
 {
     if (success)
     {
         SearchTweetsResponse Response = JsonUtility.FromJson <SearchTweetsResponse> (response);
         foreach (Tweet tweet in Response.statuses)
         {
             _TweetPanelManager.GenerateTweetCardAtRandomPosition(tweet);
         }
     }
     else
     {
         _SystemMessageHandler.GenerateSystemMessage(response);
     }
 }
Exemplo n.º 3
0
    void Callback(bool success, string response)
    {
        if (success)
        {
            // if you successfully receive the twitter info,
            // execute this area
            SearchTweetsResponse Response = JsonUtility.FromJson <SearchTweetsResponse> (response);

            // statuses[0] returns the most recent tweet

            // anatomy of the JSON object that it returns
            Debug.Log(Response.statuses[0].text);
            Debug.Log(Response.statuses[0].user);
            Debug.Log(Response.statuses[0].created_at);

            Tweettext.text = Response.statuses [0].text;
        }
        else
        {
            // if you dont successfully retrieve the info, execute this
            Debug.Log(response);
        }
    }