Page 1 of 1

search on internet

Posted: 24 Apr 2022 11:59
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

Re: search on internet

Posted: 24 Apr 2022 12:07
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...

Re: search on internet

Posted: 24 Apr 2022 13:02
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

Re: search on internet

Posted: 24 Apr 2022 13:12
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)?

Re: search on internet

Posted: 24 Apr 2022 15:15
by yogi
Im novice... I dont understand...

Re: search on internet

Posted: 24 Apr 2022 18:36
by yogi
https://www.softwareok.com/?seite=faq-Q-DIR&faq=36

here is the link to better understand my request

Re: search on internet

Posted: 24 Apr 2022 19:00
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?

Re: search on internet

Posted: 24 Apr 2022 21:01
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;

Re: search on internet

Posted: 24 Apr 2022 21:53
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; }*/

Re: search on internet

Posted: 24 Apr 2022 21:59
by highend
I know what comes next... :maf:

@WirlyWirly
$FILENAME = get("curitem", "base");
This doesn't work for folder names with dots in it

Re: search on internet

Posted: 24 Apr 2022 22:08
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; }*/

Re: search on internet

Posted: 24 Apr 2022 22:55
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 !