Skip to content

Instantly share code, notes, and snippets.

@alan-null
Created November 21, 2016 00:36
Show Gist options
  • Save alan-null/a786420253a2847277d59a0d9c19af90 to your computer and use it in GitHub Desktop.
Save alan-null/a786420253a2847277d59a0d9c19af90 to your computer and use it in GitHub Desktop.

Feedly - mark as read

This script allows you to mark as read and hide articles that might not be interesting.

Decision is made based on the engagement value of each entry.

How it works

Once you run the script you wil be asked to provide two values:

  • minimum engagement - value of the engagement that allows to make a decision whether article should be dismissed or not.
  • minimum days - only entries older than minimum days will be checked

How to use

You can copy and paste the script into your browser console, however I recommend using bookmarklet for this.

You can create your own bookmarklet here

var entries = document.querySelectorAll('.entry.unread');
var _minEngage = parseInt(prompt("Please enter minimum engagement value", 100));
var _days = parseInt(prompt("Please enter minimum days value (only entries older than n-days will be checked)", 5));
if (_minEngage && _days) {
[].forEach.call(entries,
function (entry) {
var engagementNode = entry.querySelector('[data-dot]');
var engagementValue = -1;
if (engagementNode != null) {
engagementValue = engagementNode.innerText;
}
if (engagementValue < _minEngage) {
var lastModified = entry.querySelector('.ago').innerText;
if (lastModified.indexOf('d') > 0) {
lastModified = lastModified.replace('d', '');
} else {
lastModified = 0;
}
if (lastModified >= _days) {
console.log("I am about to remove following entry");
var title = entry.attributes['data-title'].value;
console.log(title);
console.log(entry);
var markAsRead = entry.querySelector('.icon-fx-cross-ios-sm-black');
markAsRead.click();
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment