1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2025-12-18 03:58:49 +00:00

Redesign disabled feed system

This commit is contained in:
Cadence Ember
2020-04-22 23:59:45 +12:00
parent 8300744d87
commit b7d3309a2b
9 changed files with 210 additions and 89 deletions

View File

@@ -4,6 +4,7 @@ const config = require("../../../config")
const TimelineEntry = require("./TimelineEntry")
const InstaCache = require("../cache")
const collectors = require("../collectors")
const {getFeedSetup} = require("../utils/feed")
require("../testimports")(constants, collectors, TimelineEntry, InstaCache)
/** @param {any[]} edges */
@@ -55,24 +56,8 @@ class Timeline {
}
async fetchFeed() {
// we likely cannot use full_name here - reel fallback would make the feed title inconsistent, leading to confusing experience
const usedName = `@${this.user.data.username}`
const feed = new Feed({
title: usedName,
description: this.user.data.biography,
id: `bibliogram:user/${this.user.data.username}`,
link: `${constants.website_origin}/u/${this.user.data.username}`,
feedLinks: {
rss: `${constants.website_origin}/u/${this.user.data.username}/rss.xml`,
atom: `${constants.website_origin}/u/${this.user.data.username}/atom.xml`
},
image: constants.website_origin+this.user.proxyProfilePicture,
updated: new Date(this.user.cachedAt),
author: {
name: usedName,
link: `${constants.website_origin}/u/${this.user.data.username}`
}
})
const setup = getFeedSetup(this.user.data.username, this.user.data.biography, constants.website_origin+this.user.proxyProfilePicture, new Date(this.user.cachedAt))
const feed = new Feed(setup)
const page = this.pages[0] // only get posts from first page
await Promise.all(page.map(item =>
item.fetchFeedData().then(feedData => feed.addItem(feedData))

View File

@@ -245,7 +245,7 @@ class TimelineEntry extends TimelineBaseMethods {
Readers should display the description as HTML rather than using the media enclosure.
enclosure: {
url: this.data.display_url,
type: "image/jpeg" //TODO: can instagram have PNGs? everything is JPEG according to https://medium.com/@autolike.it/how-to-avoid-low-res-thumbnails-on-instagram-android-problem-bc24f0ed1c7d
type: "image/jpeg" // Instagram only has JPEGs as far as I can tell
}
*/
}