Created
October 8, 2014 11:42
-
-
Save anekos/b68fa1cc70705e4cfdbb to your computer and use it in GitHub Desktop.
feedly.com 用の vimperator プラギン, readitlater のプラグインあると良い
This file contains 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
(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