Friday, December 5, 2014

Tutorial 4 - Display array in processing

Show my last progress to my tutor today, and he mentioned that I don't have to display the php into thumbnail but important is to decode it in JSON format,  so processing can read and grab data from php. Today lesson : JSON array


Notes of discussions

1. decode to JSON format with JSON viewer

2. use JsonArray and JsonObject for processing

3.  Twitter rate limit API .  The results always turn to null when the rate is exceeded. It is one of the most troublesome problem for this project.  Further details written in Twitter page ,
( https://dev.twitter.com/rest/public/rate-limiting )
It stated that " if a method allows for 15 requests per rate limit window, then it allows you to make 15 requests per window per leveraged access token. Rate limits in version 1.1 of the API are divided into 15 minute intervals, which is a change from the 60 minute blocks in version 1.0. "


Agreed action

1. I've installed JSONviewer in chrome and searched json decode code . One of the tutorial that I found from google was very helpful from TheCave.info website.
It demonstrates the code of output as JSON using header in php.



My working file :



2. study JSON array and grab php

As for the next step, I have to study the JSON array in processing along with assistance and guiding from my tutor because it was my first time using processing to do my project. I've only have a very basic knowledge on processing during lvl4 in a Arduino workshop.  In Processing official website do have reference and demonstrate on the code on learning. Below is the screenshots of the code that I've used to grab php data.



My working file :

I've successfully to display who tweeted me.



3. Find a way to solve the rate exceeded.






No comments:

Post a Comment