List AWS AMIs.
! /usr/bin/env python
-*- coding: utf-8 -*-
import urllib2
import argparse
from BeautifulSoup import BeautifulSoup
def main():
fp = urllib2.urlopen('http://cloud-images.ubuntu.com/precise/current/')
soup = BeautifulSoup(fp)
table = soup.find('table')
rows = table.findAll('tr')
for row in rows[1:]: # first is header
tds = row.findAll('td')
region = tds[0].text
arch = tds[1].text
store = tds[2].text
ami = tds[3].text.replace('Launch', '')
print('{} {} {} {}'.format(region, arch, store, ami))
if __name__ == '__main__':
main()