Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Do I need to call "new TwitterAPIExchange($settings)" before every API request ? #248

Closed
@Cedric-IEF2I

Description

@Cedric-IEF2I

Hello, I am sorry if it's a stupid question, but do I need to call "new TwitterAPIExchange($settings)" before every API request ?

ie :
Do I have to do :
$API = new TwitterAPIExchange($settings);
$result1 = json_decode( $API->setGetfield( "?user_id=1015908282&tweet_mode=extended&exclude_replies=true&include_rts=1&count=200" )
->buildOauth( "https://api.twitter.com/1.1/statuses/user_timeline.json", "GET" )
->performRequest(), true );

$API = new TwitterAPIExchange($settings);
$result2 = json_decode( $API->setGetfield( "?slug=list&$setGetfield" )
->buildOauth( "https://api.twitter.com/1.1/lists/statuses.json", "GET" )
->performRequest(), true );


Or can I do :
$API = new TwitterAPIExchange($settings);

$result1 = json_decode( $API->setGetfield( "?user_id=1015908282&tweet_mode=extended&exclude_replies=true&include_rts=1&count=200" )
->buildOauth( "https://api.twitter.com/1.1/statuses/user_timeline.json", "GET" )
->performRequest(), true );

$result2 = json_decode( $API->setGetfield( "?slug=list&$setGetfield" )
->buildOauth( "https://api.twitter.com/1.1/lists/statuses.json", "GET" )
->performRequest(), true );


Thanks for your help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions