mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-10 14:58:05 +00:00
author parameter to rss
optional parameter "author" to rss request so you can request posts just by a single author
This commit is contained in:
parent
69f90bca04
commit
7387619c2b
@ -24,6 +24,7 @@ int generateRSS(string uri, string *output)
|
||||
int max = 20; //default value
|
||||
string account = parameterMap["account"];
|
||||
string strMax = parameterMap["max"];
|
||||
string author = parameterMap["author"];
|
||||
if(strMax!="")
|
||||
{
|
||||
try
|
||||
@ -66,11 +67,20 @@ int generateRSS(string uri, string *output)
|
||||
params1.push_back(account);
|
||||
Array followingArray = getfollowing(params1,false).get_array();
|
||||
Array postSources;
|
||||
for(int i=0;i<followingArray.size();i++)
|
||||
{
|
||||
Object item;
|
||||
item.push_back(Pair("username",followingArray[i]));
|
||||
postSources.push_back(item);
|
||||
|
||||
if(author=="") {
|
||||
// default fetch posts from all followed authors
|
||||
for(int i=0;i<followingArray.size();i++)
|
||||
{
|
||||
Object item;
|
||||
item.push_back(Pair("username",followingArray[i]));
|
||||
postSources.push_back(item);
|
||||
}
|
||||
} else {
|
||||
// a single author has been specified to fetch posts from
|
||||
Object item;
|
||||
item.push_back(Pair("username",author));
|
||||
postSources.push_back(item);
|
||||
}
|
||||
|
||||
Array params2;
|
||||
|
Loading…
Reference in New Issue
Block a user