This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function is the webhook's request handler. | |
exports = function(payload, response) { | |
const body = EJSON.parse(payload.body.text()); | |
const result = context.services.get("mongodb-atlas").db("cuties").collection("pets").insertOne(body); | |
return result; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = function(payload, response) { | |
const body = EJSON.parse(payload.body.text()); | |
console.log(body.another) | |
return body; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = function(payload, response) { | |
const pets = context.services.get("mongodb-atlas").db("cuties").collection("pets").find(); | |
return pets | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Alice", | |
"imageUrl": "https://upload.wikimedia.org/wikipedia/commons/b/b1/VAN_CAT.png", | |
"pet": "cat", | |
"likes": 15 | |
}, | |
{ | |
"name": "Angel", | |
"imageUrl": "https://cdnuploads.aa.com.tr/uploads/Contents/2019/10/24/thumbs_b_c_fb8263ce4f9f43ebdc7634b0d1eb0a08.jpg?v=115427", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cheerio = require('cheerio') | |
const axios = require('axios') | |
async function searchSong(id, artistname, song) { | |
artistname = artistname.replace(/ /g, '+') | |
song = song.replace(/ /g, '+') | |
const response = await axios.get(`https://www.lyrics.com/lyric/${id}/${artistname}/${song}`) //sayfa kaynak kodunu alıyoruz | |
const $ = cheerio.load(response.data) // ve kaynak kodunu cheerioya yüklüyoruz | |
const lyrcis = $('.lyric-body').text(); //az önce tarayıcı konsolunda cevabını aldığımız .lyric-body sınıfını uygulamamızdan aratıyoruz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function searchSong() { | |
const response = await axios.get('https://www.lyrics.com/lyric/35855205/Alan+Walker/Lost+Control') //sayfa kaynak kodunu alıyoruz | |
const $ = cheerio.load(response.data) // ve kaynak kodunu cheerioya yüklüyoruz | |
const lyrcis = $('.lyric-body').text(); | |
//az önce tarayıcı konsolunda cevabını aldığımız .lyric-body sınıfını uygulamamızdan aratıyoruz | |
const songName = $('#lyric-title-text').text() | |
const artist = $('.lyric-artist a:not(:last-child)').text() | |
return { | |
lyrcis, songName, artist | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cheerio = require('cheerio') | |
const axios = require('axios') | |
async function searchSong() { | |
const response = await axios.get( | |
'https://www.lyrics.com/lyric/35855205/Alan+Walker/Lost+Control') //sayfa kaynak kodunu alıyoruz | |
const $ = cheerio.load(response.data) | |
// ve kaynak kodunu cheerioya yüklüyoruz | |
console.log($('.lyric-body').html()); | |
//az önce tarayıcı konsolunda cevabını aldığımız .lyric-body sınıfını uygulamamızdan aratıyoruz | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "ADANA", | |
"id": 1, | |
"coordinates": { | |
"lat": 37.003348, | |
"longitude": 35.326325 | |
} | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="intihar.pdf">file</a> | |
<a href="intihar-et.pdf">file</a><a href="bilekler.jpg">file</a> | |
öl | |
<p title='en-us'>en us</p> | |
<p title='tr-tr'>tr tr</p> | |
<input id='suicide' class='suicide' type='checkbox' /> | |
<label for='suicide'>intihar etmek istiyorum</label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
correct( | |
[ | |
{ | |
value: name, | |
fieldName: 'name', | |
validations: [ | |
{ | |
'type': 'required', | |
}, | |
{ |