import {createMastoFetcherWithAuthorLogin} from "./libs/utils.mjs"; import moment from 'moment' moment.locale('fr') console.log('' + '' + '' + '' + '' + '.avatar{ margin-right: 1em; margin-bottom: 1em; width: 4rem; height: 4rem;}'+ '') console.log('get mentions on all accounts managed') export async function getMentionsOfAccount(accountToFetch) { console.log('\n fetching account: ', accountToFetch) const masto = createMastoFetcherWithAuthorLogin(accountToFetch) let results = {} results = await masto.get('notifications??exclude_types[]=follow&exclude_types[]=follow_request&exclude_types[]=favourite&exclude_types[]=reblog&exclude_types[]=poll&exclude_types[]=status&exclude_types[]=update&exclude_types[]=admin.sign_up&exclude_types[]=admin.report') // console.log('results',results) console.log('
# mentions du compte ' + accountToFetch) results.data.forEach(item => { if(item.type !=='follow'){ // if(item.type =='mention'){ // console.log('item', item) console.log('\n
from ', item.account.username, '') // console.log('in reply to ', item.status.in_reply_to_id ) // console.log('language', item.status.language ) if (item.status) { console.log(` lien`) console.log('\n : ',item.type,' :', moment(item.status.created_at).format('dddd YYYY-MM-DD HH:ii:ss')) console.log('\n
', item.status.content, '
') } else{ console.log('
',item,'
') console.log('') } console.log('
') } // } }) console.log('
\n
') } const accounts = [ 'qzine', 'tykayn', 'curator', 'kurator', // 'modominem', 'voixdunucleaire', // 'voicesofnuclear', 'afis91' ] accounts.forEach(item => getMentionsOfAccount(item)) console.log('') console.log('')