diff --git a/mastodon_multi_accounts.db b/mastodon_multi_accounts.db index ed32c16..a724412 100644 Binary files a/mastodon_multi_accounts.db and b/mastodon_multi_accounts.db differ diff --git a/routes/index.js b/routes/index.js index c0c2a69..1118c6f 100644 --- a/routes/index.js +++ b/routes/index.js @@ -116,6 +116,34 @@ router.get('/add-example', function (req, res, next) { // publier le message en db dans la file router.get('/publish-last-entry', function (req, res, next) { res.render('index', {title: 'Express'}); + getAllPosts(db).then( + (results) => { + console.log( "publier le premier message de la file d'attente" ,results[0]) + res.render('publish', {posts_list: results[0]}); + }, + (err) => console.error(err), + ); + }); +// répartir les publications dans le temps +// TODO +const limit_posts_per_day=10 + +router.get('/dispatch-publication-in-time', function (req, res, next) { + res.render('index', {title: 'Express'}); + getAllPosts(db).then( + (results) => { + console.log( "répartir" ,results[0]) + + // on compte les posts et quel intervalle de temps mettre entre chaque pour tenir le rythme de X posts par jour + + res.render('index', {posts_list: results[0]}); + }, + (err) => console.error(err), + ); + +}); + + module.exports = router; diff --git a/views/layout.jade b/views/layout.jade index 5995b3e..375980d 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -11,5 +11,6 @@ html a(href="/init-db") init DB a(href="/list") list DB a(href="/add-example") ajout à la file example + a(href="/publish-last-entry") publier premier block content diff --git a/views/publish.jade b/views/publish.jade new file mode 100644 index 0000000..a02dde4 --- /dev/null +++ b/views/publish.jade @@ -0,0 +1,8 @@ +extends layout + +block content + h1 Publié + div.post-message + strong.author= p.post_username + div.content= p.content + img(src=p.medias) \ No newline at end of file