Hello,
These days, I see a lot of automated blogs on a domain I like : finance & stock market. They publish articles that seems writed with a script.
I wonder how they do this. Maybe they take the financial datas on Google finance? But how do they automatically inject them in a blog post?
Thanks a lot
A post template with the standard text and placeholders with formatting rules for the data and a future publish date. Wordpress can do all this. Lots of articles automated publishing with wordpress.
I don’t understand the “placeholders with formatting rules for the data” part…
I googled it but found nothing.
Could you please explain a little further?
Thanks!
What a placeholder looks like depends on what technology your using. Handlebars style:
Dear {{title}} {{last-name}}
Where title and last-name are database field names or keys from a JSON file.
Different style: Dear {% title %} {% last-name %}
I didn’t call them templates because templates can go way beyond simple substitution and in the context and platforms that I use they are placeholders.
If you get your data as JSON from an API the dates and currency probably won’t look exactly the same as you want. A computer date stamp doesn’t look like “23 July, 2019”. You need to program something to “format” it.