Skip to content

Slackbot that queries the CKAN API of Berlin's open data portal for new datasets

License

Notifications You must be signed in to change notification settings

technologiestiftung/open-data-ckan-slackbot

Repository files navigation

All Contributors

Open Data CKAN Slackbot

This is a netlify function for a Slackbot that queries the CKAN API of Berlin's data portal for new datasets and for updated datasets. It's written in TypeScript, using the Bolt JS framework. It can be triggered via specific keywords in Slack messages. Also, it responds to the slash command /opendata [number of days] and then displays the new and updated records for the queried number of days.

Prerequisites

Installation

  • Run npm install to install all node dependencies.
  • Install Netlify CLI globally using the command npm install netlify-dev -g.
  • To run this function locally, you'll need to link your Netlify site with your repository. Easiest way is to create a .netlify folder and inside that, create a state.json file with the following contents. Get your site id or API id from the site settings and paste it here. Then run the command netlify link.
{
	"siteId": "PASTE YOUR API ID HERE"
}
  • Run netlify build to build your code and generate a function. This command uses the settings in the netlify.toml file to run a build command. The build command compiles TypeScript files into JavaScript and automatically creates the required netlify/functions folder for you and places the index.js function file inside this folder.
  • Run netlify dev to start a local development server to test your function. If the local server starts at port 8888, then the URL to access this function is http://localhost:8888/.netlify/functions/index.

Usage or Deployment

There are several steps necessary to get the Slackbot running.

  • deploy the function to netlify
  • integrate Slack by creating a Slack app, grabbing the credentials and integrating it into the function so that the function can communicate with the Slack app
  • configure the slack app to subscribe to events and to implement the slash command

All this steps are described in the Medium article "Creating a Slack Bot Using Netlify Functions" by Clyde D'Souza. You can follow the tutorial to get the app running and to deploy it.

Contributing

Before you create a pull request, write an issue so we can discuss your changes.

Contributors

Thanks goes to these wonderful people (emoji key):

Lisa-Stubert
Lisa-Stubert

📖 💻 🤔
Fabian Morón Zirfas
Fabian Morón Zirfas

🧑‍🏫

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits



Together with:

A project by:

Supported by:

About

Slackbot that queries the CKAN API of Berlin's open data portal for new datasets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published