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:
Anomaly UK 2016-02-09 16:58:32 +00:00
parent 69f90bca04
commit 7387619c2b

View File

@ -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;