-
Notifications
You must be signed in to change notification settings - Fork 17
/
upload_page.pug
96 lines (94 loc) · 5.4 KB
/
upload_page.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
doctype
html
head
title Instagram Reels Publishing API Sample App
link(rel='stylesheet', href='/style.css')
body
header
h1 Instagram Reels Publishing API Sample App
.canvas
- let accountsArr = accounts ?? [];
if (accountsArr.length > 0)
form(action='/uploadReels' name="uploadForm" id="uploadForm" method='POST')
b Select an Instagram Professional Account to publish reel to
div(class='radio-group')
each account, index in accountsArr
div(class='radio-child')
label(for=`account-${index}`)
input(type='radio' id=`account-${index}` name="accountId" value=account.id disabled=account.disabled)
| Account: #{account.displayName} - #{account.id}
div(class='checkbox-group')
input(type="checkbox" id="isStories" placeholder="Upload as Stories" name="isStories")
label(for="isStories") Make the request for Stories
br
input(type="text" placeholder="Enter video url" name="videoUrl")
input(type="text" placeholder="Enter caption (optional)" name="caption")
br
b Provide a cover image either from URL or Video Offset (Reels only - optional)
br
input(type="text" placeholder="Enter cover image url (optional)" name="coverUrl")
b or
input(type="text" placeholder="Enter thumbnail offset in milliseconds (optional)" name="thumbOffset")
br
br
fieldset
b Search for a location
br
br
input(type="text" placeholder="Enter Location to tag" name="locationName")
input(type='submit', name='listLocations', value='Show Locations', formaction='/listLocations', formmethod='GET', formenctype='application/x-www-form-urlencoded')
if(locations_list)
h3
- let locationsArr = locations_list ?? [];
if (locationsArr.length > 0)
h4 Select a location to tag onto the reel (optional)
table(class="table")
tr
th Select
th Location Name
th Location City
th Location Country
th Location Link
each location, index in locationsArr
if(location.location)
if(location.location.latitude && location.location.longitude)
tr
td
input(type="radio" name="locationId" value=location.id)
td #{location.name}
td #{location.location.city}
td #{location.location.country}
td #{location.link}
input(type='submit' value='Upload' onclick="this.form.submit(); this.disabled = true;")
if(uploaded)
if(accountId && containerId)
.alert
span.closebtn(onclick="this.parentElement.style.display='none';") ×
| #{message}
form(method='POST', action='/publishReels')
input(type='submit', name='publishReels', value='Publish', onclick="this.form.submit(); this.disabled = true;")
if(published)
if(message.length > 0)
each msg in message
.alert
span.closebtn(onclick="this.parentElement.style.display='none';") ×
| #{msg}
else
.alert
span.closebtn(onclick="this.parentElement.style.display='none';") ×
| #{message}
if(permalink)
a(href=permalink target="_blank") Link to Instagram Post
else if(!uploaded)
if(accountId)
.alert
span.closebtn(onclick="this.parentElement.style.display='none';") ×
| #{message}
else if(error)
.alert-error
span.closebtn(onclick="this.parentElement.style.display='none';") ×
| #{message}