def store_sitemaps_in_s3(subreddits): s3conn = S3Connection() bucket = s3conn.get_bucket(g.sitemap_upload_s3_bucket, validate=False) sitemap_count = 0 for i, sitemap in enumerate(subreddit_sitemaps(subreddits)): store_subreddit_sitemap(bucket, i, sitemap) sitemap_count += 1 store_sitemap_index(bucket, sitemap_count)
def store_sitemaps(): sitemap_updater = SitemapUpdater() for subreddit_sitemap in subreddit_sitemaps(find_all_subreddits()): sitemap_updater.add_subreddit_sitemap(subreddit_sitemap) sitemap_updater.add_sitemap_index(sitemap_index(sitemap_updater.count))