Jump to content
#StayAtHome ×
simona6

How do I use Twitter APIs to extract Followers for a given handle?

Recommended Posts

Hi there.

We are now setup as 'Developers' with Tokens and API to get 'number of followers' from handles on Twitter.  Trouble is, there is no definite guide on the best way to do it.

ie.  a chunk of code, where you add your Token and API, enter the @handle, and use PHP to extract the number.

Does anyone know the best means of doing it?  I've looked at Twitter's Auth code but there are oodles of code there, and no definitive answer.

Share this post


Link to post
Share on other sites

The "Best way" requires a subjective opinion.  

Hopefully you have looked at the Twitter API documentation.

I'd suggest you take a look at this PHP component Library which wraps the authentication details in an easy to use PHP class and provides helpers to easily make calls to the twitter api and get back the result in a PHP script.  

The documentation literally has an example of getting the list of followers for a user.

There are numerous other libraries you can find by googling or searching github that go even further in wrapping the twitter api's, for example this library.  I would certainly start with a library to avoid reinventing the wheel, but you will also learn a lot about how to interact with Twitter or for that matter any REST api by looking at the code of any one or two of these libraries.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.