This is a set of Serverless functions for OpenFaaS that make a "Fanclub":
Here's how it works:
- Star a GitHub repository (configured by placing a webhook in your settings page)
- twitterfanclub function receives the JSON, downloads the user's avatar and posts it to S3
- twitterstargazer is called with the path in S3 - invokes a polaroid function with the image and Tweets it
This is an example of function chaining and use of external storage for persistence. This is important because functions are stateless and ephermeral.
See also: Function Chaining
- Functions in stack.yml
- get-avatar via https://github.com/alexellis/faas-dockercon
- Polaroid function - https://github.com/faas-and-furious/faas-contributor-stamp/tree/master/polaroid
Your Twitter API tokens need to go into a
Example polaroids shared by alexellisuk_bot:
- Got questions or want to find out more?