#!/usr/bin/perl

###########################
### Autor: Sebastian Enger / B.Sc. 
### Copyright: Sebastian Enger
### Licence: Commercial
### Version: 1.2  - 2013-09-28
### Contact: sebastian.enger@gmail.com
###########################

package Crawler::Twitter;

use strict;
use Net::Twitter;
use Net::Twitter::Search;
use Scalar::Util 'blessed';
 
 
# Konstruktor
sub new {
	my ($class) = @_;
	my $basic = Crawler::Basic->new();
	my $self = {
		'basic' => $basic,
	};
	bless $self, $class;
  return $self;
}


http://search.cpan.org/~mmims/Net-Twitter-4.00007/lib/Net/Twitter.pod






# https://twitter.com/search?q=perl%20programming%20language%20lang%3Ade&src=typd&f=realtime

# Just the Search API; exceptions thrown on error
$nt = Net::Twitter->new(traits => [qw/API::Search/]);
eval {
   # Parameters: q, callback, lang, rpp, page, since_id, geocode, show_user
   my $r = $nt->search({
      q=>"\"easter service\" OR \"sunrise service\"",
      lang=>"en",
      geocode=>"",
      rpp=>50,
      since=>"2013-01-01"
   });
   for my $status ( @{$r->{results}} ) {
      print "\@$status->{from_user}";
      print "\t$status->{created_at}\n";
      print "\t\t$status->{text}\n";
      print "-----------------------------------------------------\n";
   }
};
if ( my $err = $@ ) {
   die $@ unless blessed $err &amp;&amp; $err->isa('Net::Twitter::Error');
   warn "HTTP Response Code: ", $err->code, "\n",
   "HTTP Message......: ", $err->message, "\n",
   "Twitter error.....: ", $err->error, "\n";
}


