Oscar Hedeby Iversen

Software Engineer, CEO of Snappy

Keep your website text up to date

It's important to keep your website up to date—not just in design, but also in content. Outdated information can create confusion and reduce trust with your visitors. Some content changes often, like stats or time-sensitive info, but doesn’t need a full CMS or manual updates. That’s where Snappy shines.

Update text when the user enters the site

Some text needs to be updated for each visit. This could be the copyright year (e.g., © 2025) or dynamic figures like "Join our 4,521 happy customers."

With Snappy, you can write a custom function that gets called every time a user visits your site.

Using the DOM manipulation widget, first select the text you want to update. Then, using the JavaScript function transformation, you can keep that text always current.

You can update the text either by calling an external API or by performing calculations directly in the browser.

Example: Show the current year

Here’s a simple function to keep your copyright updated:

element.textContent = `© ${new Date().getFullYear()}`;

Just drop that into the function transformation for the selected text node.

How to use an external API to update text

Using the DOM manipulation tool, you can fetch data from any API and display it on your site.

Let’s say you want to display a random fun fact each time someone visits your site. You could use a public API like uselessfacts.jsph.pl.

Try inserting this code into the function:

fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")
  .then((response) => response.json())
  .then((data) => {
    element.textContent = data.text;
  })
  .catch(() => {
    element.textContent = "Could not load a fun fact right now!";
  });

This snippet will update the selected text element with a fresh, random fact every time the page loads.

Other ideas

You can use similar techniques to:

Show how many days since your last product release Display current weather or stock prices Fetch and display your latest blog post title Make dynamic content effortless

With Snappy, updating semi-dynamic content becomes second nature. You don’t need a developer, a CMS, or manual edits. Just set it up once, and Snappy will keep your content fresh—on every visit.

Whether you’re keeping your footer current or delivering daily inspiration to your users, Snappy gives you the power to do it all without touching your site’s backend.