Skip to content

Commit b846b76

Browse files
committed
Adding in a simple function that generates HTML that can be pasted into my blog entry.
1 parent b4f7b90 commit b846b76

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

generate_html.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import json
2+
3+
def generate_html():
4+
"""
5+
Just a simple function to generate a chunk of HTML that I can
6+
paste into my blog entry detailing this same info. Makes it
7+
easier to keep things up to date. Automating this completely
8+
would be better but that will have to wait till I have time
9+
to investigate blogger api's.
10+
"""
11+
fp = open('aws.json')
12+
data = json.load(fp)
13+
fp.close()
14+
15+
html = ''
16+
keys = data['services'].keys()
17+
keys.sort()
18+
for service in keys:
19+
value = data['services'][service]
20+
html += '<b>%s</b>\n' % service
21+
html += ' <ul>\n'
22+
for region in value['regions']:
23+
html += ' <li>%s: %s</li>\n' % (region['name'],
24+
region['endpoint'])
25+
html += ' </ul>\n'
26+
return html
27+

0 commit comments

Comments
 (0)