Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Twitter::API::Util(3) User Contributed Perl DocumentationTwitter::API::Util(3)

NAME
       Twitter::API::Util - Utilities for working with the Twitter API

VERSION
       version 1.0005

SYNOPSIS
	   use Twitter::API::Util ':all';

	   # Given a timestamp in Twitter's text format:
	   my $ts = $status->{created_at}; # "Wed Jun 06 20:07:10 +0000	2012"

	   # Convert it	UNIX epoch seconds (a Perl "time" value):
	   my $time = timestamp_to_time($status->{created_at});

	   # Or	a Perl localtime:
	   my $utc = timestamp_to_timepiece($status->{created_at});

	   # Or	a Perl gmtime:
	   my $utc = timestamp_to_gmtime($status->{created_at});

	   # Check to see if an	exception is a Twitter::API::Error
	   if (	is_twitter_api_error($@) ) {
	       warn "Twitter API error:	" . $@->twitter_error_text;
	   }

DESCRIPTION
       Exports helpful utility functions.

METHODS
   timestamp_to_gmtime
       Returns "gmtime"	from a Twitter timestamp string. See "gmtime-EXPR" in
       perlfunc	for details.

   timestamp_to_localtime
       Returns "localtime" for a Twitter timestamp string. See "localtime-
       EXPR" in	perlfunc for details.

   timestamp_to_time
       Returns a UNIX epoch time for a Twitter timestamp string. See "time" in
       perlfunc	for details.

   is_twitter_api_error
       Returns true if the scalar passed to it is a Twitter::API::Error.
       Otherwise, it returns false.

AUTHOR
       Marc Mims <marc@questright.com>

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2015-2018	by Marc	Mims.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.32.1			  2018-10-02		 Twitter::API::Util(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | METHODS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Twitter::API::Util&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help