news posts
This commit is contained in:
@@ -18,9 +18,13 @@ DB.getDB.then((DB) => {
|
||||
|
||||
const generateNonOrganicPosts = async (req, profileid) => {
|
||||
let posts = [];
|
||||
// News Posts
|
||||
const newsPosts = await DB.getNews();
|
||||
posts.push(...newsPosts);
|
||||
|
||||
// Popular Profiles
|
||||
const popularProfiles = await DB.getPopularProfiles(5);
|
||||
let content = "Active users to follow:\n";
|
||||
content = "Active users to follow:\n";
|
||||
popularProfiles.forEach((p)=>{
|
||||
content += "@p:" + p._id + "\n";
|
||||
});
|
||||
@@ -60,6 +64,10 @@ DB.getDB.then((DB) => {
|
||||
mergedPosts.push(organic.shift());
|
||||
continue;
|
||||
}
|
||||
if(nonOrganic[0].nonOrganicType == 'News'){
|
||||
mergedPosts.push(nonOrganic.shift());
|
||||
continue;
|
||||
}
|
||||
if(Math.random() < 0.2){
|
||||
mergedPosts.push(nonOrganic.shift());
|
||||
} else {
|
||||
@@ -132,7 +140,7 @@ DB.getDB.then((DB) => {
|
||||
return res.json({
|
||||
status: "ok"
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.post("/unreact", async (req, res) => {
|
||||
let profileid = getProfileId(req);
|
||||
|
||||
Reference in New Issue
Block a user