waavi / url-shortener Goto Github PK
View Code? Open in Web Editor NEWLaravel 5 url shortener
License: MIT License
Laravel 5 url shortener
License: MIT License
when add this package to composer.json
i got this error
D:\xampp\htdocs\manishen>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
[Composer\Downloader\TransportException]
The "http://packagist.org/p/waavi/url-shortener%2479452bc0b899f1be95f82568ba4fc4a4d518b29d68b899914c3619b833139ce2.json" file could not be downloaded: failed to ope
n stream: HTTP request failed!
Can't install it on for my Laravel 5.6 project can you update?
Problem 1
- waavi/url-shortener 1.0.1 requires mremi/url-shortener dev-master -> satisfiable by mremi/url-shortener[dev-master] but these conflict with your requirements or minimum-stability.
- waavi/url-shortener 1.0 requires mremi/url-shortener dev-master -> satisfiable by mremi/url-shortener[dev-master] but these conflict with your requirements or minimum-stability.
- Installation request for waavi/url-shortener 1.0.x -> satisfiable by waavi/url-shortener[1.0, 1.0.1].
Installation failed, reverting ./composer.json to its original content.
I'm getting a 403 forbidden response on all requests.
[2018-02-10 00:30:17] local.ERROR: Client error: `POST https://www.googleapis.com/urlshortener/v1/url` resulted in a `403 Forbidden` response:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "D (truncated...)
{"userId":2,"email":"[email protected]","exception":"[object] (Waavi\\UrlShortener\\Exceptions\\InvalidResponseException(code: 0): Client error: `POST https://www.googleapis.com/urlshortener/v1/url` resulted in a `403 Forbidden` response:
{
\"error\": {
\"errors\": [
{
\"domain\": \"usageLimits\",
\"reason\": \"dailyLimitExceededUnreg\",
\"message\": \"D (truncated...)
at /Sites/MyApp/vendor/waavi/url-shortener/src/UrlShortener.php:59)
Is there an additional authentication step I need to make for a valid API key? I made it through their API console.
I run command:
composer require waavi/url-shortener
Then its show the error
Hi, I have Laravel 5.2, I used the command:
composer require waavi/url-shortener 1.0.x
Also cheked in composer.json file and I have the require: "waavi/url-shortener": "1.0.x", that is ok.
After that I set the config in the file config\urlshortener.php with the API of Google URL Shortener and the username and password of Bit.ly but any work. In a view I tried with:
<?php echo \UrlShortener::shorten('www.google.com'); ?>
<?php echo \UrlShortener::driver('bitly')->shorten('www.google.com'); ?>
Boths return just: www.google.com
Any ideas? Thanks!
Hello Dear,
Thank you for great job I just have a little issue.
I've got this issue:
PHP error: Non-static method Waavi\UrlShortener\UrlShortener::shorten() should not be called statically on line 1
when I write code:
\UrlShortener::shorten('http://google.com');
I have followed the instruction and configured the keys as well but it shows.
InvalidResponseException in UrlShortener.php line 61: Bit.ly returned status code "500" with message "MISSING_ARG_ACCESS_TOKEN"
I think there may be issue with getting config values. Because if we hot code keys into vendor\waavi\url-shortner\src/Drivers/factory.php it works fine.. FYI
public function __construct(Config $config)
{
$googleApiKey = $config->get('urlshortener.google.apikey');
$bitlyUsername = $config->get('urlshortener.bitly.username');
$bitlyPassword = $config->get('urlshortener.bitly.password');
$connectTimeout = $config->get('urlshortener.connect_timeout');
$timeout = $config->get('urlshortener.timeout');
$this->google = new Google($googleApiKey, $connectTimeout, $timeout);
$this->bitly = new Bitly($bitlyUsername, $bitlyPassword, $connectTimeout, $timeout);
} dd($config) shows empty item
i set my username and password in .env
Bit.ly returned status code "500" with message "INVALID_ARG_ACCESS_TOKEN"
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.