jleagle / bitly-api-client
Bitly API client.
Installs: 1 655
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
- jleagle/curl-wrapper: ~0.1
- packaged/helpers: ~1.1
This package is auto-updated.
Last update: 2024-11-09 13:10:15 UTC
README
To use the class, you need to use one of three static methods.
If you have a bitly account username and password:
$bitly = Bitly::usernamePassword($username, $password);
If you have an access token (you can get one from https://bitly.com/a/oauth_apps):
$bitly = Bitly::accessToken($accessToken);
If you want to log the user in using OAuth:
$bitly = Bitly::authorize($clientId, $clientSecret, $projectUrl, $state);
From there you have access to each endpoint:
Return the click rate for content containing 'obama':
$realtimeClickrates = $bitly->shorten('https://github.com/Jleagle/bitly-api-client');