[PITC] - Screenshots - Addon Script

By TMFKSOFT on Jan 05, 2013

PITC Has teamed with Printscreen.it to produce a simple Screenshot uploading service for PITC!

Load this script AFTER loading my previous screenshot script then use /ss and /paste to paste the url in the channel!


Requires PITC v1.0+

Download PITC Now! http://pitc.x10.mx/

What is PITC?
PITC is a Unique IRC Client entirely written in PHP and adapted to be able to host PHP IRC Bots with its easy to use API!


if (function_exists("do_screenshot")) {
    $api->log(" = PrintScreen.it Addon Loaded =",0);
    // Adds Clipboard! :D
    $clipboard = "";
else {
    $api->log(" = Screenshot script by Thomas Edwards has not been loaded! =");
function clip_set($data) {
    global $clipboard;
    $clipboard = $data;
    return true;
function clip_get() {
    global $clipboard;
    return $clipboard;
function clip_paste($args) {
    global $api;
function ssu_do($fname) {
    global $api,$_DEBUG;
    $img = "screenshots/".$fname;
    $base = base64_encode(file_get_contents($img));

    $data_in = base64_encode(json_encode(array("user"=>"tom_username","pass"=>"tom_pass","image"=>$base)));

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL, "http://pitc.printscreen.it/api.php");
    curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch,CURLOPT_POST, "1");
    curl_setopt($ch,CURLOPT_POSTFIELDS, "data={$data_in}");
    $raw = curl_exec($ch);

    $data = json_decode(base64_decode($raw));

    $_DEBUG['ss_dat'] = $data;
    $_DEBUG['ss_raw'] = $raw;

    $message = $data->msg;
    if ($data->ret == "0") {
        $api->pecho(" = SSA: Error uploading image. =");
    else {
        $api->pecho(" = SSA: Uploaded image, Url: ".$data->msg." =");
        $api->pecho(" = Added to ClipBoard! Use /paste to paste to the current channel. =");



Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.