- #do json entry
- j=json.loads(response.content)
- with open(j_Out, 'a') as j_outfile:
- json.dump(j, j_outfile)
- if i < len(articleList):
- j_outfile.write(",\n")
- else: #at end of file
- j_outfile.write("\n")
-
- #do tsv entry
- #with open(outputPath + "dailyviews" + queryDate + ".tsv", 'a') as t_outfile:
- # dw = csv.DictWriter(t_outfile, sorted(j[0].keys()), delimiter='\t')
- # if i==1:
- # dw.writeheader()
- # dw.writerows(j)