Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# !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