Friday, December 12, 2014

Tutorial 5 - Programming update

In previous days, I have the same problem with the Twitter rate limit. It get exceeded very fast and it becomes one of the problem for me to do testing every time. Today discussion with my lecturer, we brought it out the issue and look for the solution.

Notes of discussion:

1.  Cache Data in php

One of the solution is to cache the data in php and one very useful library found in google called Phpfastcache library



2. As for the Processing update, we discussed about the condition for the tweet. I want it to work like
shows tweet by tweet but not grab whole array from php and display all tweets at a time.

(array grab and display at a time) 

My tutor explains the system and concept of the code and guide me through step by step. Things that i need to consider is to code a timer to tell the processing to check and grab the data every 5 seconds.
Next, the condition to draw and store.

Agreed action


1. Phpcachefast,

my working file :





2. Timer, very helpful tutorial I've found at learningprocessing website.



My working file : 





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.