GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Twitter::API::Util(3) User Contributed Perl Documentation Twitter::API::Util(3)

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

version 1.0006

    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;
    }

Exports helpful utility functions.

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

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

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

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

Marc Mims <marc@questright.com>

This software is copyright (c) 2015-2021 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.

2021-04-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.