Vibe coding a GO CLI to extract data from articles

Motivation In this website (Vibe Classes ⚠️ under construction) there is a section called Articles intended to be a collection of recent news about Vibe Coding and related subjects. Every time some interesting article pops up in the media, it will be curated by our team and saved here for reference. The data is stored in a JSON file. An article have the following attributes: type Article { title: string description: string image: string source: string slug: string publishDate: Date } These attributes are intentionally chosen because they are based on the Open Graph Protocol. You may have already noticed that when you paste a link on some social media, after a second or two, it expands displaying an image, a title and summary. This data comes from Open Graph tags that are contained in the source code of the page you posted. In order to add new articles to this website, every time we need to inspect its source code, find the Open Graph tags, copy and paste the contents to create a new object. And, finally, add it to the array on the JSON file. The JSON file looks like this: { "articles": [ { "slug": "vibe-code-or-retire", "url": "https://www.infoworld.com/article/3960574/vibe-code-or-retire.html", "title": "Vibe code or retire", "description": "Vibe coding is how we will all write code in the future. Start learning it now, or your career as a software developer will end.", "image": "https://www.infoworld.com/wp-content/uploads/2025/04/3960574-0-34945300-1745312518-shutterstock_1724042191.jpg", "source": "InfoWorld", "publishDate": "2025-04-22" } // ... ] } This process is cumbersome and tedious, not to mention that is error prone. Let's fix it with some Vibe Coding. We are going to automate this process, learn something new and have fun. From what we know, the GO language is great for CLI tools. I have pretty basic knowledge of this language so I would take several hours to build something acceptable by myself. So, without further ado, let's get our hands dirty. Tooling For this challenge we will use Visual Studio Code and Anthropic Claude (Claude 3.7 Sonnet). Also, Go lang must be installed. I am running Fedora Linux. Prompt Engineering If there is one thing Vibe Coding heavily relies on, it is prompt engineering. The results you will get are totally related to the prompts you elaborate. They need to be objective, provide context, clear instructions and detailed description of what you want to get as an answer. We will have a post dedicated to this subject Requirements Let's gather the requirements to our problem and build our first prompt. We start with a link` to an interesting article. Our CLI must fetch the HTML page and parse it, find the specified tags, extract their content, associate them with our predefined article attributes, assemble a JSON object and add it to the array of entries on our database file. Easy!

Apr 26, 2025 - 14:20
 0
Vibe coding a GO CLI to extract data from articles

Motivation

In this website (Vibe Classes ⚠️ under construction) there is a section called Articles intended to be a collection of recent news about Vibe Coding and related subjects. Every time some interesting article pops up in the media, it will be curated by our team and saved here for reference. The data is stored in a JSON file. An article have the following attributes:

type Article {
  title: string
  description: string
  image: string
  source: string
  slug: string
  publishDate: Date
}

These attributes are intentionally chosen because they are based on the Open Graph Protocol. You may have already noticed that when you paste a link on some social media, after a second or two, it expands displaying an image, a title and summary. This data comes from Open Graph tags that are contained in the source code of the page you posted.
In order to add new articles to this website, every time we need to inspect its source code, find the Open Graph tags, copy and paste the contents to create a new object. And, finally, add it to the array on the JSON file.
The JSON file looks like this:

{
  "articles": [
    {
      "slug": "vibe-code-or-retire",
      "url": "https://www.infoworld.com/article/3960574/vibe-code-or-retire.html",
      "title": "Vibe code or retire",
      "description": "Vibe coding is how we will all write code in the future. Start learning it now, or your career as a software developer will end.",
      "image": "https://www.infoworld.com/wp-content/uploads/2025/04/3960574-0-34945300-1745312518-shutterstock_1724042191.jpg",
      "source": "InfoWorld",
      "publishDate": "2025-04-22"
    }
    // ...
  ]
}

This process is cumbersome and tedious, not to mention that is error prone. Let's fix it with some Vibe Coding. We are going to automate this process, learn something new and have fun. From what we know, the GO language is great for CLI tools. I have pretty basic knowledge of this language so I would take several hours to build something acceptable by myself. So, without further ado, let's get our hands dirty.

Tooling

For this challenge we will use Visual Studio Code and Anthropic Claude (Claude 3.7 Sonnet). Also, Go lang must be installed. I am running Fedora Linux.

Prompt Engineering

If there is one thing Vibe Coding heavily relies on, it is prompt engineering. The results you will get are totally related to the prompts you elaborate. They need to be objective, provide context, clear instructions and detailed description of what you want to get as an answer. We will have a post dedicated to this subject

Requirements

Let's gather the requirements to our problem and build our first prompt.
We start with a link` to an interesting article. Our CLI must fetch the HTML page and parse it, find the specified tags, extract their content, associate them with our predefined article attributes, assemble a JSON object and add it to the array of entries on our database file. Easy!