{"id":374,"date":"2026-07-25T23:30:38","date_gmt":"2026-07-25T23:30:38","guid":{"rendered":"http:\/\/www.sugata.in\/?p=374"},"modified":"2026-07-26T02:18:43","modified_gmt":"2026-07-26T02:18:43","slug":"creating-wordclouds-in-2026-an-antigravity-ai-showcase","status":"publish","type":"post","link":"http:\/\/www.sugata.in\/index.php\/2026\/07\/25\/creating-wordclouds-in-2026-an-antigravity-ai-showcase\/","title":{"rendered":"Creating Wordclouds in 2026: An Antigravity AI Showcase"},"content":{"rendered":"<p>Back in December 2020, I wrote a post about <a href=\"https:\/\/www.sugata.in\/index.php\/2020\/12\/05\/wordclouds\/\">making word clouds in Python<\/a> to compare how CNN and BBC RSS feeds covered different news topics leading up to the election. Today, with the help of modern AI coding assistants like <strong>Antigravity<\/strong>, doing this is faster and easier than ever before.<\/p>\n<h3>How easy is it today?<\/h3>\n<p>To demonstrate, here is a screenshot of the prompt I gave to <strong>Antigravity<\/strong> (with credentials securely blacked out and unrecoverable):<\/p>\n<p style=\"text-align: center;\"><img src=\"\/wp\/wp-content\/uploads\/2026\/07\/prompt_screenshot-1.png\" alt=\"User prompt to Antigravity\" class=\"wp-image\" style=\"max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);\"><\/p>\n<p>In response, Antigravity automatically wrote the Python script, executed it to scrape the current RSS feeds, generated the wordclouds, and published this draft post on my blog.<\/p>\n<h3>What do the Wordclouds look like today?<\/h3>\n<p>Here are the generated wordclouds from today&#8217;s CNN and BBC RSS feeds (July 25, 2026):<\/p>\n<div style=\"display: flex; flex-wrap: wrap; justify-content: space-around; gap: 20px; margin: 20px 0;\">\n<div style=\"flex: 1; min-width: 300px; text-align: center;\">\n<h4>CNN Wordcloud (Today)<\/h4>\n<p><img src=\"\/wp\/wp-content\/uploads\/2026\/07\/cnn_wordcloud-1.png\" alt=\"CNN Wordcloud\" class=\"wp-image\" style=\"max-width: 100%; height: auto; border: 1px solid #ddd; border-radius: 4px;\"><\/p>\n<\/div>\n<div style=\"flex: 1; min-width: 300px; text-align: center;\">\n<h4>BBC Wordcloud (Today)<\/h4>\n<p><img src=\"\/wp\/wp-content\/uploads\/2026\/07\/bbc_wordcloud-1.png\" alt=\"BBC Wordcloud\" class=\"wp-image\" style=\"max-width: 100%; height: auto; border: 1px solid #ddd; border-radius: 4px;\"><\/p>\n<\/div>\n<\/div>\n<h3>The Underlying Python Code<\/h3>\n<p>This is the modern and clean Python code used by Antigravity to scrape the feeds and generate the wordclouds above:<\/p>\n<pre><code class=\"language-python\"># Generated by Antigravity Coding Assistant\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom wordcloud import WordCloud, STOPWORDS\nimport matplotlib.pyplot as plt\nimport urllib3\n\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n# RSS feed lists\ncnn_urls = [\n    \"http:\/\/rss.cnn.com\/rss\/cnn_topstories.rss\",\n    \"http:\/\/rss.cnn.com\/rss\/cnn_world.rss\",\n    \"http:\/\/rss.cnn.com\/rss\/cnn_us.rss\",\n    \"http:\/\/rss.cnn.com\/rss\/cnn_allpolitics.rss\",\n    \"http:\/\/rss.cnn.com\/rss\/cnn_tech.rss\",\n]\n\nbbc_urls = [\n    \"http:\/\/feeds.bbci.co.uk\/news\/rss.xml\",\n    \"http:\/\/feeds.bbci.co.uk\/news\/world\/rss.xml\",\n    \"http:\/\/feeds.bbci.co.uk\/news\/uk\/rss.xml\",\n    \"http:\/\/feeds.bbci.co.uk\/news\/business\/rss.xml\",\n    \"http:\/\/feeds.bbci.co.uk\/news\/politics\/rss.xml\",\n    \"http:\/\/feeds.bbci.co.uk\/news\/technology\/rss.xml\",\n]\n\ndef generate_wc(urls, output_filename, colormap):\n    text_data = []\n    for url in urls:\n        try:\n            resp = requests.get(url, verify=False, timeout=10)\n            if resp.status_code == 200:\n                soup = BeautifulSoup(resp.content, features=\"xml\")\n                items = soup.findAll('item')\n                for item in items:\n                    title = item.title.text if item.title else \"\"\n                    desc = item.description.text if item.description else \"\"\n                    text_data.append(title)\n                    text_data.append(desc)\n        except Exception as e:\n            print(f\"Error fetching {url}: {e}\")\n        \n    full_text = \" \".join(text_data).replace(\"\"\", \"\").replace(\"'\", \"\")\n    \n    wordcloud = WordCloud(\n        width=1000, \n        height=1000,\n        background_color='white',\n        stopwords=set(STOPWORDS),\n        min_font_size=10,\n        colormap=colormap,\n        max_words=200\n    ).generate(full_text)\n    \n    plt.figure(figsize=(10, 10), facecolor=None)\n    plt.imshow(wordcloud)\n    plt.axis(\"off\")\n    plt.tight_layout(pad=0)\n    plt.savefig(output_filename, format=\"png\", bbox_inches='tight', pad_inches=0, dpi=150)\n    plt.close()\n\n# Generate the wordclouds\ngenerate_wc(cnn_urls, \"cnn_wordcloud.png\", \"viridis\")\ngenerate_wc(bbc_urls, \"bbc_wordcloud.png\", \"inferno\")<\/code><\/pre>\n<hr>\n<p style=\"font-size: 0.9em; color: #555; font-style: italic;\">Note: This post, including all code generation, asset visualization, and content drafting, was automatically generated and posted by the <strong>Antigravity Coding Assistant<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in December 2020, I wrote a post about making word clouds in Python to compare how CNN and BBC RSS feeds covered different news topics leading up to the election. Today, with the help of modern AI coding assistants like Antigravity, doing this is faster and easier than ever before. How easy is it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/posts\/374"}],"collection":[{"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/comments?post=374"}],"version-history":[{"count":29,"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":408,"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/posts\/374\/revisions\/408"}],"wp:attachment":[{"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/media?parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/categories?post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sugata.in\/index.php\/wp-json\/wp\/v2\/tags?post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}