This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Application-only authentication | |
* | |
* Application-only authentication is a form of authentication where an | |
* application makes API requests on its own behalf, without the user context. | |
* This method is for developers that just need to access public information. | |
* | |
* developer.twitter.com/en/docs/basics/authentication/overview/application-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Authenticate API requests with the bearer token | |
* | |
* The bearer token may be used to issue requests to API endpoints which | |
* support application-only auth. To use the bearer token, construct a normal | |
* HTTPS request and include an Authorization header with the value of | |
* Bearer <base64 bearer token value>. Signing is not required. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Seperate single tweets into an individual collection. | |
* Combine threaded Tweets / Tweet replies into combined collection. | |
*/ | |
function get_tweets($data) | |
{ | |
if ($data === false) { | |
return 'Cannot view tweets'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Seperate single tweets into an individual collection, combine threaded | |
* Tweets / Tweet replies into combined collection. | |
* | |
* Application-only authentication Tweets from a designated user timeline. | |
* Twitter offers applications the ability to issue authenticated requests on | |
* behalf of the application itself (as opposed to on behalf of a specific user). | |
* Twitter’s implementation is based on the Client Credentials Grant flow of | |
* the OAuth 2 specification. Note that OAuth 1.0a is still required to issue |