Skip to content

Instantly share code, notes, and snippets.

@dudash
Last active May 3, 2020 15:05
Show Gist options
  • Save dudash/a206a425c30ead35b2a1a268da40d9ea to your computer and use it in GitHub Desktop.
Save dudash/a206a425c30ead35b2a1a268da40d9ea to your computer and use it in GitHub Desktop.
Remove URLs from Magic Mirror news feed titles
// remove URLS from the feed title
var urlFree = this.newsItems[this.activeItem].title.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '');
this.newsItems[this.activeItem].title = urlFree;
// remove pic.twitter.com from the feed too (sometimes this exists w/o the http prefix)
var urlFree = this.newsItems[this.activeItem].title.replace(/pic.twitter.com[\n\S]+/g, '');
this.newsItems[this.activeItem].title = urlFree;
/**
Useful for feeds like this:
{
title: "@breakingnews",
url: "http://twitrss.me/twitter_user_to_rss/?user=breakingnews"
},
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment