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 rp from "request-promise";
|
||||||
// import $ from "cheerio";
|
// import $ from "cheerio";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import Masto from "mastodon";
|
|
||||||
import path from 'path';
|
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'
|
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) {
|
export function getRandomElementOfArray(listItems) {
|
||||||
@ -30,19 +31,19 @@ function postLink() {
|
|||||||
|
|
||||||
let limitExcerpt = 250
|
let limitExcerpt = 250
|
||||||
filteredExcerpt = filteredExcerpt.substring(0, limitExcerpt)
|
filteredExcerpt = filteredExcerpt.substring(0, limitExcerpt)
|
||||||
if(filteredExcerpt && counterLength > limitExcerpt){
|
if (filteredExcerpt && counterLength > limitExcerpt) {
|
||||||
filteredExcerpt = ' _'+filteredExcerpt+'…_'
|
filteredExcerpt = ' _' + filteredExcerpt + '…_'
|
||||||
}
|
}
|
||||||
|
|
||||||
let configPost = {
|
let configPost = {
|
||||||
author: 'tykayn',
|
author: 'tykayn',
|
||||||
|
image: 'tk_blog_bannieres_oct2010-1.jpg',
|
||||||
message: `# [${postObject.post_title}](${postObject.guid})
|
message: `# [${postObject.post_title}](${postObject.guid})
|
||||||
|
|
||||||
* ${postObject.post_date} - ${postObject.guid}
|
* ${postObject.post_date} - ${postObject.guid}
|
||||||
${filteredExcerpt}
|
${filteredExcerpt}
|
||||||
* #tykayn #tkblog #blog`,
|
* #tykayn #tkblog #blog`,
|
||||||
reallySendPost: true,
|
reallySendPost
|
||||||
// reallySendPost: false,
|
|
||||||
}
|
}
|
||||||
console.log("configPost.message", configPost.message)
|
console.log("configPost.message", configPost.message)
|
||||||
sendPostMastodon(configPost)
|
sendPostMastodon(configPost)
|
||||||
|
@ -120,7 +120,7 @@ export function sendPostMastodon(config) {
|
|||||||
id = resp.data.id;
|
id = resp.data.id;
|
||||||
params.media_ids = [id]
|
params.media_ids = [id]
|
||||||
masto.post('statuses', params).then(rep => {
|
masto.post('statuses', params).then(rep => {
|
||||||
console.log('rep', rep)
|
// console.log('rep', rep)
|
||||||
console.log("posté avec une nouvelle image, WOOT")
|
console.log("posté avec une nouvelle image, WOOT")
|
||||||
}, err => {
|
}, err => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
@ -19,8 +19,8 @@ const __dirname = path.resolve();
|
|||||||
const selectionOverrideOfSectionTable = '';
|
const selectionOverrideOfSectionTable = '';
|
||||||
const selectionOverrideOfLineTable = '';
|
const selectionOverrideOfLineTable = '';
|
||||||
|
|
||||||
let foundExistingWikiPageInFrench = false;
|
// let foundExistingWikiPageInFrench = false;
|
||||||
// const reallySendToot = true;
|
const reallySendToot = true;
|
||||||
const reallySendPost = false;
|
const reallySendPost = false;
|
||||||
|
|
||||||
function getRandomWikiOSMPage() {
|
function getRandomWikiOSMPage() {
|
||||||
|