feat(keys): add Product Hunt bindings

add bindings for producthunt.com, including:
- view product
-	view product (external)
- upvote product
This commit is contained in:
Maddison Hellstrom 2018-11-02 22:15:08 -07:00
parent 2df7fdd0a8
commit 0be265b517
2 changed files with 26 additions and 0 deletions

View File

@ -165,6 +165,14 @@ actions.hn.collapseNextComment = () => {
} }
} }
// ProductHunt
// -----------
actions.ph = {}
actions.ph.openExternal = () => {
Hints.create("ul[class^='postsList_'] > li > div[class^='item_']", p =>
tabOpenLink(p.querySelector("div[class^='meta_'] > div[class^='actions_'] > div[class^='minorActions_'] > a:nth-child(1)").href))
}
// Dribbble // Dribbble
// -------- // --------
actions.dr = {} actions.dr = {}

18
keys.js
View File

@ -361,6 +361,24 @@ const maps = {
}, },
], ],
"producthunt.com": [
{
alias: "a",
description: "View product (external)",
callback: actions.ph.openExternal,
},
{
alias: "v",
description: "View product",
callback: actions.createHint("ul[class^='postsList_'] > li > div[class^='item_'] > a"),
},
{
alias: "s",
description: "Upvote product",
callback: actions.createHint("button[data-test='vote-button']"),
},
],
"dribbble.com": [ "dribbble.com": [
{ {
alias: "s", alias: "s",