simona6 Posted February 27, 2020 Share Posted February 27, 2020 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. Quote Link to comment https://forums.phpfreaks.com/topic/310145-how-do-i-use-twitter-apis-to-extract-followers-for-a-given-handle/ Share on other sites More sharing options...
gizmola Posted February 27, 2020 Share Posted February 27, 2020 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. Quote Link to comment https://forums.phpfreaks.com/topic/310145-how-do-i-use-twitter-apis-to-extract-followers-for-a-given-handle/#findComment-1574966 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.