{"id":21378894,"url":"https://github.com/93digital/twitter-api","last_synced_at":"2026-05-21T07:43:59.414Z","repository":{"id":56938713,"uuid":"390750504","full_name":"93digital/twitter-api","owner":"93digital","description":"A PHP class to facilitate Twitter API access, specifically fetching tweets from a single user. Intended for use within WordPress.","archived":false,"fork":false,"pushed_at":"2021-11-23T16:46:13.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-23T12:04:58.928Z","etag":null,"topics":["php","twitter","twitter-api","wordpress"],"latest_commit_sha":null,"homepage":"https://93digital.co.uk/","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/93digital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-29T14:26:39.000Z","updated_at":"2021-11-23T16:46:16.000Z","dependencies_parsed_at":"2022-08-21T01:40:26.980Z","dependency_job_id":null,"html_url":"https://github.com/93digital/twitter-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/93digital%2Ftwitter-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/93digital%2Ftwitter-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/93digital%2Ftwitter-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/93digital%2Ftwitter-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/93digital","download_url":"https://codeload.github.com/93digital/twitter-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243854271,"owners_count":20358575,"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","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":["php","twitter","twitter-api","wordpress"],"created_at":"2024-11-22T10:15:50.291Z","updated_at":"2026-05-21T07:43:59.371Z","avatar_url":"https://github.com/93digital.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitter Class\n\u003cbr/\u003e\nTwitter API library which retreives a limited amount of tweets,\nanswers and retweets from a given user twitter account.\n\nThe data retreived is stored in **wp_options** as a serializez\nstring data.\n\nData is updated every **5 minutes** but the time the data is updated\ncan be changed. It is not recommended to set update data to 0 because\nTwitter has restrictions about API abusive call rates.\n\nThis is a static class therefore does not have to be instantiated.\n\nUser Twitter APP data can be set in Admin menu -\u003e Appaerance -\u003e Theme settings.\n\n\n## How to use\n\u003cbr/\u003e\n\n- In extras.php add the following line of code :\n  ```php\n  \u003c?php\n    Twitter::init();\n  ?\u003e\n  ```\n\n- Log in into your project's **admin panel**. Then open **Appareance -\u003e Theme settings** in the lef menu.\n\n- Open the **Twitter API** tab. Fill the form with the client Twitter APP data. In\n  order to **get all the tokens** and consumer key you need to make the class work\n  you will need to create a Twitter APP using the client Twitter account.\n\n- You can also set the **Number of Tweets** you want to retrieve and how ofter the\n  **cache is cleared**. Twitter API has a limit in the number of request you can perform\n  per day.\n\n- Default number of Tweets retrieved per request is **5**.\n\n- Save the form.\n\n- Call static method **return_html** to get an ul HTML element which\n  contains all the Twitter data. This method accpets parameters. Check\n  usage_example.php for further information.\n  ```php\n  \u003c?php\n    //exmaple - $twitter_data contains \u003cul\u003e\u003cli\u003eTweet 1\u003c/li\u003cli\u003eTweet 2\u003c/li\u003e\u003c/ul\u003e\n    $twitter_data = Twitter::return_html();\n    echo $twitter_data;\n  ?\u003e\n  ```\n\n- Call static method **check_twitter_data()** to retrieve an object\n  which contains the twitter data.\n  ```php\n  \u003c?php\n    //example - $twitter_data contains an php objectstdClass\n    $twitter_data = Twitter::check_twitter_data();\n  ?\u003e\n  ```\n- Modify the attribute **$minutes_after_call** in method **check_retrieve_form_api()**\n  to change the time passed since last API call.\n\n- Modify the attribute **$request** key *count* in method **return_tweet** to change\n  the number of tweets retreived\n\n\u003cbr/\u003e\nCheck file **usage_example.php** located in this repository for a full working example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F93digital%2Ftwitter-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F93digital%2Ftwitter-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F93digital%2Ftwitter-api/lists"}