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

Count Endpoint #365

Closed
haleyngonadi opened this issue Jun 25, 2021 · 6 comments
Closed

Count Endpoint #365

haleyngonadi opened this issue Jun 25, 2021 · 6 comments
Assignees
Labels
api-v2 Related to twitter API v2

Comments

@haleyngonadi
Copy link

Hi, this is an awesome package. Thank you very much.

Twitter just introduced a new count endpoint and I'm wondering if it can already be implemented using this package and I'm just missing the way to do it?

Here's more information: https://developer.twitter.com/en/docs/twitter-api/tweets/counts/quick-start/recent-tweet-counts

@reliq reliq self-assigned this Jun 27, 2021
@reliq
Copy link
Collaborator

reliq commented Jun 27, 2021

Hi @haleyngonadi, thank you for bringing this to our attention.

This and other newer endpoints are not yet supported but I'll work on adding support for these in the coming days.

@reliq reliq added the api-v2 Related to twitter API v2 label Jun 27, 2021
@reliq
Copy link
Collaborator

reliq commented Jun 27, 2021

Please also note that you can currently call any new endpoint by accessing the Querier service directly.

e.g. for calling count endpoint:

// ...
$querier = \Atymic\Twitter\Facade\Twitter::getQuerier();
$result = $querier
    ->withOAuth2Client()
    ->get('tweets/counts/recent', ['query' => 'foo']);

dd($result);

As per usual, please ensure API v2 is selected. If API v2 is not set as default in your config file you may use the forApiV2 method.
e.g.

// ...

$querier = \Atymic\Twitter\Facade\Twitter::forApiV2()
            ->getQuerier();
// ...

@haleyngonadi
Copy link
Author

@reliq WOW. Exactly what I was looking for. It worked perfectly. Thank you so much! :)

@reliq
Copy link
Collaborator

reliq commented Jun 27, 2021

You're welcome @haleyngonadi. Glad that solution worked for you!

@reliq reliq pinned this issue Jun 27, 2021
atymic pushed a commit that referenced this issue Jun 28, 2021
* expose new tweet count endpoints and add note/example about new endpoints

* readme typo fix
@reliq reliq closed this as completed Jun 28, 2021
@atymic
Copy link
Owner

atymic commented Jun 28, 2021

Now also a method @haleyngonadi and @reliq also documented custom queries :)

@haleyngonadi
Copy link
Author

WOOT, WOOT! Thank you, @atymic :)

I just tried it and it worked as expected! 🎉

@atymic atymic unpinned this issue Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-v2 Related to twitter API v2
Projects
None yet
Development

No branches or pull requests

3 participants