post with tk blog ban

This commit is contained in:
Tykayn 2022-08-08 18:43:26 +02:00 committed by tykayn
parent 9eb196aaa5
commit 5ba26c4c04
12 changed files with 11 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -2,12 +2,13 @@
// import rp from "request-promise";
// import $ from "cheerio";
import fs from "fs";
import Masto from "mastodon";
import path from 'path';
const __dirname = path.resolve();
const tkpostsjson = JSON.parse(fs.readFileSync(__dirname +"/assets/documents/tykayn_wptkblog_posts.json", 'utf-8'))
import {sendPostMastodon} from './utils.js'
const __dirname = path.resolve();
const tkpostsjson = JSON.parse(fs.readFileSync(__dirname + "/assets/documents/tykayn_wptkblog_posts.json", 'utf-8'))
// const reallySendPost = false;
const reallySendPost = true;
export function getRandomElementOfArray(listItems) {
@ -30,19 +31,19 @@ function postLink() {
let limitExcerpt = 250
filteredExcerpt = filteredExcerpt.substring(0, limitExcerpt)
if(filteredExcerpt && counterLength > limitExcerpt){
filteredExcerpt = ' _'+filteredExcerpt+'…_'
if (filteredExcerpt && counterLength > limitExcerpt) {
filteredExcerpt = ' _' + filteredExcerpt + '…_'
}
let configPost = {
author: 'tykayn',
image: 'tk_blog_bannieres_oct2010-1.jpg',
message: `# [${postObject.post_title}](${postObject.guid})
* ${postObject.post_date} - ${postObject.guid}
${filteredExcerpt}
* #tykayn #tkblog #blog`,
reallySendPost: true,
// reallySendPost: false,
reallySendPost
}
console.log("configPost.message", configPost.message)
sendPostMastodon(configPost)

View File

@ -120,7 +120,7 @@ export function sendPostMastodon(config) {
id = resp.data.id;
params.media_ids = [id]
masto.post('statuses', params).then(rep => {
console.log('rep', rep)
// console.log('rep', rep)
console.log("posté avec une nouvelle image, WOOT")
}, err => {
console.error(err)

View File

@ -19,8 +19,8 @@ const __dirname = path.resolve();
const selectionOverrideOfSectionTable = '';
const selectionOverrideOfLineTable = '';
let foundExistingWikiPageInFrench = false;
// const reallySendToot = true;
// let foundExistingWikiPageInFrench = false;
const reallySendToot = true;
const reallySendPost = false;
function getRandomWikiOSMPage() {