Created
December 24, 2019 17:26
-
-
Save ayutaz/3fbec9ecdbaa80723779632f6b32cf95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Twity.DataModels.Responses; | |
public class EventHandler : MonoBehaviour { | |
private config key; | |
void Start () { | |
key = GameObject.Find("Config").GetComponent<config>(); | |
Twity.Oauth.consumerKey = key.GetConsumerKey(); | |
Twity.Oauth.consumerSecret = key.GetConsumerSecret(); | |
Twity.Oauth.accessToken = key.GetAccessToken(); | |
Twity.Oauth.accessTokenSecret = key.GetAccessTokenSecret(); | |
Dictionary<string, string> parameters = new Dictionary<string, string>(); | |
parameters ["q"] = "悠遠物語"; | |
parameters ["count"] = 30.ToString();; | |
StartCoroutine (Twity.Client.Get ("search/tweets", parameters, Callback)); | |
} | |
void Callback(bool success, string response) { | |
if (success) { | |
SearchTweetsResponse Response = JsonUtility.FromJson<SearchTweetsResponse> (response); | |
// Debug.Log(Response.statuses[2].text); | |
for(int i = 0;i <Response.statuses.Length;i++){ | |
string text = Response.statuses[i].text; | |
Debug.Log(text); | |
} | |
} else { | |
Debug.Log (response); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
再書