post with tk blog ban
BIN
assets/tk_blog_bannieres_oct2010-1.jpg
Executable file
After Width: | Height: | Size: 50 KiB |
BIN
assets/tk_blog_bannieres_oct2010-10.jpg
Executable file
After Width: | Height: | Size: 24 KiB |
BIN
assets/tk_blog_bannieres_oct2010-3.jpg
Executable file
After Width: | Height: | Size: 26 KiB |
BIN
assets/tk_blog_bannieres_oct2010-4.jpg
Executable file
After Width: | Height: | Size: 38 KiB |
BIN
assets/tk_blog_bannieres_oct2010-5.jpg
Executable file
After Width: | Height: | Size: 17 KiB |
BIN
assets/tk_blog_bannieres_oct2010-6.jpg
Executable file
After Width: | Height: | Size: 23 KiB |
BIN
assets/tk_blog_bannieres_oct2010-7.jpg
Executable file
After Width: | Height: | Size: 27 KiB |
BIN
assets/tk_blog_bannieres_oct2010-8.jpg
Executable file
After Width: | Height: | Size: 25 KiB |
BIN
assets/tk_blog_bannieres_oct2010-9.jpg
Executable file
After Width: | Height: | Size: 25 KiB |
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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() {
|
||||
|