Git Product home page Git Product logo

shorten-url's Introduction

shorten-url's People

Contributors

dependabot-preview[bot] avatar tzsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shorten-url's Issues

how to configure in laravel Lumen?

Detailed description

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.

Context

Why is this change important to you? How would you use it?

How can it benefit other users?

Possible implementation

Not obligatory, but suggest an idea for implementing addition or change.

Your environment

Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

  • Version used (e.g. PHP 5.6, HHVM 3):
  • Operating system and version (e.g. Ubuntu 16.04, Windows 7):
  • Link to your project:
  • ...
  • ...

"ipRefererBlocked" by google

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."
}
}

Detailed description

It is possible to solve it by indicating a generic referer via curl.

Possible implementation

I have added the following line:
(GoogleUrlShortnener.php:122)

    curl_setopt($this->curl, CURLOPT_REFERER, 'http://www.google.com');

Your environment

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.