Quick Search and more...

Discuss and share scripts and script files...
Post Reply
shpkong
Posts: 6
Joined: 14 Jan 2017 04:20
Location: Myanmar

Quick Search and more...

Post by shpkong »

My first Xyplorer script... :)

Add some keywords to Quick Search: cp=controlpanel, gg=google, wiki=wikipedia, bd=baidu, xyfc=xyplorer form.

You can use "gg:roger federer" to search for news about roger Federer use google web searchengine and "cp:uninstall" to search "uninstall" inside control panel.

Current the websearch only support 4 sites: google, Wikipedia, baidu and xyplorer form. Maybe you can add more by yourselves. :)

All the things is done by Xyplorer itself, I just call them...

P.S. I do not search very carefully inside the form about whether some one else has already posted a script like this before, if so, please delete this post, thank you.
Attachments
mysearch.xys
(991 Bytes) Downloaded 138 times

highend
Posts: 13276
Joined: 06 Feb 2011 00:33

Re: Quick Search and more...

Post by highend »

Congratulations for your first script!

May I suggest at least three things?

You should add a XY version check to make sure that the script is usable (the switch command was only added
recently with v17.30.0002)

Your regex pattern is very... expressive :)
You can make it a bit shorter and more readable:

Code: Select all

"^(cp|gg|wiki|bd|xyfc):"
Your switch case test for "" could be done (better) with the default: at the end of it like:

Code: Select all

...
        case "xyfc:":
            goto "http://www.xyplorer.com/xyfc/search.php?keywords=" . $command;
            break;
        default:
            goto "<curpath>" . "?" . $in;
    }
One of my scripts helped you out? Please donate via Paypal

Post Reply