You are here: Home » Reply

Reply To: FireStats – Top 40 php script (now with added charts)

#14743

sonichouse
Participant

@mas wrote:

Wow this is indeed a lot faster.
2 sec render time now.

Their engine is very speedy, I suppose it has to scale to support all the requests they get per minute.

@mas wrote:

BUT there are 2 issues I could see:
1) The Decades Grafik doesnt work. It doesnt autoscale. If all values are over 100 then you get a chart where all columns are max.

The API isn’t very clever on scaling, I will see what I can do with this.

@mas wrote:

2) More seriously, you use a hardcoded exec to /opt/bin/wget. Most php’s run with exec() disabled as it’s a security hazard. Can you maneuver around using an exec call and do it in php itself? One should defenitly not need to use wget in php, as php has plenty of functions to access images on the web and load em.

This is my second or third week with php, I will find an alternative approach. I first had the charts render just using the google url, but I need the image copy to reference in the summary page. Now that the speed is ok, I suppose the summary page could always get fresh data – but I don’t like that.

@mas wrote:

3) If google is for whatever reason down, then it simply wont show the grafics. Can you put in a fallback to the standard libchart method if googles api doesnt answer withing 10 secs?

Not sure, worth considering though 🙂