PDA

Visualizza la versione completa : Catturare schermata e postarla immediatamente!


mschievano
14-12-2005, 23:42
look!

PS: non mio



#!/usr/bin/perl -w
use Net::FTP; #start ftp


#This script puts screenshots directly on a website rather than saving them
#locally. It comes from Desktop Hacks, By Nicholas Petreley, Jono Bacon
#First Edition March 2005, ISBN: 0-596-00911-9 Copyright (c) 2005
# O'Reilly Media, Inc.

#$delay = "5"; #program loop delay in seconds
$delay_snap = "3"; #screen capture delay in seconds
$quality = "75"; #scale of 1-100
$thumb = "25"; #thumbnail size as percentage
$server = "user.com";
$username = "user";
$password = "password";
$serverfolder = "/usr/www/users/yourdir/screenies";
$localfolder = "/home/user/Desktop/screenies";

while()
{
system("scrot $localfolder/currentscreen.jpg -d $delay_snap --thumb
$thumb --quality $quality"); #takes the screenshot
$ftp = Net::FTP->new($server, Debug => 0); #connect
$ftp->login($username, $password); #log in
$ftp->binary(); #change to binary transfer mode
$ftp->cwd($serverfolder); #change to desired server directory
$ftp->delete("$serverfolder/currentscreen.jpg"); #delete any old
screenshot
$ftp->delete("$serverfolder/currentscreen-thumb.jpg"); #delete any old
screenshot thumbnail
print "Deleted old screenshot and thumbnail imagesn";
$ftp->put("$localfolder/currentscreen.jpg"); #uploading image
$ftp->put("$localfolder/currentscreen-thumb.jpg"); #uploading thumbnail
print "Completing uploadn";
$ftp->quit; #close ftp session
print "Done. Quitting. Later, dude.n";
exit;
}


salvatelo ad esempio come

screenshot.pl

quindi i permessi:

chmod +x screenshot.pl

quindi eseguitelo:

./screenshot.pl

:oVVoVe:

PS: ovviamente modificate le variabili col sito dove postare l'immagine il nome utente e la password! :sonno:

Ps2:
sono necessari scrot e perl (oltre all'estensione perl net::ftp)

mschievano
15-12-2005, 23:51
nel caso qualcuno lo avesse perso...
primo e ultimo UP!

Loading