How To Find The Best Answer To Your Question (Ubuntu) In 1Second
A couple of days ago, I’ve been trying to figure out how great it’s the howdoi script and what if I could modify it in a certain way to work along with AskUbuntu.com - yes it works only in Ubuntu. After several hours of studying its source code, I finally found what modifications I had to do and truth be told the results were absolutely satisfying.
How it works, you may ask. Simply put, just type your question (query or just a phrase or anything) like being in Google, but in terminal. Here, some examples:
How to change my desktop background ?
How to download music from Youtube?
How can I install nvidia drivers proprietary?
How to uninstall a program?
The script will search using Google engine to find the appropriate AskUbuntu’s links and then throw away the irrelevant ones. Then, it will pick up the first one (use the -n <number> parameter to specify how many answers do you want to see), browse into the code tab, grab the first top voted-reply and throw away the garbage. If you want just the links, use the -l parameter.
Take a look and admire the power and the simplicity of the Linux shell altogether …
Download my script from Github and feel free fork and play with it. Extract it into a folder and make it executable (eg chmod +x filename) and the can run it.
chmod +x ask.py ./ask
It is not a bash script but it is written in Python, so you are going to need some Python bindings. Do not worry, the script will automatically install them for you. For example if you don’t have python-pygments installed:
In case you are curious to know the required libraries the script needs Python, python-pygments, python-pyquery, python-requests, requests-cache. Again , if you do not have them installed, this is what it should normally do:
sudo apt-get install python-pygments sudo apt-get install python-pyquery sudo add-apt-repository ppa:chris-lea/python-requests -y sudo apt-get update sudo apt-get install python-requests git clone git://github.com/reclosedev/requests-cache.git cd requests-cache python setup.py install
Take a look at my script’s source code over here (GitHub fork)
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04 : Power Commands, power management application created by the Atareao team , this app helps users to...0 comments |
- Install Uget Download Manager In Ubuntu, Fedora, Debian : uGet is a very light-weight and powerful open source download manager. On March 4th, 2014 Uget Do...0 comments |
- Install Crashplan backup tool in Linux : CashPlan is an automated backup solution that either uses the CrashPlan Central server or any other ...0 comments |
- Download Elementary OS 'Luna' Official Wallpapers : Hi Guys, Am a great lover of Elementary OS, so I like to move almost everywhere with some its beaut...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
- Puppet agent Install Using Script
- Install Corosync and Pacemaker On CentOS 6.5
- Install Fail2Ban On Ubuntu Server 13.04/13.10
- How To Install Google Chrome in Fedora 20, 19, 18
- How to surf using Tor Browser Bundle
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .