mirror of
https://github.com/dariusk/rss-to-activitypub.git
synced 2024-11-21 16:59:20 +02:00
parent
4888db441c
commit
609c640fc4
|
@ -21,11 +21,12 @@ router.get('/:name', function (req, res) {
|
|||
else {
|
||||
let actor = JSON.parse(result.actor);
|
||||
let username = name.replace('@'+domain,'');
|
||||
let content = db.prepare('select content from feeds where username = ?').get(username);
|
||||
if (content === undefined) {
|
||||
let resultFeed = db.prepare('select content, feed from feeds where username = ?').get(username);
|
||||
if (resultFeed === undefined) {
|
||||
return res.status(404).json(`Something went very wrong!`);
|
||||
}
|
||||
let feedData = JSON.parse(content.content);
|
||||
let feedData = JSON.parse(resultFeed.content);
|
||||
let feedUrl = resultFeed.feed;
|
||||
let imageUrl = null;
|
||||
// if image exists set image
|
||||
if (actor.icon && actor.icon.url) {
|
||||
|
@ -35,7 +36,7 @@ router.get('/:name', function (req, res) {
|
|||
if (actor.summary) {
|
||||
description = actor.summary;
|
||||
}
|
||||
res.render('user', { displayName: actor.name, items: feedData.items, accountName: '@'+name, imageUrl: imageUrl, description });
|
||||
res.render('user', { displayName: actor.name, items: feedData.items, accountName: '@'+name, imageUrl: imageUrl, description, feedUrl });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -10,6 +10,7 @@ html
|
|||
img(src=imageUrl)
|
||||
h3.account #{accountName}
|
||||
p #{description}
|
||||
p <a href="#{feedUrl}">#{feedUrl}</a>
|
||||
p <strong><em>What you're looking at is an RSS feed that's been converted into an account that Mastodon (or any other ActivityPub social network) can subscribe to. Put the username above into your user search and you should be able to find this feed and subscribe! <a href="/convert/">Click here to make an ActivityPub account for your favorite RSS feeds</a>.</em></strong>
|
||||
h2 Feed items
|
||||
ul
|
||||
|
|
Loading…
Reference in New Issue