So, I couldn't decide how helpful this would be but since there are always so many questions I thought I would make a quick post about this. This is from the condenser(steemit) code where they call steemjs to get the post data in different ways. Basically just need to use what they are using for args as your query.
if (order === 'trending') {
call_name = 'getDiscussionsByTrendingAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if (order === 'trending30') {
call_name = 'getDiscussionsByTrending30Async';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if (order === 'promoted') {
call_name = 'getDiscussionsByPromotedAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'active' ) {
call_name = 'getDiscussionsByActiveAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'cashout' ) {
call_name = 'getDiscussionsByCashoutAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'payout' ) {
call_name = 'getPostDiscussionsByPayout';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'payout_comments' ) {
call_name = 'getCommentDiscussionsByPayout';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'updated' ) {
call_name = 'getDiscussionsByActiveAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'created' || order === 'recent' ) {
call_name = 'getDiscussionsByCreatedAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'by_replies' ) {
call_name = 'getRepliesByLastUpdateAsync';
args = [author, permlink, constants.FETCH_DATA_BATCH_SIZE];
} else if( order === 'responses' ) {
call_name = 'getDiscussionsByChildrenAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'votes' ) {
call_name = 'getDiscussionsByVotesAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'hot' ) {
call_name = 'getDiscussionsByHotAsync';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'by_feed' ) {
call_name = 'getDiscussionsByFeedAsync';
args = [
{ tag: accountname,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'by_author' ) {
call_name = 'getDiscussionsByBlogAsync';
args = [
{ tag: accountname,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'by_comments' ) {
call_name = 'getDiscussionsByCommentsAsync';
args = [
{ limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else {
call_name = 'getDiscussionsByActiveAsync';
args = [{
tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
}
I also saw a question from someone on how to grab multiple tags. If you are going to be running your own front-end you should consider using a database to store the posts and create a lookup for the tags. Alternatively if you are just using steemjs make one call for each tag and then combine the two into a set using the author and permlink as a key to dedupe your data. Lodash has some methods that would be very useful for this.