274 lines
5.5 KiB
JavaScript
274 lines
5.5 KiB
JavaScript
import Path from "path"
|
|
|
|
import {
|
|
createFeed,
|
|
pullImages,
|
|
writeView,
|
|
createView,
|
|
processCategories,
|
|
createCache,
|
|
} from "./lib.js";
|
|
import nitter from "./platforms/nitter.js";
|
|
import tumblr from "./platforms/tumblr.js";
|
|
import mastodon from "./platforms/mastodon.js";
|
|
import bluesky from "./platforms/bluesky.js";
|
|
|
|
const nitterInstances = [
|
|
"xcancel.com",
|
|
"nitter.privacydev.net",
|
|
"nitter.poast.org",
|
|
"nitter.lucabased.xyz",
|
|
"nitter.lunar.icu",
|
|
"nitter.kavin.rocks",
|
|
"nitter.tiekoetter.com",
|
|
"nitter.qwik.space",
|
|
"bird.habedieeh.re",
|
|
"t.com.sb",
|
|
"nitter.moomoo.me",
|
|
"nitter.bird.froth.zone",
|
|
"nitter.kylrth.com",
|
|
"nitter.io.lol",
|
|
"nitter.rawbit.ninja",
|
|
"n.populas.no",
|
|
"nitter.holo-mix.com"
|
|
];
|
|
|
|
const view = await createView({
|
|
path: Path.isAbsolute(process.argv[2]) ? process.argv[2] : Path.join(process.cwd(), process.argv[2]),
|
|
pageSize: 20,
|
|
imageStoreDirectory: 'images'
|
|
})
|
|
|
|
let cache = await createCache({
|
|
enabled: true,
|
|
path: Path.join(view.path, 'cache'),
|
|
directoryUrl: 'https://localhost:8080/cache/'
|
|
})
|
|
|
|
let blueskyClient = await bluesky.login('danny---farrow.bsky.social', 'xPLDRAYZkV6Qjhnf@uqAdB#jJiJWN@4NngAD%wd@HSme4!bVeNs%7f4Zf24Lsvz8')
|
|
|
|
let sourceOptions = {
|
|
courtesyWait: 1000
|
|
}
|
|
|
|
const handleTumblrPost = post => {
|
|
if(tumblr.isRepost(post))
|
|
return
|
|
|
|
post = processCategories(post)
|
|
|
|
return pullImages(post, view, true)
|
|
}
|
|
|
|
const handleTumblrFiltering = (post, whitelist, blacklist) => {
|
|
if(tumblr.matchesTags(post, whitelist, blacklist))
|
|
return handleTumblrPost(post)
|
|
}
|
|
|
|
const createTumblrSource = user =>
|
|
tumblr.createSource(user, sourceOptions, handleTumblrPost, cache)
|
|
|
|
const createTumblrSources = (users, ...args) =>
|
|
users.map(createTumblrSource)
|
|
|
|
const handleNitterPost = post => {
|
|
if(nitter.isRepost(post))
|
|
return
|
|
|
|
return nitter.pullImages(post, view, 'https://d.fxtwitter.com', true)
|
|
}
|
|
|
|
const createNitterSource = user =>
|
|
nitter.createSource(user, { courtesyWait: 2000, retryAttempts: 1 }, nitterInstances, handleNitterPost, cache)
|
|
|
|
const createNitterSources = (users, ...args) =>
|
|
users.map(createNitterSource)
|
|
|
|
const handleMastodonPost = post => {
|
|
return mastodon.pullImages(post, view, true)
|
|
// return post
|
|
}
|
|
|
|
const createMastodonSources = (users, ...args) =>
|
|
users.map(user =>
|
|
mastodon.createSource(user, sourceOptions, handleMastodonPost, cache)
|
|
)
|
|
|
|
const handleBlueskyPost = post => {
|
|
if(bluesky.isRepost(post))
|
|
return
|
|
|
|
return bluesky.pullImages(post, view, true)
|
|
}
|
|
|
|
const createBlueskySource = (usertag) =>
|
|
bluesky.createSource(usertag, {}, blueskyClient, handleBlueskyPost, cache)
|
|
|
|
const pushFeed = (name, sources, main) => {
|
|
Promise.all(sources)
|
|
.then(sources => feeds.push(createFeed(name, sources, main)))
|
|
|
|
return sources
|
|
}
|
|
|
|
let feeds = []
|
|
|
|
let sources = await Promise.all(
|
|
pushFeed('main', [
|
|
|
|
pushFeed('interesting', [
|
|
...createMastodonSources([
|
|
'NanoRaptor@bitbang.social',
|
|
]),
|
|
...createTumblrSources([
|
|
'nemfrog',
|
|
])
|
|
]),
|
|
|
|
...createMastodonSources([
|
|
'Ailantd@mastodon.art'
|
|
]),
|
|
|
|
...createNitterSources([
|
|
'imo10_',
|
|
'evv_uu',
|
|
'sorochii_',
|
|
'loafyfloff',
|
|
'Alopex',
|
|
'choecoga',
|
|
'Serpent____x',
|
|
'doej0b',
|
|
'FoxanderS',
|
|
'nyano52',
|
|
'mikeyswag13',
|
|
'myauyenn',
|
|
'RahksArt',
|
|
'falvie',
|
|
'Moux98049818',
|
|
'kasettetape',
|
|
'sonnytherat',
|
|
'FRIICKLORD',
|
|
'outset666',
|
|
'moja12deer',
|
|
'ramahuro',
|
|
'animalartcrimes',
|
|
'RoawayArt',
|
|
'tuplepaw',
|
|
'kopeniko_o',
|
|
'evilstaplers',
|
|
'dozakeet',
|
|
'SoulFullHyena',
|
|
'dexidoodles',
|
|
'MistakeHarvest', // They have a newgrounds
|
|
'yaki_lulu',
|
|
'33feareraser',
|
|
'jaimeWallowa',
|
|
'gramm_wein',
|
|
'itooku',
|
|
'phimeirai',
|
|
'SWAGGERQUAGGER',
|
|
'muad_daum',
|
|
'bugatticat',
|
|
'yarharcannon', // YES
|
|
'POCHOWEK',
|
|
|
|
'pinkycloudyboi',
|
|
'kherspurrs',
|
|
'fluorurodecobre',
|
|
]),
|
|
|
|
...createTumblrSources([
|
|
'echoprojectstruggletweets',
|
|
'gutter-bunny-art',
|
|
'coochiekrab',
|
|
'slowedmountains',
|
|
'cbts004',
|
|
'bobbydabob',
|
|
|
|
'storieldraw',
|
|
'luxjii',
|
|
'cartvage',
|
|
'kristenplescow',
|
|
'yaigi-gi',
|
|
'hools',
|
|
'devogamer',
|
|
// 'emeraldotter',
|
|
'dog-chows',
|
|
'magicsamart',
|
|
'marrzbugz',
|
|
'muzinabu',
|
|
'rabosa-al-forn',
|
|
'dreameleon',
|
|
'gamgyuls',
|
|
'tashaaaa',
|
|
'nevgig',
|
|
'ovopack',
|
|
'rfskia',
|
|
'peskypawz',
|
|
'discommunicator',
|
|
'chalkrub',
|
|
'jaquin',
|
|
'nekojiima',
|
|
// 'ookuru',
|
|
'turnipot',
|
|
'scpkid',
|
|
'shiki21',
|
|
'internethomepage',
|
|
'oreostock',
|
|
'sadfurs',
|
|
'falcoworks',
|
|
'oxydoodles',
|
|
'fourleafisland',
|
|
'catmask',
|
|
'hal-monitor',
|
|
'thecardeepend',
|
|
'zenniefox',
|
|
'mitchell-fjn',
|
|
'robogrind',
|
|
'discopaws',
|
|
'c0mpoundeyes',
|
|
'royalnaym',
|
|
'dakedres',
|
|
'mrrwsoup',
|
|
'vewn',
|
|
'vilebite',
|
|
'dedbut2',
|
|
'kazunekomori',
|
|
'shamerli',
|
|
'squawq7',
|
|
'critterly',
|
|
'soap-stone',
|
|
'raymodule',
|
|
'mcromwell',
|
|
'maxpawb',
|
|
// 'catjest3r',
|
|
'gr33ngr1zz',
|
|
'bleatnik',
|
|
'ljesak',
|
|
]),
|
|
|
|
...pushFeed('kaleidocollie', [
|
|
createTumblrSource('kaleidocollie'),
|
|
createNitterSource('KaleidoCollie')
|
|
]),
|
|
|
|
// createBlueskySource('edneqivo.bsky.social'),
|
|
// createBlueskySource('wintomsky.bsky.social')
|
|
|
|
], true)
|
|
)
|
|
|
|
// Instagram:
|
|
// - https://linktr.ee/ouhmathew
|
|
|
|
// FA:
|
|
// - https://www.furaffinity.net/user/dogupsidedown/
|
|
|
|
await Promise.all([
|
|
cache.batch.complete(),
|
|
view.batch.complete()
|
|
])
|
|
|
|
if(process.argv[3] === 'view')
|
|
await writeView(sources, feeds, view)
|