View Full Version : Cool new feature of zoklet.net
I just finished writing it.
http://zoklet.net/otg
OTG stands for "On The Go" - a photo gallery of photos taken from my phone while I'm out and about (or at home being bored). The cool thing about it is that I don't have to do anything but take the photo and email it to myself (all from my phone). My server will automatically (every 5 minutes) check a gmail inbox that I set up for this, look for any new emails from my phone, open them and save the photo attachments in an online database (the link above).
Pretty cool, eh?
use Mail::POP3Client;
use IO::Socket::SSL;
use Email::MIME::Attachment::Stripper;
use DBI;
use strict;
# GMAIL INFO:
my $username = 'edited'; # edit this
my $password = 'edited'; # edit this
my $mailhost = 'pop.gmail.com';
my $port = '995';
my $pop = new Mail::POP3Client( USER => $username,
PASSWORD => $password,
HOST => $mailhost,
PORT => $port,
USESSL => 'true',
DEBUG => 0,
);
if (($pop->Count()) < 1) {
print "No mail\n";
exit;
}
# SQL INFO:
my $database = "edited";
$port = "3306"; # overwrite
$password = "edited"; # overwrite
$username = "edited"; # overwrite
my $dsn = "DBI:mysql:database=$database;host=localhost;port=$ port";
my $dbh = DBI->connect($dsn,$username,$password);
for(my $i = 1; $i <= $pop->Count(); $i++) {
my $message = $pop->HeadAndBody($i);
my $stripper = Email::MIME::Attachment::Stripper->new($message);
my $msg = $stripper->message;
my @attachments = $stripper->attachments;
my $filename = $attachments[0]{ 'filename' };
my $out = "/home/zoklet.net/public_html/otg/pics/" . $filename;
open OUT, ">$out" or die "cannot open the file yo: $!";
print OUT $attachments[0]{ 'payload' };
close OUT;
system("convert /home/zoklet.net/public_html/otg/pics/$filename -resize 640x480 /home/zoklet.net/public_html/otg/pics/thumb_$filename");
my $time = time();
my $q = "INSERT INTO `otg` (`date`,`filename`) VALUES ('$time','$filename')";
my $sth = $dbh->prepare($q);
$sth->execute();
}
$pop->Close();
exit;
AtrainV
12-15-2007, 12:22 AM
Haha, I forgot about your silly keyboard.
The hard part will be remembering to take pictures of everything I see.
If I get a cameraphone, we'll have to figure out if there's some way to set this up for myself. I see lots of crazy things throughout the day, and I'm sure at least some of it would interest you all, like the barbershop called the "Hair Cook Pit"
As long as the phone can send the picture as an attachment to an email it's really easy.
a giant pterodactyl
01-20-2009, 02:14 AM
I just finished writing it.
http://zoklet.net/otg
OTG stands for "On The Go" - a photo gallery of photos taken from my phone while I'm out and about (or at home being bored). The cool thing about it is that I don't have to do anything but take the photo and email it to myself (all from my phone). My server will automatically (every 5 minutes) check a gmail inbox that I set up for this, look for any new emails from my phone, open them and save the photo attachments in an online database (the link above).
Pretty cool, eh?
this might be the most awesome thing i have ever seen.
you have given us the code. awesome. how do set up a gmail account to get the pictures? i am newb at this.
mr.blunt
01-20-2009, 02:15 AM
that is pretty damn awesome.
LSA King
01-20-2009, 02:15 AM
So we can all see what Zok is doing when he is away from the forums :)
Haiti's Space Agency
01-20-2009, 02:15 AM
cool. I get a 404 though.
Midnight Sun
01-20-2009, 02:16 AM
Know what's a not-so-cool feature? META BEING SUPERMOD. :mad::mad::mad::mad::mad:
LSA King
01-20-2009, 02:17 AM
cool. I get a 404 though.
Then you went to the right place lol
LumpySnake
01-20-2009, 02:20 AM
neato.
Knife in The Knight
01-20-2009, 02:21 AM
So we can all see what Zok is doing when he is away from the forums :)
I would prefer to stay in wonder that whenever he disappears from the forum that he is out fighting dragons whilst fornicating with multiple women
LumpySnake
01-20-2009, 02:21 AM
I would prefer to stay in wonder that whenever he disappears from the forum that he is out fighting dragons whilst fornicating with multiple women
Is this a fetish of yours?
fux0rz
01-20-2009, 02:22 AM
A self fapping code would be a nice addition
The Backdoor Man
01-20-2009, 02:33 AM
Crazyness. So it's just you that can use it?
Haiti's Space Agency
01-27-2009, 02:50 AM
When is this going up?
-*.inc
01-27-2009, 02:53 AM
When is this going up?
not yet apparently.
in the meantime, :fap:
PirateJoe
01-27-2009, 02:53 AM
You should rig it so the photos are automatically downloaded and published once you are in bluetooth range of your computer.
THIS IS IMPORTANT GODDAMNIT
01-27-2009, 02:56 AM
You're a far more worthy leader than that last bloke..whoever that was..
Rocky
01-27-2009, 02:57 AM
Hmm, any way you could.. like.. get photos from members as well? Would be awesome to click some ones profile, or go to that link, and see photos that every one takes during the day. Think of the scandles.
Jordan
01-27-2009, 02:57 AM
You. Are. God.
zuperxtreme
01-27-2009, 03:03 AM
lol@2 year old thread. :p
Method of Madness
01-27-2009, 03:08 AM
Lets hope you don't fuck up and take a picture of a street sign or something I can use to find you
driveby
01-27-2009, 03:22 AM
The correct, in fact, term, infact, is, in fact, "Zokse". In fact.
WTFuk
01-27-2009, 03:27 AM
/thread?
Jordan
01-27-2009, 03:31 AM
/new thread
Carbonbased
01-27-2009, 03:50 AM
*bows to the good and Just Zok*
Edit: Hay your name dosent come out as Penis any more!
Lysergic Rain
01-27-2009, 04:07 AM
Sorry, the page you were looking for was not found.
UK Managed Hosting
vBulletin® v3.8.1, Copyright ©2000-2013, Jelsoft Enterprises Ltd.