mirror of
https://github.com/dariusk/rss-to-activitypub.git
synced 2024-11-22 09:19:19 +02:00
parent
4888db441c
commit
609c640fc4
|
@ -21,11 +21,12 @@ router.get('/:name', function (req, res) {
|
||||||
else {
|
else {
|
||||||
let actor = JSON.parse(result.actor);
|
let actor = JSON.parse(result.actor);
|
||||||
let username = name.replace('@'+domain,'');
|
let username = name.replace('@'+domain,'');
|
||||||
let content = db.prepare('select content from feeds where username = ?').get(username);
|
let resultFeed = db.prepare('select content, feed from feeds where username = ?').get(username);
|
||||||
if (content === undefined) {
|
if (resultFeed === undefined) {
|
||||||
return res.status(404).json(`Something went very wrong!`);
|
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;
|
let imageUrl = null;
|
||||||
// if image exists set image
|
// if image exists set image
|
||||||
if (actor.icon && actor.icon.url) {
|
if (actor.icon && actor.icon.url) {
|
||||||
|
@ -35,7 +36,7 @@ router.get('/:name', function (req, res) {
|
||||||
if (actor.summary) {
|
if (actor.summary) {
|
||||||
description = 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)
|
img(src=imageUrl)
|
||||||
h3.account #{accountName}
|
h3.account #{accountName}
|
||||||
p #{description}
|
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>
|
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
|
h2 Feed items
|
||||||
ul
|
ul
|
||||||
|
|
Loading…
Reference in New Issue