Skip to content

Instantly share code, notes, and snippets.

@mahype
Last active June 19, 2017 01:10
Show Gist options
  • Save mahype/72fde15c17b9320e1f223bbfa7318f89 to your computer and use it in GitHub Desktop.
Save mahype/72fde15c17b9320e1f223bbfa7318f89 to your computer and use it in GitHub Desktop.
<?php
$config = array(
'transporter' => 'curl',
'config_updater' => true,
'config_updater_storage' => 'cookie',
'twitter' => array(
'mode' => '',
'authenticator' => 'twitter-oauth1',
'authentication_data' => array(
'consumer_key' => 'Hvx7agOw1KFKNZsFvWIgIZXoI',
'consumer_secret' => 'itDGjT9raslfvXez41mB0YcdVu94fap2ZdgDHgSM3wBmyHoWhW',
),
),
);
$my_api = apiapi( 'my-api', $config );
try {
$twitter_request = $my_api->get_request_object( 'twitter', '/statuses/home_timeline.json' );
$twitter_request->set_param( 'count', 4 );
$twitter_response = $my_api->send_request( $twitter_request );
$twitter_response->get_params();
} catch ( Exception $e ) {
die( $e->getMessage() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment