datamade / bga-payroll

💰 How much do your public officials make?
4 stars 4 forks source link

Dynamically populate story feed #488

Closed hancush closed 3 years ago

hancush commented 3 years ago

Description

This pull request adds a Django endpoint that retrieves stories from BGA's newsroom RSS feed, and JavaScript to hit the endpoint and populate the story feed on the site. I chose to retrieve the feed in Python in order to cache the response and limit the load on BGA servers (rather than hitting their site every time someone visits a page on the Salaries site). I chose to populate the feed in JavaScript because we cache full templates, and we don't want the feed to be coupled with template caching. (Right now, templates and the RSS endpoint are cached for the same amount of time, but we may want to increase timeout for templates prior to launch; implementing feed caching separately grants us this flexibility.)

Testing instructions

Handles #482.