metaphox Posted August 29, 2013 Share Posted August 29, 2013 (edited) This plugin simply opens the searching URL http://explainshell.com/explain/{command}?args={args} where command and args are parsed from {query}. import subprocess subprocess.call(["open", """http://explainshell.com/explain/{0}""".format( "{query}".replace(" ", "?args=", 1).replace(" ", "+") )]) . Mostly harmless. Download from http://d.pr/f/GlsI+ Edited August 30, 2013 by metaphox Link to comment
vitor Posted August 29, 2013 Share Posted August 29, 2013 The line <title>Explain {query} </title> will give a lot of trouble, and be not very usable. The results are displayed via XML, and you’re displaying what the user types without much escaping. This is somewhat important in this case, since there are a lot of characters that can be used in commands (such as & and < for redirection, or " for quoting) that immediately break your workflow. metaphox 1 Link to comment
metaphox Posted August 30, 2013 Author Share Posted August 30, 2013 The line <title>Explain {query} </title> will give a lot of trouble, and be not very usable. The results are displayed via XML, and you’re displaying what the user types without much escaping. This is somewhat important in this case, since there are a lot of characters that can be used in commands (such as & and < for redirection, or " for quoting) that immediately break your workflow. Thanks for the tip. I was trying to do something fancy but, well, will just use the simple keyword input instead. Link to comment
vitor Posted August 30, 2013 Share Posted August 30, 2013 Your new download link is broken (tip, if you add a + to the end of any droplr url, it’ll make a direct link to the file (i.e., in this case it’ll start the download immediately, instead of directing you to the page). Thanks for the tip. I was trying to do something fancy but, well, will just use the simple keyword input instead. You can still use {query} on the Keyword input. It’ll work even better, since there’s no need for escaping, and it’ll be less prone to error, since Script Filters run each time the text changes, which means that if someone is too fast typing and the hitting ↩, it may pass an incomplete argument. Link to comment
metaphox Posted August 30, 2013 Author Share Posted August 30, 2013 Your new download link is broken (tip, if you add a + to the end of any droplr url, it’ll make a direct link to the file (i.e., in this case it’ll start the download immediately, instead of directing you to the page). You can still use {query} on the Keyword input. It’ll work even better, since there’s no need for escaping, and it’ll be less prone to error, since Script Filters run each time the text changes, which means that if someone is too fast typing and the hitting ↩, it may pass an incomplete argument. Thanks again… the link works now. Somehow there was an additional white space in the URL. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now