Skip to content

Instantly share code, notes, and snippets.

@santiagobasulto
Created July 15, 2019 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santiagobasulto/2161629f60785cb6a0829a7d5dd60f61 to your computer and use it in GitHub Desktop.
Save santiagobasulto/2161629f60785cb6a0829a7d5dd60f61 to your computer and use it in GitHub Desktop.
# !pip install python-hn
import itertools
from hn import search_by_date
results = search_by_date('Who is hiring?', ask_hn=True, author='whoishiring', hits_per_page=1000)
who_is_hiring = (r for r in results if 'ask hn: who is hiring?' in r['title'].lower())
for elem in itertools.islice(who_is_hiring, 10):
print(elem['title'])
"""
Result:
Ask HN: Who is hiring? (July 2019)
Ask HN: Who is hiring? (June 2019)
Ask HN: Who is hiring? (May 2019)
Ask HN: Who is hiring? (April 2019)
Ask HN: Who is hiring? (March 2019)
Ask HN: Who is hiring? (February 2019)
Ask HN: Who is hiring? (January 2019)
Ask HN: Who is hiring? (December 2018)
Ask HN: Who is hiring? (November 2018)
Ask HN: Who is hiring? (October 2018)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment