Reddit Search Extension + Reddit via Google

By default searches google with “reddit” append to the search, because reddit search is bad :smile:. use ⌥ to search on reddit directly.

(just select the text in the below code snippet, PopClip should show up, click install, and done, it’s that simple!!)

// # popclip
// name: Reddit Search | ⌥ for Reddit.com Search
// icon: iconify:flat-color-icons:reddit
// requirements: [text, "!url"]
// lang: js
const query = encodeURIComponent(popclip.input.text);
if (popclip.modifiers.option) {
  popclip.openUrl("https://www.reddit.com/search/?q=" + query);
} else {
  popclip.openUrl("https://www.google.com/search?q=" + query + "+reddit");  
}
1 Like

That’s brilliant, thanks for sharing!

Just to add that as of the most recent PopClip version, Open URL actions now also support an alternate url property to support this common scenario. So your extension can be simplified, if you want, to:

# popclip
name: Reddit Search | ⌥ for Reddit.com Search
icon: iconify:flat-color-icons:reddit
requirements: [text, "!url"]
url: https://www.google.com/search?q=***+reddit  
alternate url: https://www.reddit.com/search/?q=***

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)

1 Like