#!/usr/bin/perl

use Net::Twitter;
use Try::Tiny;
use Data::Dumper;


$twitter = Net::Twitter->new(
  access_token_secret => "xxx",
  consumer_secret     => "xxx",
  access_token        => "xxx-xxx",
  consumer_key        => "xxx",
		traits   => [qw/API::RESTv1_1/],
		ssl=>1
); 


try
{
	$text = "this is a test\n";
	$pic = "test.jpg";
	
	if ($pic ne "") {
		$image= ["/Research/Bot/images/$pic"];
		print "$text $image\n";
		$twitter->update_with_media($text, $image);
	} else {
		print "$text\n";
		$twitter->update($text);
	}
}

catch{
	warn Dumper $_;
	$cronn = Dumper $_;
	continue;
};

