4 ms·
According to the source code (https://github.com/gleitz/howdoi/blob/master/howdoi/howdoi.py https://github.com/gleitz/howdoi/blob/master/howdoi/howdoi.p...), th
by roryokane 14y ago
According to the source code (https://github.com/gleitz/howdoi/blob/master/howdoi/howdoi.py https://github.com/gleitz/howdoi/blob/master/howdoi/howdoi.p...), the answers come from Stack Overflow, searched using Google site search. Howdoi scrapes and prints the first code block in the top answer, or the full text of the top answer if it contains no code block.
- gleitz 14y agoPrecisely! You can pass the "-a" flag to print the entire answer or "-l" to get the link itself. "-p2" will give the second answer. I find myself using the following command quite a bit: open `howdoi print stack trace python -l`
- pests 14y ago-p2 gives the second search result's answer, not the second answer from the first result. Or so it seems from other replies.
- gleitz 14y agoAlthough not user facing, there is also a DuckDuckGo search endpoint if you don't want to use Google for one reason or another.
- kanzure 14y agoIt should probably use symbolhound.com instead, which does exact symbol queries on stackoverflow content. Google, alas, thinks we are all terrible people for wanting our precious bytes.
- gleitz 14y agoThat's a nice search tool. I found that the relevance is not quite as good as Google (for example "howdoi get referrer url php") but this could be used when you enter a query that contains symbols.
- lambda 14y agoThat is exactly what I would have guessed. It's basically "I'm feeling lucky" for coding questions.