This project contains a Firebase Cloud Function that, when fired with a HTTP Request, tweets a collage image with albums and artists from your Last.fm charts. The generated images are powered by Tapmusic.
- Create a new project on https://developer.twitter.com/
- Create a new project on http://console.firebase.google.com/
- Clone this repository
- Run
firebase init
to associate the directory into your Firebase project - Copy the
.env.example
file into a new.env
file and replace the placeholder values with information from your Last.fm account and from your Twitter Project
Run firebase deploy
to deploy the function into your Firebase project.
Make a POST request to /tweetLastFmCollageImage
to get your image tweeted. Be
sure to set the secret_key
in the request headers (the same secret key from
your .env
file).
The following optional parameters can be passed in your request body to customize the output collage image:
{
"collage": {
"type": "7day", // one of: 7day, 1month, 3month, 6month, 12month, overall
"size": "5x5", // one of: 3x3, 4x4, 5x5, 10x10
"caption": false,
"playcount": false
}
}