Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleander/googl-php
Google URL shortener API in PHP
https://github.com/oleander/googl-php
Last synced: 2 months ago
JSON representation
Google URL shortener API in PHP
- Host: GitHub
- URL: https://github.com/oleander/googl-php
- Owner: oleander
- License: mit
- Created: 2014-04-21T16:59:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-13T20:53:43.000Z (over 10 years ago)
- Last Synced: 2023-07-26T15:31:58.312Z (over 1 year ago)
- Language: PHP
- Size: 153 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Googl
Google URL shortener API in PHP
## Usage
### Shorten url
``` php
$client = new Googl\Base("[email protected]", "password");
$url = $client->shorten("http://www.bbc.co.uk/");
echo $url->short; # => "http://goo.gl/wZts"
```Your url should now be visible at [http://goo.gl/](http://goo.gl/).
### Expand url
``` php
$long = Googl\Base::expand("http://goo.gl/wZts");
echo $url->original; # => "http://www.bbc.co.uk/"
```## Install
### Without Composer
Clone the project using `git clone https://github.com/oleander/googl-php`
and include the source file with `require_once("googl-php/src/Googl.class.php");`### With Composer
Add the following json to your `composer.json` file and run `composer update`.
{
"require" : {
"oleander/googl" : "dev-master"
}
}## Test
Tests can be found in the `tests` folder and executed by running
`USER="[email protected]" PASSWORD="gmail-password" phpunit`. Don't
forget to run `composer update` before you run the test suite.## Contributing
1. Fork it ( http://github.com/oleander/googl-php/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request