tzsk / shorten-url Goto Github PK
View Code? Open in Web Editor NEWGoogle URL Shortener and Expander for Laravel
License: MIT License
Google URL Shortener and Expander for Laravel
License: MIT License
Provide a detailed description of the change or addition you are proposing.
Make it clear if the issue is a bug, an enhancement or just a question.
Why is this change important to you? How would you use it?
How can it benefit other users?
Not obligatory, but suggest an idea for implementing addition or change.
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.
Trying to use the package, I got the following response
In GoogleUrlShortener.php line 86:
Undefined property: stdClass::$id
and from the Google API:
(dump of $response at GoogleUrlShortnener.php:83)
object(stdClass)#1658 (1) {
["error"]=>
object(stdClass)#1657 (3) {
["errors"]=>
array(1) {
[0]=>
object(stdClass)#1654 (4) {
["domain"]=>
string(11) "usageLimits"
["reason"]=>
string(16) "ipRefererBlocked"
["message"]=>
string(148) "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions."
["extendedHelp"]=>
string(75) "https://console.developers.google.com/apis/credentials?project=XXXXXXXXXXX"
}
}
["code"]=>
int(403)
["message"]=>
string(148) "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions."
}
}
It is possible to solve it by indicating a generic referer via curl.
I have added the following line:
(GoogleUrlShortnener.php:122)
curl_setopt($this->curl, CURLOPT_REFERER, 'http://www.google.com');
My composer.json
...
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"simplepie/simplepie": "^1.5",
"tzsk/shorten-url": "^1.0",
"yangqi/htmldom": "^1.0"
...
I hope you find it useful
Do not working for PHP5.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.