Using TwitterOAuth to authenticate our extension
The TwitterOAuth (https://twitteroauth.com/) library provides communication with Twitter via an API. In the TweetsAbout project, this kind of communication is essential for the final proposal of our extension solution. TwitterOAuth is the most popular PHP library to use with the TwitterOAuth REST API.
This project is also available on GitHub (https://github.com/abraham/twitteroauth), as shown in the following screenshot:
To install TwitterOAuth on the TweetsAbout extension, follow this recipe:
Open the terminal or command prompt.
Under the
packt/app/code/Packt/TweetsAbout/Api
directory, run thecomposer require abraham/twitteroauth
command.Access https://apps.twitter.com/, click on your application, and click on the Keys and Access Tokens tab to get the following:
Consumer Key (API Key)
Consumer Secret (API Secret)
Access Token
Access Token Secret
We'll need these credentials to use on our extension later.