Search two (or more) sites at once

For @kxxc:

// #popclip
// { name: 2x Search, lang: js }
const query = encodeURIComponent(popclip.input.text);
popclip.openUrl("https://example1.com/?q=" + query);
popclip.openUrl("https://example2.com/?q=" + query);

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

To search more sites, just add more lines.

2 Likes

yees! thank you
but looks like these lines no longer working on js code, haha… :joy:

icon: iconify:tabler:square-rounded-number-4
requirements: [text, “!urls”]
after: copy-selection

Post the whole thing for me so I can take a look.
BTW, when posting the forum you can write ``` on the line before and after the code to format it as a code block

Gave me a shaking X feedback :rofl:

// { name: test, lang: js }
icon: iconify:tabler:square-rounded-number-4
requirements: [text, "!urls"]
const query = encodeURIComponent(popclip.input.text);
popclip.openUrl("https://www.apple.com/tw/search/" + query);
popclip.openUrl("https://www.youtube.com/results?search_query=" + query);
after: copy-selection

Nice job with the ``` :slight_smile:

So the extension has two parts, the settings and the code, which need to be kept separate.

The extension settings go in the in the top part, with // before each line, like this:

// #popclip
// name: test
// lang: js
// icon: iconify:tabler:square-rounded-number-4
// requirements: [text, "!urls"]
// after: copy-selection
const query = encodeURIComponent(popclip.input.text);
popclip.openUrl("https://www.apple.com/tw/search/" + query);
popclip.openUrl("https://www.youtube.com/results?search_query=" + query);
1 Like

I’m alive again! thank u vm!
so many ways in PopClip so much mystery.
every Mac user should use it :smiling_face_with_three_hearts:

1 Like