Skip to content
Browse files

Adding in a simple function that generates HTML that can be pasted in…

…to my blog entry.
  • Loading branch information...
1 parent b4f7b90 commit b846b76e5280acac951379ddb7647873abc490ea @garnaat committed Nov 9, 2011
Showing with 27 additions and 0 deletions.
  1. +27 −0 generate_html.py
View
27 generate_html.py
@@ -0,0 +1,27 @@
+import json
+
+def generate_html():
+ """
+ Just a simple function to generate a chunk of HTML that I can
+ paste into my blog entry detailing this same info. Makes it
+ easier to keep things up to date. Automating this completely
+ would be better but that will have to wait till I have time
+ to investigate blogger api's.
+ """
+ fp = open('aws.json')
+ data = json.load(fp)
+ fp.close()
+
+ html = ''
+ keys = data['services'].keys()
+ keys.sort()
+ for service in keys:
+ value = data['services'][service]
+ html += '<b>%s</b>\n' % service
+ html += ' <ul>\n'
+ for region in value['regions']:
+ html += ' <li>%s: %s</li>\n' % (region['name'],
+ region['endpoint'])
+ html += ' </ul>\n'
+ return html
+

0 comments on commit b846b76

Please sign in to comment.
Something went wrong with that request. Please try again.