Skip to content

Commit aa3e989

Browse files
authored
Merge pull request #58 from fbsamples/topic-tag-publishing
Topic Tag Publishing
2 parents 5459153 + 4b6c87a commit aa3e989

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const PARAMS__RETURN_URL = 'return_url';
9292
const PARAMS__SCOPE = 'scope';
9393
const PARAMS__SEARCH_TYPE = 'search_type';
9494
const PARAMS__TEXT = 'text';
95+
const PARAMS__TOPIC_TAG = 'topic_tag';
9596
const PARAMS__USERNAME = 'username';
9697

9798
// Read variables from environment
@@ -433,6 +434,7 @@ app.post('/upload', upload.array(), async (req, res) => {
433434
attachmentAltText,
434435
replyControl,
435436
replyToId,
437+
topicTag,
436438
linkAttachment,
437439
autoPublishText,
438440
pollOptionA,
@@ -449,6 +451,15 @@ app.post('/upload', upload.array(), async (req, res) => {
449451
[PARAMS__LINK_ATTACHMENT]: linkAttachment,
450452
};
451453

454+
if (
455+
topicTag.length >= 1 &&
456+
topicTag.length <= 50 &&
457+
!topicTag.includes('.') &&
458+
!topicTag.includes('&')
459+
) {
460+
params[PARAMS__TOPIC_TAG] = topicTag;
461+
}
462+
452463
if (pollOptionA && pollOptionB) {
453464
const pollAttachment = JSON.stringify({
454465
option_a: pollOptionA,

views/upload.pug

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ block content
4242
#reply-control {
4343
margin-bottom: 15px;
4444
}
45+
#topic-tag {
46+
width: 200px;
47+
margin-bottom: 15px;
48+
}
4549
#link-attachment {
4650
width: 200px;
4751
margin-bottom: 15px;
@@ -73,6 +77,10 @@ block content
7377
option(value="parent_post_author_only") Parent Post Author Only
7478
option(value="followers_only") Followers Only
7579

80+
label(for='topicTag')
81+
| Topic Tag
82+
input#topic-tag(type='text' name='topicTag' value='' maxlength='50')
83+
7684
label(for='linkAttachment')
7785
| Link Attachment
7886
input#link-attachment(type='text' name='linkAttachment' value='')

0 commit comments

Comments
 (0)