1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Count Your Money! Slack bot sales yapper

Discussion in 'Affiliate Programs' started by evilclown, Jan 11, 2017.

Tags:
  1. evilclown

    evilclown Senior Member

    Joined:
    Jul 31, 2012
    Messages:
    851
    Likes Received:
    595
    Occupation:
    Party Clown
    Location:
    Clownville
    Slack bot that notifies you every time you make a sale as an affiliate

    I don’t know about you, but I’am one of those people who like to check the earning from time to time. I like to know how much money my sites are making for me today, compared to yesterday. Are we beating yesterday? No? Why? Since I spend a lot of time on slack (I participate in different groups), I found a way to be notified every time I make money. So I am sharing this slack bot sales yapper with you.

    You can add this code to your affiliate tracking file and receive a notification on the selected channel. You must have authority on the slack channel.

    You can customize the message; it’s a very simple bot. Its only function is to tell you how much are you making per transaction. @egomaniac @moreepeen

    Create a new Incoming WebHook on slack. You must have a slack account and channel. Click on Make a Custom Integration on your team app build url, fill the form and add as much details as you want. Enter your team app build URL: https://teamurlgoeshere.slack.com/apps/build

    IMPORTANT! REPLACE TEAMURLGOESHERE WITH YOUR TEAM NAME.

    Once you get your Webhook URL, Add the evilbot slack code to your tracking file.

    Code:
    Code:
    <?php
    $date = date("Y-m-d H:i:s");
    $ip = $_SERVER['REMOTE_ADDR'];
    
    /*
            * EVILBOT Slack API Tracking Code
            * PLEASE DO NOT DELETE
            * PRAISE JESUS TO SAVE THE BUNNIES!
            */ 
             
           $message = 'ALERT: <<EVENT NAME>>: YOU MADE A SALE GUAPO!  '.$date.' by IP: '.$ip.' - $23.50.';
           #Change room name - No hastag
           $room = "HEYSEXXY";
          #Change Icon
           $icon = ":moneybag:";
           $data = "payload=" . json_encode(array(
               "channel"       =>  "#{$room}",
               "text"          =>  $message,
               "icon_emoji"    =>  $icon
           ));
            #    Replace <<KEY#>> with string from WebHook URL. No Ending Trailing Slash
           $url = 'https://hooks.slack.com/services/<<KEY1>>/<<KEY2>>/<<KEY3>>';
             
           $ch = curl_init();
           curl_setopt($ch, CURLOPT_URL, $url);
           curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
           curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
           curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
           curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
           $result = curl_exec($ch);
           //echo var_dump($result);
           if($result === false)
           {   
                #    uncomment if you want to see the error
               //echo 'Curl error: ' . curl_error($ch);
           }
           curl_close($ch);
         
           //END EVILBOT
    
    
    ?>
    
    
    Here is a few screen shots.

    Enjoy

    Bot #1
    evilbot_01.png

    Bot #2
    evilbot_02.png
     
    • Thanks Thanks x 1