search on internet

Features wanted...
Post Reply
yogi
Posts: 118
Joined: 18 Feb 2010 09:05

search on internet

Post by yogi »

a very practical option at q-dir is the integrated internet search, would it be possible at xyplorer?
for example a file called lamborghini urus
well I can search in google directly for example the photos
Google en=https://www.google.fr/search?hl=en&q=%s ... 9h28=19h28
, or even youtube videos
youtube en=https://www.youtube.com/search?hl=en&q= ... %253D%253D

%s is for the search item

so .
thank you
XYplorer Version: 27.20.0900 (32-bit)
Windows Version: windows 10 21h2 19044.2006
Screen Scaling Percentage: 100%

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: search on internet

Post by highend »

Use a custom file association?

Code: Select all

|"Search google for '<curbase>'" *>::$search = regexreplace(<curbase>, "(\.|-|_)", " "); open "https://www.google.com/search?q=" . urlencode("$search", 1);
or a custom event action...
One of my scripts helped you out? Please donate via Paypal

yogi
Posts: 118
Joined: 18 Feb 2010 09:05

Re: search on internet

Post by yogi »

it works for a simple search, but now I'm trying to direct my search through the possibilities of googlesearch, that is to say, either images or videos,
for images, in q-dir , I have this:
Google en=https://www.google.fr/search?hl=en&q=%s ... 9h28=19h28
and for the videos; i have this
https://www.youtube.com/search?hl=en&q= ... %253D%253D
XYplorer Version: 27.20.0900 (32-bit)
Windows Version: windows 10 21h2 19044.2006
Screen Scaling Percentage: 100%

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: search on internet

Post by highend »

And?

Then use a generic file type instead of * for the extensions and concatenate the rest of your search url after urlencode("$search", 1)?
One of my scripts helped you out? Please donate via Paypal

yogi
Posts: 118
Joined: 18 Feb 2010 09:05

Re: search on internet

Post by yogi »

Im novice... I dont understand...
XYplorer Version: 27.20.0900 (32-bit)
Windows Version: windows 10 21h2 19044.2006
Screen Scaling Percentage: 100%

yogi
Posts: 118
Joined: 18 Feb 2010 09:05

Re: search on internet

Post by yogi »

https://www.softwareok.com/?seite=faq-Q-DIR&faq=36

here is the link to better understand my request
XYplorer Version: 27.20.0900 (32-bit)
Windows Version: windows 10 21h2 19044.2006
Screen Scaling Percentage: 100%

WirlyWirly
Posts: 312
Joined: 21 Oct 2020 23:33
Location: XY 64-Bit | Win 10 @ 100% (3440x1440)

Re: search on internet

Post by WirlyWirly »

So from what I can understand you're using the file name of the selected item to perform a search. You also want to have multiple search engines to pick from.

Is that right?

yogi
Posts: 118
Joined: 18 Feb 2010 09:05

Re: search on internet

Post by yogi »

Yes exactly !! it is a search in relation to the name of files or folders (the extensions are not taken into account) and then depending on what I want to see, I have the choice of the search engine. for the video, it points to youtube, and I put so that it filters me the video of more than 20 min.
examples: if I point to a file called "formule1.jpg"; and that I point to my youtube search tools, it will search for all formula 1 videos on youtbe of more than 20 minutes, (it does not take the extensions into account in fact but just the file name.)
I know it's not easy to find but very effective for a quick search;
XYplorer Version: 27.20.0900 (32-bit)
Windows Version: windows 10 21h2 19044.2006
Screen Scaling Percentage: 100%

WirlyWirly
Posts: 312
Joined: 21 Oct 2020 23:33
Location: XY 64-Bit | Win 10 @ 100% (3440x1440)

Re: search on internet

Post by WirlyWirly »

It sounded like it could be useful, so I made a simple script with a few example search engines. It's pretty easy to read so you can modify the search engines to your liking.

You need to specify the path to the browser you'd like to use and then insert the the $FILENAME variable wherever the filename should be in the url slug.

By default it pops up near the tree, if you'd like it to popup wherever the mouse is then uncomment line #33

Code: Select all

/*
Perform a search query using the selected filename

1 tab per submenu
DISPLAY|DATA (return value)|ICON|STATE

*/

$BROWSER = "<xypath>..\..\FirefoxPortable\FirefoxPortable.exe";

    $FILENAME = get("curitem", "base", 1);
    $menu = <<<MENU

