Skip to content

Instantly share code, notes, and snippets.

@anekos
Created October 8, 2014 11:42
Show Gist options
  • Save anekos/b68fa1cc70705e4cfdbb to your computer and use it in GitHub Desktop.
Save anekos/b68fa1cc70705e4cfdbb to your computer and use it in GitHub Desktop.
feedly.com 用の vimperator プラギン, readitlater のプラグインあると良い
(function () {
const api = {
matchingUrls: new RegExp('^https?://feedly.com/'),
get doc () content.document,
get selectedEntry () api.doc.querySelector('.selectedEntry'),
get selectedEntryInfo () {
let entry = api.selectedEntry;
return {
url: entry.getAttribute('data-alternate-link'),
title: entry.querySelector('.title').textContent
};
},
openSelectedEntry: function () {
liberator.open(api.selectedEntryInfo.url, liberator.NEW_BACKGROUND_TAB)
},
readItLater: function () {
let info = api.selectedEntryInfo;
plugins.readitlater.API.add(
info.url,
info.title,
function () {
liberator.echomsg('Read it later: ' + info.title + ' - ' + info.url);
}
);
}
};
mappings.addUserMap(
[modes.NORMAL],
['v'],
'Open selected entry - feedly.com',
function () {
api.openSelectedEntry();
},
{
matchingUrls: api.matchingUrls
}
);
mappings.addUserMap(
[modes.NORMAL],
['l'],
'Read it later - feedly.com',
function () {
api.readItLater();
},
{
matchingUrls: api.matchingUrls
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment