#!/usr/bin/env python
# -*- coding:utf-8 -*-

import os
import json

if __name__ == '__main__':
  langTagLink = {}

  for path in os.listdir('.'):
    if path.startswith("http"):
      with open(path, 'r') as f:
        j = json.loads(f.read())
	#print(j)

	if j["Language"] not in langTagLink:
          langTagLink[j["Language"]] = {}

	if j['Tag'] not in langTagLink[j["Language"]]:
          langTagLink[j["Language"]][j['Tag']] = []

	langTagLink[j["Language"]][j['Tag']].append(j)

  print(langTagLink)

@@ -502,8 +502,559 @@
 agLink)%0A
+  with open(%22zzz.rst%22, 'w') as f:%0A    for lang in langTagLink:%0A      space = 0%0A      if lang == u%22zh_CN%22:%0A        f.write(u%22Simplified Chinese:%5Cn%5Cn%22)%0A%09space += 2%0A%0A      tags = u%22%22%0A      for tag in langTagLink%5Blang%5D:%0A%09tags = tags + tag + u%22, %22%0A%09f.write(%22 %22 * space)%0A%09f.write(tag)%0A%09f.write(%22:%5Cn%5Cn%22)%0A%0A%09for j in langTagLink%5Blang%5D%5Btag%5D:%0A%09  space2 = space + 2%0A          f.write(%22 %22 * space2)%0A%09  f.write(%22%60%22)%0A%09  f.write(j%5Bu%22Title%22%5D.encode(%22utf8%22))%0A%09  f.write(%22 %3C%22)%0A%09  f.write(j%5Bu%22Link%22%5D)%0A%09  f.write(%22%3E%60_%5Cn%5Cn%22)%0A%0A      f.write(tags%5B:-2%5D)%0A      f.write(%22%5Cn%5Cn%22)%0A

write json to rst