As a GitHub and OSS enthusiast, have you ever experienced missing some of your important GitHub emails because tons of unread emails waiting in your mailbox . Or you wanna receive a custom notification when someone stars your repo but GitHub can never send such notifications to you.
Now, problem solved! You can receive custom event notifications directly in your Twitter account without checking your email by using a Serverless Message Queue — Vanus.
To achieve that we need one program to receive GitHub events and transform them into custom notifications we want and another Program to receive transformed notifications and send them to our Twitter account.
Luckily, Vanus has already provided many out-of-the-box Connectors that enable you to integrate with popular services or applications without writing any codes.
Here is how we can do this within 5 mins.
Go to Vanus Playground (an online K8s playground)
Click “Launch Terminal” to prepare an interactive K8s environment(Use your GitHub account to sign in).
Wait for preparing the K8s environment (usually less than 1 min). The terminal is ready when you see something like this:
- Install Vanus
kubectl apply -f https://vanus.s3.us-west-2.amazonaws.com/releases/v0.4.0/vanus.yaml
- Install vsctl (the command line tool)
curl -O https://vsctl.s3.us-west-2.amazonaws.com/releases/v0.4.0/linux-amd64/vsctl
chmod ug+x vsctl
mv vsctl /usr/local/bin
- Set the endpoint for vsctl
- Click the “GitHub-Twitter Scenario”
- Create an Eventbus to store your events
vsctl eventbus create --name github-twitter-scenario
- Run the GitHub Source
docker run --network=host -v $(pwd)/config.json:/vance/config/config.json --rm vancehub/source-github > a.log &
- Go to your repository and create a Webhook
- Follow the tutorial to set the configuration for your webhook.
- Click the button “Enter your Twitter Username” to specify your Twitter account.
- Copy and execute commands to create two subscriptions. Remember to check if the command contains your Twitter username.
- Follow Twitter account <@VanusNotify>, so VanusNotify service can send DM to you.
- Finally, star your repository and check your Twitter messages, it should be a message like:
- Open an issue in your repository and check your Twitter messages, it should be a message like:
Now, you’ve successfully received GitHub notifications in your Twitter account. Actually, you can receive any outside services in anywhere with Vanus and its’ filter and transformer. Learn more about Vanus here.
Vanus is an open-source, cloud-native, Serverless message queue for building EDA applications with Ease.
Try it and have fun with Vanus, guys.