Download the PHP package hpatoio/bitly-api without Composer
On this page you can find all versions of the php package hpatoio/bitly-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bitly-api
BitlyApi
This package is not maintained
Check phplicengine/bitly as a possible replacement.
PHP Library based on Guzzle to consume Bit.ly API.
The biggest advantage in using Guzzle is that you can easely attach Guzzle plugins to your client. Here, for example,you can see how to attach the log plugin and write all your requests to a file.
An integration with Symfony2 is available as well.
Versions
- branch
master
follows psr4 standards and get2.x
tags - branch
psr0
follows, of course, psr0 standards and get1.x
tags - No new features only bugfix
This project follow semantic versioning.
Installation
The recommended way to install this library is through Composer. For information about Composer and how to install in look here.
New project
From the command line run
Existing project
Move into your project directory and run
or add to your composer.json
and run
Usage
cURL options
It might be that bit.ly is unreachable and you want to set a specific timeout. Just set the cURL timeout options in the client:
Methods names
To get the method name remove "v3" from the API url and camelize the other words removing the slashes.
Examples:
- /v3/highvalue -> Highvalue
- /v3/realtime/hot_phrases -> RealtimeHot_phrases
- /v3/link/content -> LinkContent
Available methods
At the moment the library supports these APIs:
- bitly Data APIs
- Links
- Link Metrics
- User Metrics
Behat
You need to copy Behat default configuration file and enter your access_token
option there.
Now open behat.yml
and change the string your_bitly_access_token_here
with your access token.
Run the suite typing
Integrations
A Symfony2 bundle that integrate this library is available here
Attach Guzzle plugin
Here you can see how to attach Guzzle Log plug to your client and save all your requests to a file.
NB: To run this script you need monolog/monolog
Now in /tmp/bitly_guzzle.log
you can see all your requests.