Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jleagle/bitly-api-client
A small library to read and write to the Bitly API
https://github.com/jleagle/bitly-api-client
Last synced: about 9 hours ago
JSON representation
A small library to read and write to the Bitly API
- Host: GitHub
- URL: https://github.com/jleagle/bitly-api-client
- Owner: Jleagle
- Created: 2014-09-25T09:34:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-28T17:28:21.000Z (about 9 years ago)
- Last Synced: 2024-08-11T00:47:32.193Z (5 months ago)
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
bitly-api-client
================#### To use the class, you need to use one of three static methods.
If you have a bitly account username and password:
```php
$bitly = Bitly::usernamePassword($username, $password);
```If you have an access token (you can get one from https://bitly.com/a/oauth_apps):
```php
$bitly = Bitly::accessToken($accessToken);
```If you want to log the user in using OAuth:
```php
$bitly = Bitly::authorize($clientId, $clientSecret, $projectUrl, $state);
```#### From there you have access to each endpoint:
Return the click rate for content containing 'obama':
```php
$realtimeClickrates = $bitly->shorten('https://github.com/Jleagle/bitly-api-client');
```