@KemiraGroup discovered a little bug in my automation code for tweet statistics. I tested with Firefox and Safari and it worked for me… but then Peter Sjöholm (@sjoholm) informed that the bug manifested itself in IE8 & XP. I reproduced using IE6 and XP and then fixed the bug.
The reason why bug happened was because of one little comma… The excerpt below shows the bug in the list that is used to generate bar chart with Google Charts.
The code below has no comma and it works.
The bug fix in the code generation is below.
LAST=len(rankingDict)-1 i=0 for company,tweetCount in rankingDict: if i==LAST: htmlFile.write("['%s',%d]\n"%(company.capitalize(),tweetCount)) else: htmlFile.write("['%s',%d],\n"%(company.capitalize(),tweetCount)) i=i+1