def METHOD_NAME():
    base_url = "https://snapcraft.io/blog"
    links = []
    page = 1
    while True:
        url = (
            f"https://ubuntu.com/blog/wp-json/wp/v2/posts?"
            f"tags=2996&per_page=100&page={page}"
            f"&tags_exclude=3184%2C3265%2C3408"
        )
        response = session.get(url)
        if response.status_code == 400:
            break
        try:
            blog_response = response.json()
        except Exception:
            continue
        for post in blog_response:
            try:
                date = (
                    parser.parse(post["date"])
                    .replace(tzinfo=None)
                    .strftime("%Y-%m-%d")
                )
                links.append(
                    {
                        "url": base_url + "/" + post["slug"],
                        "last_udpated": date,
                    }
                )
            except Exception:
                continue
        page = page + 1
    xml_sitemap = flask.render_template(
        "sitemap/sitemap.xml",
        base_url=base_url,
        links=links,
    )
    response = flask.make_response(xml_sitemap)
    response.headers["Content-Type"] = "application/xml"
    response.headers["Cache-Control"] = "public, max-age=43200"
    return response