574 views
Make calls to the twitter API in PHP (extremely easy)
The Twitter API is extremely simple. This function shows you how to communicate with the twitter API:
PHP
- /**
- * Executes an API call
- * @param string $twitter_method The Twitter method to call
- * @param string $http_method The HTTP method to use
- * @param string $format Return format
- * @param array $options Options to pass to the Twitter method
- * @param boolean $require_credentials Whether or not credentials are required
- * @return string
- */
- function apiCall($twitter_method, $http_method, $format, $options, $require_credentials = true)
- {
- $credentials = "username:password"; // Replace for your own credentials
- {
- }
- if ($require_credentials)
- {
- }
- if ($http_method == 'post')
- {
- }
- return $twitter_data;
- }
Some examples:
PHP
- // Gets the 20 most recent statuses
- // Update the twitter status
To learn more about all the methods provided by the api of twitter: Twitter API Documentation
Submitted by miguelSantirso about 1 year ago — last modified less than a minute ago