Hello,
I would like to make some form of newsfeed in my game using http://myjson.com/
If I save my json it will provide me with a URI to access my json.
URI JSON SAMPLE:
https://api.myjson.com/bins/1fyny9
MYJSON API:
http://myjson.com/api
For the json parser and builder Im using http://wiki.unity3d.com/index.php/SimpleJSON
I have the following:
IEnumerator RequestNews(WWW www)
{
yield return www;
if(www.error == null)
{
var N = JSON.Parse(www.text);
string value = N["sample"]["Title"];
Debug.Log(N);
}
else
{
Debug.Log(www.error);
gameManager.newsTexts [0].text = "Newsfeed";
gameManager.newsTexts [1].text = "No news for now.
Please check back later!".Replace("
","\n");
}
}
The api of the myjson is a bit confusing for me.
In my URI JSON SAMPLE I would like to access the value of the “Title” and the “Description”.
Can anyone help me to accomplish this?
Thank you!