Skip to content

Commit

Permalink
Merge pull request #8 from antoninoLorenzo/master
Browse files Browse the repository at this point in the history
New Example: search.py
  • Loading branch information
wchistow authored Sep 23, 2023
2 parents ad54789 + aa6cb1f commit c7b3aa3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pystackapi import Site
from pystackapi.sites import StackOverflow

site = Site(StackOverflow)

# Search for questions about Python
about = site.search(intitle = 'Python')
q1 = about[0]

# Search for the topic Python
topic = site.search(tagged = 'Python')
q2 = topic[0]

# Either `intitle` or `tagged` should be passed
# otherwise BadArgumentsError is passed
print(f'{q1}\n')
print(f'{q2}\n')

0 comments on commit c7b3aa3

Please sign in to comment.