forked from sam/fedifeed
comments and package audit
This commit is contained in:
parent
0626e6d426
commit
de73654554
2 changed files with 16 additions and 20 deletions
|
@ -2,6 +2,8 @@ var ejs = require('ejs');
|
|||
var fs = require('fs');
|
||||
var template = ejs.compile(fs.readFileSync('./lib/template.ejs', 'utf8'));
|
||||
var timeAgo = require('timeago.js');
|
||||
|
||||
// TODO try https://www.npmjs.com/package/request-promise-cache for the requests
|
||||
var request = require('request-promise-native')
|
||||
|
||||
// get JSON for an AP URL
|
||||
|
@ -38,13 +40,9 @@ module.exports = async function (opts) {
|
|||
// get user, then outbox, then feed
|
||||
|
||||
user = await apGet(userUrl);
|
||||
|
||||
if (userUrl && !feedUrl) {
|
||||
isIndex = true;
|
||||
var outbox = await apGet(user.outbox);
|
||||
feedUrl = outbox.first;
|
||||
}
|
||||
|
||||
isIndex = true;
|
||||
var outbox = await apGet(user.outbox);
|
||||
feedUrl = outbox.first;
|
||||
feed = await apGet(feedUrl);
|
||||
|
||||
}
|
||||
|
@ -75,12 +73,10 @@ function metaForUser(user) {
|
|||
function itemsForFeed(user,feed) {
|
||||
|
||||
return feed.orderedItems.filter((item)=>{
|
||||
// this is temporary, don't handle boosts
|
||||
// this is temporary, don't handle boosts (TODO)
|
||||
return item.type == "Create" && item.object && item.object.type=="Note";
|
||||
}).map((item)=>{
|
||||
|
||||
|
||||
//needs to be { type, url }
|
||||
var enclosures = (item.object.attachment||[]).filter((a)=>{
|
||||
return a.type == "Document";
|
||||
}).map((a)=>{
|
||||
|
|
20
npm-shrinkwrap.json
generated
20
npm-shrinkwrap.json
generated
|
@ -548,9 +548,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"fstream": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
|
||||
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
|
||||
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
|
@ -859,9 +859,9 @@
|
|||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
|
||||
},
|
||||
"lodash.assign": {
|
||||
"version": "4.2.0",
|
||||
|
@ -1670,13 +1670,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"tar": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
|
||||
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz",
|
||||
"integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"block-stream": "*",
|
||||
"fstream": "^1.0.2",
|
||||
"fstream": "^1.0.12",
|
||||
"inherits": "2"
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue