Exemplo n.º 1
0
 if ($item['sender'] != $config['username']) {
     //if not sent from yourself
     if (!is_banned($item['sender'])) {
         $snapchat->addFriend($item['sender']);
         //add sender as friend if not already
         if ($item['media_type'] == 0) {
             //if still image
             if ($config['picturesallowed']) {
                 $data = $snapchat->getMedia($item['id']);
                 //get received snap
                 if ($data != "") {
                     $filename = time() . '__' . $item['sender'] . '.jpg';
                     file_put_contents('media/temp/' . $filename, $data);
                     //create temp file with the received snap
                     if ($config['moderation'] == false) {
                         postImageStory($filename, mod_id(), $config['username'], $config['password']);
                     }
                 }
             }
         } elseif ($item['media_type'] == 1) {
             //if moving video
             if ($config['videosallowed']) {
                 $data = $snapchat->getMedia($item['id']);
                 //get received snap
                 file_put_contents('media/temp.mov', $data);
                 //create temp file with the received sna
                 $id = $snapchat->upload(Snapchat::MEDIA_VIDEO, file_get_contents('media/temp.mov'));
                 //upload the temp to story
                 $snapchat->setStory($id, Snapchat::MEDIA_VIDEO, $config['videotime']);
                 //set story
                 unlink("media/temp.mov");
Exemplo n.º 2
0
<?php

define("IN_STORYBOT", 1);
require_once "config/config.php";
if (!is_mod(mod_id())) {
    die("No access!");
}
if ($_GET['vote'] == "yes") {
    if (intval(file_get_contents("log/count")) < 149) {
        postImageStory($_GET['file'], mod_id(), $config['username'], $config['password']);
    }
    header("Location: mod.php");
} elseif ($_GET['vote'] == "no") {
    deleteImage($_GET['file'], $config['username'], $config['password']);
    header("Location: mod.php");
} else {
    die("Incorrect input value!");
}