Skip to content

Instantly share code, notes, and snippets.

@ngdanghau
Created June 9, 2018 17:03
Show Gist options
  • Select an option

  • Save ngdanghau/ddb59ca8afa80e2bcb5ee7dfdbf6f4af to your computer and use it in GitHub Desktop.

Select an option

Save ngdanghau/ddb59ca8afa80e2bcb5ee7dfdbf6f4af to your computer and use it in GitHub Desktop.

Revisions

  1. ngdanghau created this gist Jun 9, 2018.
    9 changes: 9 additions & 0 deletions leave-group-by-list.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    var arr = ['2054378391452782'];
    var xhttp = new XMLHttpRequest();
    var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
    arr.forEach(function(gid) {
    xhttp.open("POST", "https://www.facebook.com/ajax/groups/membership/leave.php", true);
    xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhttp.send("group_id=" + gid + "&ref=group_mall&dpr=1&fb_dtsg=" + fb_dtsg + "&prevent_readd=on&confirmed=1");
    console.log(gid + " => Successfully");
    });