Hackernews
Latest update
Changed the algorithm used in fetching the stories from the API. Instead of getting only the new (latest) stories, I now get the maximum or largest (latest) item ID, then walk backwards to fetch subsequent ones:
...
def get_max_item_id():
max_item_id = requests.get(f"{BASE_API_URL}/maxitem.json")
return max_item_id.json()
@shared_task
def store_latest_stories():
max_item_id = get_max_item_id()
for sid in reversed(range(max_item_id)):
story_response = get_item(sid)
...
Also, the UI now allows only the item types available in the database for filtering. As soon as a new item type is fetched from the API, it will automatically be added to the filters.
Update
It is live on heroku at newhackernews.herokuapp.com.
This application tends to make it easier to navigate Hackernews by utilizing its public API. It provides a…