Some of the early Utopians will remember the Utopian Weekly, the Newsletter promoting the most interesting projects and contributions of the past week. As you might notice, the last Weekly has been posted quite a while ago... To give the name "Weekly" a bit more meaning again, we decided to automate the process as far as possible. ;)
Right now there's still some manual work needed as we can't pull all the data that's needed from the API, like images and a proper project description. But what it does for now is the following:
- read two Twig templates, one for the markdown and one for the HTML version for mails
- render and populate them with data from the API (projects, contributions, moderators, sponsors)
- make a post on the Steem blockchain and send an email
- (generate a general purpose markdown template)
Not too special but does what it's supposed to do.
If you look in the repository there are a lot of files because what you see is the Vue.js webpack template. I wanted and still want to have a UI to generate and edit templates. That's why all this is there, although currently only two files are relevant. Maybe I should have started with just those two files but... well... it's committed now, so be it. :]
// generate weekly templates with data node src/weekly --generate
// generate templates and publish post/mail node src/weekly --generate-and-send
// publish post/mail from a template that's already generated node src/weekly --send-generated static/archive/utopian-weekly-yyyy-mm-dd
// generate general post template for other purposes: node src/post
- integrate newsletter subscribers (currently only a test mail gets sent because email version is still postponed)
- pull project images and descriptions from the API once available
- improve algorithm to sort projects
- implement UI (Vue) to edit and generate templates
- more decoupled approach to make it more general purpose
I would be most interested in the UI thing. If there's someone who want's to work on this with Vue.js, contact me on discord (@mkt#8655).
For everything else... simply fork and submit pull requests. You are also very welcome to fork and adjust things to use it with your own templates.
Posted on Utopian.io - Rewarding Open Source Contributors