DuckDuckGo|run lax("$BROWSER" "https://duckduckgo.com/?q=$FILENAME")|<xyicons>\websites\DuckDuckGo.ico
YouTube|run lax("$BROWSER" "https://www.youtube.com/results?search_query=$FILENAME")|<xyicons>\websites\YouTube.ico
-
Media|
    TheMovieDB|run lax("$BROWSER" "https://duckduckgo.com/?q=\site%3Athemoviedb.org+$FILENAME")|<xyicons>\websites\DuckDuckGo.ico
    TheTVDB|run lax("$BROWSER" "https://duckduckgo.com/?q=\site%3Athetvdb.com+$FILENAME")|<xyicons>\websites\DuckDuckGo.ico

-
Google|run lax("$BROWSER" "https://google.com/search?q=$FILENAME")|
Google Images|run lax("$BROWSER" "https://www.google.com/search?tbm=isch&q=$FILENAME")|

MENU;

    // Get X/Y position of a control
    $position = controlposition('TAB 1', 0);
    $x_pos = gettoken($position, 1, '|');
    $y_pos = gettoken($position, 2, '|');

    // Display the context menu
    $command = popupnested($menu, $x_pos, $y_pos,,,,,|);
    //$command = popupnested($menu,,,,,,,|);

    // Run the selected command or skip if it uses an id #
    if ($command) { load $command,, s; }
    /*if ($command && !regexmatches($command, '^\#\d+$')) { load $command,, s; }*/
Last edited by WirlyWirly on 24 Apr 2022 22:31, edited 4 times in total.

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: search on internet

Post by highend »

I know what comes next... :maf:

@WirlyWirly
$FILENAME = get("curitem", "base");
This doesn't work for folder names with dots in it
One of my scripts helped you out? Please donate via Paypal

WirlyWirly
Posts: 312
Joined: 21 Oct 2020 23:33
Location: XY 64-Bit | Win 10 @ 100% (3440x1440)

Re: search on internet

Post by WirlyWirly »

You're right, I just tested it on a few files and called it good :?

Simple fix, I'll update my post.

Also, this becomes much more handy if you use search syntax in your slugs. Here's the DuckDuckGo search syntax, in particular using \site:themoviedb.org $FILENAME is very useful for searching TMDB because their built-in search engine sucks...

Code: Select all

/*
Perform a search query using the selected filename

1 tab per submenu
DISPLAY|DATA (return value)|ICON|STATE

*/

$BROWSER = "<xypath>..\..\FirefoxPortable\FirefoxPortable.exe";

    $FILENAME = get("curitem", "base", 1);
    $menu = <<<MENU

DuckDuckGo|run lax("$BROWSER" "https://duckduckgo.com/?q=$FILENAME")|<xyicons>\websites\DuckDuckGo.ico
YouTube|run lax("$BROWSER" "https://www.youtube.com/results?search_query=$FILENAME")|<xyicons>\websites\YouTube.ico
-
Media|
    TheMovieDB|run lax("$BROWSER" "https://duckduckgo.com/?q=\site%3Athemoviedb.org+$FILENAME")|<xyicons>\websites\DuckDuckGo.ico
    TheTVDB|run lax("$BROWSER" "https://duckduckgo.com/?q=\site%3Athetvdb.com+$FILENAME")|<xyicons>\websites\DuckDuckGo.ico

-
Google|run lax("$BROWSER" "https://google.com/search?q=$FILENAME")|
Google Images|run lax("$BROWSER" "https://www.google.com/search?tbm=isch&q=$FILENAME")|

MENU;

    // Get X/Y position of a control
    $position = controlposition('TAB 1', 0);
    $x_pos = gettoken($position, 1, '|');
    $y_pos = gettoken($position, 2, '|');

    // Display the context menu
    $command = popupnested($menu, $x_pos, $y_pos,,,,,|);
    //$command = popupnested($menu,,,,,,,|);

    // Run the selected command or skip if it uses an id #
    if ($command) { load $command,, s; }
    /*if ($command && !regexmatches($command, '^\#\d+$')) { load $command,, s; }*/

yogi
Posts: 118
Joined: 18 Feb 2010 09:05

Re: search on internet

Post by yogi »

pffft awesome!!
it works great: you are a former user of qdir I see that I really appreciate it, and you like portable applications like me! but you master the scripts and you have one more point !!!
Thank you to you 2 !
XYplorer Version: 27.20.0900 (32-bit)
Windows Version: windows 10 21h2 19044.2006
Screen Scaling Percentage: 100%

Post Reply