How to add a news widget to a website, no script needed
The three kinds of news embed (script, frame and image), what each one does to your page and your readers, what to check first, and Newsworthy's free badge and card.
A news widget on a website is a few lines of HTML that show news from somewhere else and keep it current without you editing the page. Most site builders have a block for custom HTML or embeds where you paste it. Before you pick one, it helps to know which of three kinds it is, because they behave very differently on your page.
The three kinds of embed
- A script. You paste a
<script>tag, and code from the widget’s maker runs inside your page. This is the most flexible kind and the most common among widget builders. It is also the one that can slow your page, change it, and see what your readers do on it, depending on what the code does. - A frame. You paste an
<iframe>tag, and a small page from the widget’s maker shows inside a box on yours. It cannot change the rest of your page. It still loads from their server, so they receive a request each time it shows. - An image. You paste a link around an
<img>tag. The maker’s server draws a picture with the current information, and a reader who clicks it goes to the source. It runs no code at all, so it is the lightest kind, but it can show only what fits in a picture.
What to check before you paste
- Does it need an account or a plan? Many widget builders ask you to sign up, and some limit the free tier.
- What does it collect? Read the maker’s privacy policy. A script can collect more than a frame or an image, and your own privacy policy may need to mention it.
- Who chose the stories, and may you show them? A feed of headlines belongs to its publisher, who sets the terms for showing it. Check them.
- Does it show a time? News changes through the day. An embed that prints when it was last updated tells readers how current it is.
- What happens on a phone? Look at the page at phone width after you paste it.
Newsworthy’s badge and card
Newsworthy rates world news by significance: a score from 1 to 10, a brief explanation and an update time. Its How big is the news today? page offers two embeds, free, with no account. Neither runs a script on your page, both update on their own, and both link back to the page:
- The badge, an image of today’s number. Add
?theme=darkto its address for a dark badge, or?tz=with a time zone name such asAmerica/Los_Angelesto date it in another time zone. - The card, a frame that shows the number with its sentence.
Copy the HTML for either from the “Embed this” section of that page. Newsworthy’s server notes only which site a badge or card was shown on, never anything about the readers. Each day’s high, its time and its sentence are also published as JSON and RSS, free to quote and chart under CC BY 4.0 with a credit and a link to the today page.
The number is a judgment and can be wrong. It is not a complete briefing or an emergency alert, so treat it as one reading of the news, not the news itself.
To put the same reading on an iPhone or iPad Home Screen instead, see how to add a news widget to your iPhone Home Screen. For what the number means, see how to read a news significance score.
Updated