2016-04-19 18:18:45 +08:00
|
|
|
#!/usr/bin/python
|
|
|
|
import json
|
2016-04-21 22:44:36 +08:00
|
|
|
import sys
|
|
|
|
reload(sys)
|
|
|
|
sys.setdefaultencoding( "utf-8" )
|
2016-04-19 18:18:45 +08:00
|
|
|
|
2016-04-21 22:44:36 +08:00
|
|
|
file = open(sys.argv[1])
|
2016-04-19 18:18:45 +08:00
|
|
|
data = json.load(file)
|
|
|
|
|
2016-04-21 22:44:36 +08:00
|
|
|
c = 0
|
2016-04-19 18:18:45 +08:00
|
|
|
for article in data:
|
2016-04-21 22:44:36 +08:00
|
|
|
c+=1
|
|
|
|
print article['time'],"--------",article['title']
|
|
|
|
# print "[----Time-----]\n",article['time'],article['title']
|
|
|
|
# print "[----Title----]\n",article['title']
|
|
|
|
# print "[----Article--]\n",article['content'],"\n\n"
|
|
|
|
print c
|