At The New York Times, a bot was built and then re-tuned that allowed writers and editors to monitor Reddit conversations around their content, get real-time feedback from the community and even join the conversation. The tool alerted the newsroom via a Slack channel.
Why it Matters:
Reddit community conversations can be an important tool for digital publishers to engage with their audiences. While the Slack bot monitoring Reddit conversations had been helpful for the Times, the Perl code was outdated. To update it so it could be used with Google services, the team used Maker Day, along with infrastructure tools such as Google App Engine.
Here’s a look at the process for how the bot works:
- Google App Engine cron job hits the Times service to kick off the process.
- The service grabs the top 300 nytimes.com links shared to reddit via their JSON endpoint.
- The service uses Google Cloud Datastore to store comment counts to determine what to alert and what has already been alerted.
- The service uses NYT’s internal GraphQL Sangria server to fetch additional metadata about the nytimes.com article.
- The service posts an update to a Slack channel with the real headline, the title of the Reddit post, the subreddit the post occurred in, and how many comments currently exist.
The team also utilized access to the Google Cloud project in order to deploy the service and access credentials for the GraphQL service. They use HashiCorp Vault to share secrets, like API credentials and database passwords and then secure those secrets in the Times’ own Vault store.
The Bottom Line:
Once the Reddit Slack bot was deployed, it would scan Reddit for the most commented-on Times articles, and basic information could be stored in Cloud Datastore with minimal effort.