Facebook
From Hung, 1 Week ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 119
  1. function getMoAktMail() {
  2.  return new Promise(async (resolve, reject) => {
  3.   try {
  4.  
  5.    const res = await fetch("https://moakt.com/vi/inbox", {
  6.     "headers": {
  7.      "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
  8.      "content-type": "application/x-www-form-urlencoded",
  9.     },
  10.     "redirect": "manual",
  11.     "body": "domain=teml.net&username;=&random=Nhận+một+email+ngẫu+nhiên&preferred_domain=tmpbox.net",
  12.     "method": "POST"
  13.    })
  14.  
  15.    const cookie = getCookies(res)
  16.  
  17.    const res2 = await fetch("https://moakt.com/vi/inbox", {
  18.     "headers": {
  19.      "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
  20.      "cookie": cookie,
  21.     },
  22.     "body": null,
  23.     "method": "GET"
  24.    })
  25.  
  26.    const $ = cheerio.load(await res2.text())
  27.  
  28.    const address = $('#email-address').text()
  29.  
  30.    resolve({address, cookie})
  31.  
  32.   } catch (err) {
  33.  
  34.             console.log(err)
  35.  
  36.    reject()
  37.   }
  38.  })
  39. }
  40.  
  41. function getMoAktMailInbox(emailData) {
  42.  return new Promise(async (resolve, reject) => {
  43.   try {
  44.  
  45.    let link = ''
  46.  
  47.    for (let index = 0; index < 30; index++) {
  48.  
  49.                 try {
  50.  
  51.                     let res = await fetch("https://moakt.com/vi/inbox", {
  52.                         "headers": {
  53.                             "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
  54.                             "cookie": emailData.cookie,
  55.                         },
  56.                         "body": null,
  57.                         "method": "GET"
  58.                     })
  59.  
  60.                     let $ = cheerio.load(await res.text())
  61.  
  62.                     const emails = []
  63.  
  64.                     $('td:not(#email-control):not(#email-sender) > a:not(.is_read)').each(function() {
  65.                         const url = $(this).attr('href')
  66.  
  67.                         emails.push('https://moakt.com'+url+'/content')
  68.                        
  69.                     })
  70.                        
  71.                     const email = emails[0]
  72.  
  73.                     res = await fetch(email, {
  74.                         "headers": {
  75.                             "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
  76.                             "cookie": emailData.cookie,
  77.                         },
  78.                         "body": null,
  79.                         "method": "GET"
  80.                     })
  81.  
  82.                     $ = cheerio.load(await res.text())
  83.  
  84.                     link = $('a[href^="https://fb.me/"]').attr('href')
  85.  
  86.                     if (link) {
  87.  
  88.                         break
  89.  
  90.                     }
  91.  
  92.                 } catch {
  93.                     await delayTimeout(3000)
  94.                 }
  95.  
  96.    }
  97.  
  98.    if (link) {
  99.     resolve(link)
  100.    } else {
  101.     reject()
  102.    }
  103.  
  104.   } catch (err) {
  105.    console.log(err)
  106.    reject()
  107.   }
  108.  })
  109. }