#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common qw(GET);
use HTTP::Cookies;
use WWW::Mechanize::Firefox;

my $mech = WWW::Mechanize::Firefox->new( agent => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1' );
$mech->autoclose_tab( 0 );

# https://www.facebook.com/


#MozRepl -> Firefox > F10

my $count = 0;
#while(1){
#	print "$count call \n";
#	my $r = int(rand(4000));
#	&main2($r);
#	$count++;
#}

&main2();
sub main2(){
	my $t = shift;
	$mech->get( 'https://www.facebook.com/');
	
	 open(W,"+>>./facebook_log.txt");
		binmode(W);
		print W $mech->content(raw => 1);
		print W "\n\n\n###############\n\n";
	close W;
		print "Success: " .$mech->success() . "\n";
		print "Status: " .$mech->status() . "\n";
		
}

exit 0;
