Advertisement
Guest User

Untitled

a guest
Mar 9th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var rp = require('request-promise');
  2. var cheerio = require('cheerio');
  3. var sleep = require('system-sleep');
  4. var link;
  5.  
  6. function getLobby() {
  7.     console.log('Trying get a link.');
  8.     rp('http://steamcommunity.com/id/steam_id').then(function(html) {
  9.         var $ = cheerio.load(html);
  10.         link = $('.btn_green_white_innerfade.btn_small_thin').attr('href');
  11.         postLobby(link);
  12.     });
  13.    
  14. }
  15.  
  16. function postLobby(link) {
  17.     var options = {
  18.         method: 'POST',
  19.         uri: 'https://localhost/add',
  20.         form: {
  21.             lobby_link: link    ,
  22.             max_rank: 'DMG',
  23.             afk: '1',
  24.             win_rounds: '3'
  25.         },
  26.         headers: {
  27.             'Cookie': 'Много печенья'
  28.         }
  29.     }
  30.     rp(options);
  31. }
  32.  
  33. setInterval(getLobby, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement