mirror of
https://github.com/oceanprotocol/webtasks
synced 2025-01-06 20:05:40 +01:00
parent
4a9355bed3
commit
2c5bd901a8
@ -15,7 +15,7 @@
|
||||
"webtask-tools": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^6.0.0",
|
||||
"eslint-config-oceanprotocol": "^1.3.0"
|
||||
"eslint": "^6.2.0",
|
||||
"eslint-config-oceanprotocol": "^1.4.0"
|
||||
}
|
||||
}
|
||||
|
@ -33,20 +33,20 @@ server.post('/newsletter/:email', (req, res) => {
|
||||
|
||||
const baseOptions = {
|
||||
url: `${baseUrl}/lists/${listId}/members/${subscriberHash}`,
|
||||
'auth': {
|
||||
'user': 'oceanprotocol',
|
||||
'pass': MAILCHIMP_API_KEY
|
||||
auth: {
|
||||
user: 'oceanprotocol',
|
||||
pass: MAILCHIMP_API_KEY
|
||||
}
|
||||
}
|
||||
|
||||
const optionsCreate = {
|
||||
...baseOptions,
|
||||
json: {
|
||||
'email_address': emailDecoded,
|
||||
'status': 'pending', // double opt-in
|
||||
'merge_fields': {
|
||||
email_address: emailDecoded,
|
||||
status: 'pending', // double opt-in
|
||||
merge_fields: {
|
||||
// our GDPR fallback
|
||||
'GDPR': 'yes'
|
||||
GDPR: 'yes'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -55,10 +55,10 @@ server.post('/newsletter/:email', (req, res) => {
|
||||
{
|
||||
...baseOptions,
|
||||
json: {
|
||||
'marketing_permissions': [{
|
||||
'marketing_permission_id': marketingPermissionId,
|
||||
'text': 'Email',
|
||||
'enabled': true
|
||||
marketing_permissions: [{
|
||||
marketing_permission_id: marketingPermissionId,
|
||||
text: 'Email',
|
||||
enabled: true
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ app.get('/', (req, res) => {
|
||||
app.get('/channel/:channelId', (req, res) => {
|
||||
const options = {
|
||||
url: `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${req.params.channelId}&maxResults=10&order=date&type=video&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
|
||||
headers: { 'referer': req.headers.host }
|
||||
headers: { referer: req.headers.host }
|
||||
}
|
||||
|
||||
const parsedPosts = []
|
||||
@ -54,7 +54,7 @@ app.get('/channel/:channelId', (req, res) => {
|
||||
app.get('/channel/:channelId/raw', (req, res) => {
|
||||
const options = {
|
||||
url: `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${req.params.channelId}&maxResults=10&order=date&type=video&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
|
||||
headers: { 'referer': req.headers.host }
|
||||
headers: { referer: req.headers.host }
|
||||
}
|
||||
|
||||
makeRequest(options, (videos) => {
|
||||
@ -65,7 +65,7 @@ app.get('/channel/:channelId/raw', (req, res) => {
|
||||
app.get('/playlist/:playlistId', (req, res) => {
|
||||
const options = {
|
||||
url: `https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=10&playlistId=${req.params.playlistId}&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
|
||||
headers: { 'referer': req.headers.host }
|
||||
headers: { referer: req.headers.host }
|
||||
}
|
||||
|
||||
const parsedPosts = []
|
||||
@ -89,7 +89,7 @@ app.get('/playlist/:playlistId', (req, res) => {
|
||||
app.get('/playlist/:playlistId/raw', (req, res) => {
|
||||
const options = {
|
||||
url: `https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=10&playlistId=${req.params.playlistId}&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
|
||||
headers: { 'referer': req.headers.host }
|
||||
headers: { referer: req.headers.host }
|
||||
}
|
||||
|
||||
makeRequest(options, (videos) => {
|
||||
|
@ -78,7 +78,7 @@ server.get('/crm/:data', (req, res) => {
|
||||
|
||||
const options = {
|
||||
url: `${apiUrlZohoCRM}Leads`,
|
||||
headers: { 'Authorization': `Zoho-oauthtoken ${ZOHO_CRM_TOKEN}` },
|
||||
headers: { Authorization: `Zoho-oauthtoken ${ZOHO_CRM_TOKEN}` },
|
||||
method: 'POST',
|
||||
formData: data
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user