Compilation Post Generator for Curators

in OCD2 months ago (edited)

Introduction

As a Curator myself, I find the task of creating compilation posts very tedious, with a lot of time spent just doing copy / paste. This also makes the process error-prone, while doing something that can be easily automated. So I created a Javascript tool to do it for me! 😁

Today I'm sharing this tool with the community, and explaining how it works. You can find it on GitHub, here: https://github.com/Funecio-Agrante/ocd-compilation-generator/

Anyone doing compilation posts can use it and save time generating the markdown of the post. I understand not everyone feels comfortable setting up a tool that requires some coding, so I'm willing to help any OCD Curators set it up for their existing curation post template. Just leave a comment here or contact me via Discord.


Basic principles

I explain the installation steps on the GitHub page, so please refer to that for details.

This is a small Javascript script that runs locally on your computer. It reads data you provide in a JSON file, for example:

  • compilation number

  • a date

  • URL of the selected Hive posts

  • Your personalized comment about each post

  • A preview of the posts' content

Here is a concrete example from my own compilations. Note that you can add or remove information to suit your needs.

Example of the data in JSON format, prepared by the Curator

The script reads the URL and automatically retrieves more information from the Hive API:

  1. Cover image URL

  2. Post title

 

Then, the data is fed to a Handlebars template. This is a file that looks similar to your compilation post (the raw markdown), only the places where the information goes are marked by placeholders.

The bit that repeats for each post exists just once, with controls that indicate it is to be repeated for each 'post' entry in the JSON data file. If you always use the same template, you only need to work on this file one time during setup and then it should work without further modifications. Mine looks like this:

Example of the Handlebars template

The main script is adjusted to point to your files. Then, to create the markdown ready to publish, you just need to open a terminal and type npm start -- <your_data_file>.json to run the script.


Workflow

1º Once everything is set up, you can load a previous JSON file in an online JSON editor to make the editing easier and avoid JSON syntax errors. This particular editor seems to remember the last file you edited, so makes things even smoother. You can use the editor tools to easily add or remove post entries, as demonstrated in the screenshot below:

Source: https://jsoneditoronline.org/


2º Make all the necessary changes to the source data and save the JSON file in the compilation_data folder.

3º Open a terminal in the root folder of the compilation tool (where ìndex.js is located) and issue the execution command, pointing to your newly edited file:
npm start -- <your_data_file>.json.
A new ready to publish compilation file will be saved in the compilation_datafolder.

That's it! If you find any typos or mistakes, just edit the JSON file and run the script again. The markdown file will be replaced to reflect the changes you made.


I hope you find this tool useful as part of your curation duties. Let me know if you'd like some help setting it up.

Thanks for reading!



AI image generated with Nightcafé Studio

Sort:  

This would save a lot of stress by far. Thank you for sharing this useful piece of information.

Congratulations @agrante! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You made more than 300 comments.
Your next target is to reach 400 comments.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP