Join all groups on a profile

Join all of someone's steam groups

当前为 2015-10-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Join all groups on a profile
  3. // @namespace http://teamgamerfood.com
  4. // @version 0.1.3
  5. // @description Join all of someone's steam groups
  6. // @author A5
  7. // @match *://steamcommunity.com/id/*
  8. // @match *://steamcommunity.com/profiles/*
  9. // @require http://code.jquery.com/jquery-2.1.4.min.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. /**********************************************************************************************************/
  14. /* * * * * * * * * * * * * * * * * * * * * Leave the rest below alone * * * * * * * * * * * * * * * * * * */
  15. /**********************************************************************************************************/
  16.  
  17. function JoinProfilesGroups()
  18. {
  19. return $.ajax({
  20. url: 'http://steamcommunity.com/profiles/' + g_rgProfileData.steamid + '/?xml=1',
  21. data: { xml:1 },
  22. type: 'GET',
  23. dataType: 'xml'
  24. }).done(function(xml) {
  25. $(xml).find('groupID64').each(function(){
  26. var params = {
  27. action: 'join',
  28. sessionID: g_sessionID,
  29. };
  30.  
  31. $.ajax({
  32. url: 'http://steamcommunity.com/gid/' + $(this).text(),
  33. data: params,
  34. type: 'POST',
  35. dataType: 'json'
  36. }).done(function(data) {
  37. console.log('Joined Group.');
  38. }).fail(function() {
  39. console.log('Error processing your request. Please try again.');
  40. });
  41. });
  42. }).fail(function() {
  43. console.log('The request failed or the group custom URL is wrong.');
  44. });
  45. }
  46.  
  47. // Start invite process
  48. JoinProfilesGroups();