Compare commits

...

8 Commits

Author SHA1 Message Date
spike 57f92d1e80 should work with python3 2 years ago
Chakib Benziane 2588144a58 Update README.rst 7 years ago
Chakib Benziane d3cab5fbd1 Update README.rst 7 years ago
Chakib Benziane 5077ec3620 Update README.rst 11 years ago
Chakib Benziane 435939d953 Update README.rst 11 years ago
Chakib Benziane 293805a53d Add todolist 12 years ago
Chakib Benziane ccd8719a31 Update LICENSE.txt 12 years ago
Chakib (spike) Benziane 436c73c423 update dependencies.txt 12 years ago

@ -1,4 +1,4 @@
Copyright (C) 2012 Chakib (sp4ke) Benziane (chakib.benz@gmail.com)
Copyright (C) 2013 Chakib (sp4ke) Benziane (chakib.benz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),

@ -1,3 +1,7 @@
*no longer maintained*, I recommend socli_ instead.
.. _socli: https://github.com/gautamkrishnar/socli
=====================================
HowTo - StackOverflow Code Search Tool
=====================================
@ -6,6 +10,11 @@ Quick code answers from StackOverflow API.
Just ask a question with an optional tag parameter to get quick code answers.
Inspired by howdoi_
.. _howdoi: https://github.com/gleitz/howdoi
Installation
============
@ -23,4 +32,11 @@ Usage
::
$> ./howto 'filter dicts' -t python
$> howto 'filter dicts' -t python
TODO
====
* Interactive mode to get next answer
* Add nixcraft search support

@ -1,5 +1,4 @@
cssselect==0.7.1
ipython==0.13.1
lxml==3.1beta1
py-stackexchange==1.1-4
pyquery==1.2.4

@ -18,7 +18,7 @@ class SOSearch(Site):
super(SOSearch, self).__init__(self.domain, **kw)
self.qs = self.search(order=DESC, sort='votes', tagged=self.tags,
intitle=self.qs, filter='!-u2CTCMX')
if self.qs.total == 0:
if len(self.qs) == 0:
raise NoResult
def first_q(self):
@ -68,10 +68,10 @@ def main(args):
so = SOSearch(args.query, args.tags)
result = so.first_q().best_answer.code
if result != None:
print result
print(result)
else:
print("Sorry I can't find your answer, try adding tags")
except NoResult, e:
except NoResult:
print("Sorry I can't find your answer, try adding tags")