DEV Community

kelsey-d
kelsey-d

Posted on

Sustainability Reporter Slack Bot

DEV Weekend Challenge: Generosity Edition Submission 💜

This is a submission for Weekend Challenge: Generosity Edition

What I Built

I'm currently volunteering on the Communications team at a sustainability nonprofit, GreenHomeNYC. One reason I volunteered was to keeps up with initiatives that drive a more sustainable lifestyle. Volunteers and board members communicate through Slack but on particular channel inthenews could use more life. I created a bot that will post a digest of articles on a set schedule.

Demo

Screenshot of Github Action run

Final output of run
Hopefully this is enough of a demo my project is a cron job.

Code

GitHub logo kelsey-d / sustainability-reporter

Slack bot posting the latest in sustainability news

Sustainability News Digest

A Slack bot that posts a daily digest of sustainability news, summarized by Google AI.

What It Does

  • Fetches the latest sustainability news from a free News API
  • Uses Google AI (Gemini) to generate a concise, insightful summary
  • Posts the digest to a Slack channel via webhook
  • Runs automatically on a schedule using GitHub Actions

Tech Stack

  • Language: TypeScript
  • Runtime: Node.js
  • AI: Google Gemini
  • News Source: GNews API
  • Slack: Incoming Webhooks
  • Automation: GitHub Actions (scheduled cron)

Setup Instructions

1. Clone the repository

git clone https://github.com/yourusername/sustainability-news-digest.git
cd sustainability-news-digest

2. Set up environment variables

Create a .env file in the root of the project:

NEWS_API_KEY=your_news_api_key
GOOGLE_AI_API_KEY=your_google_ai_key
SLACK_WEBHOOK_URL=your_slack_webhook_url

Run on a Schedule (GitHub Actions)

This repository includes a GitHub Actions workflow (.github/workflows/scheduled-digest.yml) that runs the bot daily. To enable it:

  1. Fork this repository
  2. Add your secrets (NEWS_API_KEY, GOOGLE_AI_API_KEY, SLACK_WEBHOOK_URL) in the repo Settings &gt…

How I Built It

I started this challenge at 6pm EDT on Sunday so I was pretty pressed for time. I already had the idea to create a Slack bot but I didn't know how ridiculously easy it would be. I had DeepSeek come up with a project timeline for me. ## Build Timeline

Time (EDT) Duration Task
6:00 PM 30 min Setup & Key Procurement – Sign up for News API, create Slack App, get webhook URL
6:30 PM 1 hr Project Scaffolding & News Fetch – Initialize project, write script to fetch news
7:30 PM 15 min Break
7:45 PM 1.5 hrs Google AI Integration – Format news and generate AI summary
9:15 PM 15 min Break
9:30 PM 1 hr Slack Integration – Format and post digest to Slack
10:30 PM 15 min Break
10:45 PM 1.5 hrs Deploy & Automate – Push to GitHub, set up GitHub Action
12:15 AM 15 min Break
12:30 AM 1.5 hrs Polish & Documentation – Write README, clean up code
2:00 AM 59 min Final Submission Prep – Screenshot, write Dev.to post, submit
2:59 AM DEADLINE – Submit your project!

Did I follow the timeline to a T? No, but I did go in this exact order. I gathered up all the variable I needed (keys and urls) GNews, Gemini and Slack.

Prize Categories

I'll attempt the Best Use of Google AI category. There is a couple of more things to fine tune but I'm implementing the whole make it exist first and make it good later philosophy.

Top comments (0)