{"id":13759595,"url":"https://github.com/Log1x/socialproof","last_synced_at":"2025-05-10T09:33:05.646Z","repository":{"id":62518648,"uuid":"142285858","full_name":"Log1x/socialproof","owner":"Log1x","description":"A fluent interface for retrieving follower counts from social API's.","archived":true,"fork":false,"pushed_at":"2019-04-08T13:01:03.000Z","size":14,"stargazers_count":40,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-16T16:37:13.009Z","etag":null,"topics":["fluent","followers","php","social","social-api"],"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/Log1x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-25T10:37:58.000Z","updated_at":"2024-08-30T22:16:31.000Z","dependencies_parsed_at":"2022-11-02T13:45:50.208Z","dependency_job_id":null,"html_url":"https://github.com/Log1x/socialproof","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Fsocialproof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Fsocialproof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Fsocialproof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Log1x%2Fsocialproof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Log1x","download_url":"https://codeload.github.com/Log1x/socialproof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253397369,"owners_count":21902027,"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":["fluent","followers","php","social","social-api"],"created_at":"2024-08-03T13:00:55.905Z","updated_at":"2025-05-10T09:33:05.321Z","avatar_url":"https://github.com/Log1x.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# SocialProof\n\n[![Latest Stable Version](https://poser.pugx.org/log1x/socialproof/v/stable)](https://packagist.org/packages/log1x/socialproof) [![Total Downloads](https://poser.pugx.org/log1x/socialproof/downloads)](https://packagist.org/packages/log1x/socialproof)\n\n## What is SocialProof?\n\nSocialProof is a [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) for fetching followers / fans from various social media platforms using their internal API. It handles all API requests asynchronous using [Guzzle](https://github.com/guzzle/guzzle) and catches API exceptions / errors with a user-definable default value.\n\n## Features \n\n* Simple, fluent syntax for handling credentials / configuration.\n* Completely asynchronous using Guzzle's `getAsync()`.\n* User-definable default values when an API request fails.\n* Simple debugging when configuring.\n* Automatically handles OAuth when fetching from API's such as Twitter.\n* Easily extendable and all PR's are very welcome. :heart:\n\n## Current Platforms\n\n* [Facebook](https://developers.facebook.com/)\n* [Twitter](https://developer.twitter.com/)\n* [Instagram](https://www.instagram.com/developer/)\n* [Pinterest](https://developers.pinterest.com/)\n* [LinkedIn](https://developer.linkedin.com/)\n\nAll pull requests for additional platforms are greatly appreciated. Please use the existing [Providers](https://github.com/Log1x/socialproof/tree/master/src/Providers) as an example.\n\n## Requirements\n\n* [PHP](https://secure.php.net/manual/en/install.php) \u003e= 7.0\n* [Composer](https://getcomposer.org/download/)\n\n## Installation \n\nInstall via Composer:\n\n```bash\ncomposer require log1x/socialproof\n```\n\n## Usage\n\nSocialProof is incredibly easy to use, but caching values and storing them appropriately to not hit API limits / affect performance is up to the end-user. For WordPress, an example would be using the [Transients API](https://codex.wordpress.org/Transients_API) with an expiration of every 24 hours and the [Options API](https://codex.wordpress.org/Options_API) for a fallback value along with `-\u003esetDefault()` in the event an API request fails after your transient expires.\n\n### Facebook\n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003efacebook()\n      -\u003esetUsername('example')\n      -\u003esetToken('XXXXXXXXXXXXXXXXXXXXXXXX')\n  -\u003eget();\n```\n\nSee [here](http://tools.creoworx.com/facebook/) to generate a token for Facebook.\n\n### Twitter \n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003etwitter()\n      -\u003esetUsername('username')\n      -\u003esetConsumerKey('XXXXXXXXXXXXXXXXXXXXXXXX')\n      -\u003esetConsumerSecret('XXXXXXXXXXXXXXXXXXXXXXXX')\n      -\u003esetToken('XXXXXXXXXXXXXXXXXXXXXXXX')\n      -\u003esetTokenSecret('XXXXXXXXXXXXXXXXXXXXXXXX')\n  -\u003eget();\n```\n\n### Instagram\n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003einstagram()\n      -\u003esetToken('XXXXXXXXXXXXXXXXXXXXXXXX')\n  -\u003eget();\n```\n\n### Pinterest\n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003epinterest()\n      -\u003esetUsername('username')\n  -\u003eget();\n```\n\n### LinkedIn\n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003elinkedin()\n      -\u003esetUsername('username')\n      -\u003esetToken('XXXXXXXXXXXXXXXXXXXXXXXX')\n  -\u003eget();\n```\n\n## Configuration \n\n`SocialProof::social()` accepts various configuration when passing through your social credentials. Here's an example using Facebook:\n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003efacebook()\n      -\u003esetUsername('example')\n      -\u003esetToken('XXXXXXXXXXXXXXXXXXXXXXXX')\n      -\u003esetDefault('No followers')\n      -\u003esetApi('https://graph.facebook.com')\n      -\u003esetEndpoint('/v2.7/')\n      -\u003esetTimeout(60)\n      -\u003esetDebug()\n  -\u003eget();\n```\n\nA long form syntax is also available for passing credentials and configuration through an array using `setCredentials($array)` and `setConfigs($array)` or a string using `setCredential($key, $value)` and `setConfig($key, value)`.\n\n```php\nuse SocialProof\\SocialProof;\n\nreturn SocialProof::social()\n  -\u003efacebook()\n      -\u003esetCredentials([\n        'username' =\u003e 'example',\n        'token' =\u003e 'XXXXXXXXXXXXXXXXXXXXXXXX'\n      ])\n      -\u003esetConfig('default', 'No Followers')\n  -\u003eget();\n```\n\n## Debugging\n\nSince SocialProof catches API errors, timeouts, etc. and returns a default value instead, you can use `-\u003esetDebug()` to enable debugging during initial setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLog1x%2Fsocialproof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLog1x%2Fsocialproof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLog1x%2Fsocialproof/lists"}