12345678910111213141516171819202122232425262728293031323334353637 |
- #!/usr/bin/perl
- #
- use File::Find::Rule;
- use Net::Twitter;
- use Try::Tiny;
- my $nt = Net::Twitter->new(
- traits => [qw/API::RESTv1_1/],
- consumer_key => "",
- consumer_secret => "",
- access_token => "",
- access_token_secret => "",
- );
- # Get files from "lain" folder
- my @files = File::Find::Rule->in("lain");
- my $size = @files;
- my $x;
- # Worst code you have seen probably, but nobody is going to read this, so i don't really care.
- while(1) {
- UPLOAD:
- $x = int(rand($size));
- my $Filename = '"'.$files[$x].'"';
- system("cp -v $Filename file");
- try {
- $nt->update_with_media({status=>"", media=>["file"]});
- }
- catch {
- goto UPLOAD;
- };
- sleep 1800;
- }
|