A Guide to Using Anypoint Studio to get GitHub Notifications through Twitter, Part 2

twitter github mule

This article was written by guest author Michal Kalita and first appeared on Profiq

I have developed two solutions for users to get informed on source code changes on GitHub, when they are sharing code with other developers. I described the first solution in a previous article. This article describes the second solution. You are welcome to try both approaches, and then decide which works best for you.

 

Solution 2: Polling the Repo for Changes

This solution is especially useful if you don’t have administrative rights to the GitHub repository or you don’t have a publicly available server to run your MuleSoft instance. Your MuleSoft instance doesn’t have to run all day and the application can run locally on your computer. When your MuleSoft instance is down, messages that were not delivered will get synchronized when the instance is restarted.

Here comes the process schema:

anypoint studio github twitter

anypoint studio github twitter

So How Do You Deploy these Solutions?

The guide on how to install Anypoint Studio and set up the connector are described in the previous article. You will need to use the project named localServer.

Setup GitHub API Access

Anonymous access to GitHub API is limited to 60 requests per hour.

  1. Create a new access token to make 5000 request per hour. Here is a screenshot of what you need to do:

anypoint studio github twitter

  1. Just fill the Token description and generate the token. You can use the generated token as a password to the GitHub API.
  2. Open your project XML definition and find the “http:digest-authentication” tag. Assign your GitHub username to username and the generated token to password.

The rest of the setup – including setting up the server, deploying the app to the server, and testing the final solution – is the same as the previous article. The only exception is that this solution does not require GitHub webhook setup, so you can skip that step.

Summary

Similar to the first solution, this second solution leads to a smooth integration! You can test out both solutions and then decide which works best for you and your team. Enjoy the process and please send any feedback my way!


 


We'd love to hear your opinion on this post