GithubHelp home page GithubHelp logo

askstack's Introduction

Black Downloads

askstack

Search answers on Stack Overflow. Can use Google, Bing or DuckDuckGo search engine.

Just pass some keywords to the script and it will uses a search engine to find the most relevant pages on Stack Overflow.

Then, it will get the first code snippet from the question page or the full answer text.

Simple example:

$ askstack python delete dict key
---------------------------------------------------------------------------

Question: How to remove a key from a python dictionary?

my_dict.pop('key', None)


Answer from: https://stackoverflow.com/questions/11277432

---------------------------------------------------------------------------

Question: Delete an item from a dictionary

del d[key]


Answer from: https://stackoverflow.com/questions/5844672

---------------------------------------------------------------------------

Notes

  • Works on Python 2.7 and Python 3.4+

Install

Install using pip:

pip install askstack

Usage

Usage: askstack keywords... [options]

search answers on stackoverflow

Options:
--version       show program's version number and exit
-h, --help      show this help message and exit
-a ANSWERS      number of answers to retrieve (default: 2)
-e ENGINE       search engine to use: 'google', 'bing', 'duckduckgo' or
                'fallback' - fallback will try google and fallback to bing
                and duckduckgo if a search fails (default: fallback)
-f, --fulltext  get the full answer text (default: disabled)
-s SLEEP        sleep time between requests (default: 0.5)
-t TIMEOUT      timeout in seconds to wait for reply (default: 5)

Examples

If you are feeling lucky, get only the first code snippet:

$ askstack linux gzip directory -a 1

Get full first answer:

$ askstack linux gzip directory -a 1 -f

Try to get three answers using only DuckDuckGo as the search engine:

$ askstack linux gzip directory -a 3 -e duckduckgo

askstack's People

Contributors

pdrb avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.