1

I am using C# and ASP.NET to code this. I don't want the user to be forced to log in and authorize my facebook app, so I wrote this code to get my token that works fine:

        HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://graph.facebook.com/oauth/access_token?client_id=MYID&client_secret=MYSECRET&user_id=MYUSERID&grant_type=client_credentials");
        myRequest.Method = "GET";
        WebResponse myResponse = myRequest.GetResponse();
        StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
        string result1 = sr.ReadToEnd();
        sr.Close();
        myResponse.Close();
        string token = result1.Substring(13, result1.Length - 13);

Then I wrote this code to get my recent posts:

        HttpWebRequest myRequest1 = (HttpWebRequest)WebRequest.Create(string.Format("{0}{1}","https://graph.facebook.com/app/posts?access_token=",token));
        myRequest1.Method = "GET";
        WebResponse myResponse1 = myRequest1.GetResponse();
        //StreamReader sr1 = new StreamReader(myResponse1.GetResponseStream(), System.Text.Encoding.UTF8);
        StreamReader sr1 = new StreamReader(myResponse1.GetResponseStream());
        string result2 = sr1.ReadToEnd();
        sr1.Close();
        myResponse1.Close();

How can I quickly transform this JSON object into a table?

falinhares
  • 11
  • 4
  • Duplicates of [this](http://stackoverflow.com/questions/1051061/convert-json-array-to-an-html-table-in-jquery) and [this](http://stackoverflow.com/questions/5180382/convert-json-data-to-a-html-table) previous SO questions? – simonc May 08 '12 at 09:43

0 Answers0