{"id":18552383,"url":"https://github.com/traviswimer/twittering","last_synced_at":"2025-10-04T08:56:06.020Z","repository":{"id":17737242,"uuid":"20576311","full_name":"traviswimer/Twittering","owner":"traviswimer","description":"PHP class that makes Twitter oAuth token requests and authentication as simple as possible. (Built on the [TwitterOAuth package](https://github.com/abraham/twitteroauth))","archived":false,"fork":false,"pushed_at":"2014-06-07T03:40:37.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T11:12:38.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traviswimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-06T19:58:14.000Z","updated_at":"2014-06-07T03:40:37.000Z","dependencies_parsed_at":"2022-08-24T13:52:38.395Z","dependency_job_id":null,"html_url":"https://github.com/traviswimer/Twittering","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/traviswimer/Twittering","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2FTwittering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2FTwittering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2FTwittering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2FTwittering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traviswimer","download_url":"https://codeload.github.com/traviswimer/Twittering/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2FTwittering/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278289491,"owners_count":25962356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:14:03.730Z","updated_at":"2025-10-04T08:56:05.994Z","avatar_url":"https://github.com/traviswimer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twittering [![Build Status](https://travis-ci.org/traviswimer/Twittering.png?branch=master)](https://travis-ci.org/traviswimer/Twittering)\n\n\u003e PHP class for simple Twitter oAuth token requests, authentication, and API v1.1 requests. (Built on the [TwitterOAuth package](https://github.com/abraham/twitteroauth))\n\n## Getting Started\n\nInstall with [Composer](https://getcomposer.org/) by adding this to your `composer.json` file:\n\n```json\n\"require\": {\n\t\"traviswimer/twittering\": \"dev-master\"\n}\n```\nThen run `compsoser install` or `php composer.phar install`, depending on your setup.\n\n## Example usage\n\n```php\n// Include Composer autoloader\nrequire_once __DIR__.'/vendor/autoload.php';\n\n// First create initialize a Twittering object with you API key/secret\n$twittering = new \\Twittering\\Twittering(array(\n\t\"api_key\" =\u003e \"YOUR_CONSUMER_KEY\",\n\t\"api_secret\" =\u003e \"YOUR_CONSUMER_SECRET\",\n));\n\n// Then the requestTokens() method can be used to redirect the user to Twitter\n// for authentication. The user will then be sent back to the URL of your script.\n// This time, when requestTokens() is called, it will detect the $_GET parameters\n// sent from Twitter and continue with the authorization process.\n$tokens = $twittering-\u003erequestTokens();\n\n// Now that you have the tokens, you can save them to a database for future use.\n\n// To make API requests, call the authenticate() method.\n$apiConnection = $twittering-\u003eauthenticate( $tokens );\n\n// You are now ready to make API requests\n$timeline = $apiConnection-\u003eget( 'statuses/home_timeline', array('count' =\u003e '10') );\n```\n\n## Documentation\n\n### `new \\Twittering\\Twittering( $api_auth_info, );`\n\n*\t**$api_auth_info** - Array containing oAuth information.\n\t*\t\"api_key\" - Your app's consumer key\n\t*\t\"api_secret\" - Your app's consumer secret\n\n### `requestTokens( $callback_url, $redirect );`\n\n*This method behaves differently if the $_GET variables `oauth_token` and `oauth_verifier` are set*\n\n#### Without $_GET variables (Initial request)\n\n\u003e\tThis will send the user to Twitter to authorize your app.\n\n*\t**$callback_url** (Default: Current URL) - *String*. The URL Twitter should redirect the user back to once they have authorized your app.\n*\t**$redirect** (Default: true) - *Boolean*. Determines if the user should automatically be redirected to Twitter to authorize your app. If set to false, `requestTokens()` will instead return the URL where you should send the user.\n\n#### With $_GET variables (Twitter callback request)\n\n\u003e\tThis generate the user's long-term tokens.\n\nNo parameters are needed during this second pass. This will return an array containing the user's long-term tokens that can be stored in your database. You can also pass this array directly to the `authenticate()` method.\n\n### `authenticate( $tokens );`\n\n\u003e\tThis method creates an object can interact with the Twitter API on the authenticated user's behalf.\n\n*\t**$tokens** - *array*. An associative array of the user's tokens. Should contain the following keys, as obtained from the `requestTokens()` method:\n\t*\toauth_token\n\t*\toauth_token_secret\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Ftwittering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraviswimer%2Ftwittering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Ftwittering/lists"}