Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hborras\twitter-php-ads-sdk\src\TwitterAds.php - Maximum execution time of 300 seconds exceeded #84

Open
ponnnarasi14 opened this issue Jan 8, 2021 · 3 comments

Comments

@ponnnarasi14
Copy link

while schedule / uploading video on twitter using twitter php ads sdk its showing following error maximum execution time exceeded. below i have attached my code plz check it and give a solution.

`require_once dirname(FILE) . '/../../../vendor/autoload.php';

// Create twitter ads client
$api = TwitterAds::init(self::CONSUMER_KEY, self::CONSUMER_SECRET, self::ACCESS_TOKEN, self::ACCESS_TOKEN_SECRET);

$account = (new Account (self::ACCOUNT_ID))->read();

$media1 = $api->upload(['media' => public_path('/images/rain.mp4'), 'media_type' => 'video/mp4'], true);
$media_keys = implode(',', [$media1->media_key,]);

$scheduledTweet = new ScheduledTweet();

$scheduledTweet->setText("this is my tweet on twitter with text and video.");
$scheduledTweet->setAsUserId(self::USER_ID);
$scheduledTweet->setNullcast(true);
$scheduledTweet->setScheduledAt('2021-01-08T17:00:00Z');
$scheduledTweet->setMediaKeys($media_keys);

$scheduledTweet->save();`

@hborras
Copy link
Owner

hborras commented Jan 11, 2021

Hello

Thanks for your post. I'll check it when possible.

@ponnnarasi14
Copy link
Author

hi hborras,

Any updates?

@hborras
Copy link
Owner

hborras commented Feb 7, 2021

Working on my side.

image

Is it a very large video?

If you want to extend the 30s timeout you will need to extend the TwitterAds class and change the property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants