Last active
May 3, 2020 15:05
-
-
Save dudash/a206a425c30ead35b2a1a268da40d9ea to your computer and use it in GitHub Desktop.
Remove URLs from Magic Mirror news feed titles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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