Advertisement
Guest User

Untitled

a guest
Mar 9th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  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. while(link == null || link == 'steam://') {
  8. console.log('Trying get a link.');
  9. rp('http://steamcommunity.com/id/РАНДОМНЫЙ_ID').then(function steam(html) {
  10. var $ = cheerio.load(html);
  11. link = $('.btn_green_white_innerfade.btn_small_thin').attr('href');
  12. module.exports.link = link;
  13. });
  14. sleep(5000);
  15. }
  16. return link;
  17.  
  18. }
  19.  
  20. function postLobby() {
  21. var options = {
  22. method: 'POST',
  23. uri: 'https://localhost/add',
  24. form: {
  25. lobby_link: getLobby(),
  26. max_rank: 'DMG',
  27. afk: '1',
  28. win_rounds: '3'
  29. },
  30. headers: {
  31. 'Cookie': 'Много печенья'
  32. }
  33. }
  34. rp(options);
  35. }
  36.  
  37. var i = 0;
  38. while(true) {
  39. postLobby();
  40. sleep(1000);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement