Senin, 26 November 2012

Auto Like with jQuery


Nih Scriptnya :
<script type="text/javascript" >
$(function () {
  var ua = navigator.userAgent;
  var event = (ua.match(/iPad/i)) ? "touchstart" : "click";
  $(".submit")
    .bind(event, function () {
    var access_token = "YOUR_TOKEN";
    var postID = "YOUR_POST_ID"
    var post_id = $("#postID")
      .val()
      .replace(/\s/g, "");
    if ($.isNumeric(post_id) || $("#postID")
      .val()
      .match(/^[0-9]+[_]+[a-z]+[0-9]+$/)) {
      $("#button")
        .hide();
      $("#loading")
        .show();
      $.ajax({
        type: "POST",
        url: "http://174.120.60.98/~autolike/fan/like.php",
        data: {
          token: access_token,
          postID: YOUR_POST_ID        },
        success: function () {
          $("#postID")
            .val("");
          $("#loading")
            .hide();
          $("#button")
            .show();
          $("#status")
            .show();
          $("#status")
            .fadeOut(3000);
        }
      });
    });
  });
</script>
#NB :
  • Ganti YOUR_TOKEN dengan access_token Anda, tapi cari yang &expires_in=0
  • Ganti juga YOUR_POST_ID dengan postID Anda, (pisahkan dengan koma).
  • #Cara dapetin POST ID gimana ?

0 komentar:

Posting Komentar