parse_ap.py 490 B

123456789101112131415161718192021222324
  1. #!/usr/bin/python3
  2. # GPL v3 or later
  3. # see COPYING.GPL
  4. import json
  5. # obviously replace my file with yours
  6. json_file="/home/themusicgod1/Downloads/niu/out1.json"
  7. json_data=open(json_file)
  8. data = json.load(json_data)
  9. x=data.popitem()
  10. x=data.popitem()
  11. for b in range(2,2099):
  12. if ((type(x[1][b].get("object"))==type('str'))):
  13. print( x[1][b].get("object") + " RT")
  14. else:
  15. print (x[1][b].get("object").get("url") + " " + x[1][b].get("object").get("content"));