Git Product home page Git Product logo

known-bitly-shorten's Introduction

Bit.ly link shortener for Known

This plugin provides basic bit.ly link shortener support for the Known share tool.

The plugin uses both OAuth2 and Generic Access Token integration, so you can specify a default shortener (via the GAT), but users can override this by linking to their own bitly accounts.

Usage

  • Install in your plugins
  • Get a generic access token / OAuth keys from your bitly settings page
  • Configure the plugin via the bitly page in the admin panel
  • Now, whenever you use the Known share button, links will be shortened.

See

known-bitly-shorten's People

Contributors

mapkyca avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

danito lumenpink

known-bitly-shorten's Issues

url/shorten not triggered

Hi,
I couldn't make it work on my known installation. I added a
error_log($access_token);
after

   \Idno\Core\site()->addEventHook('url/shorten', function(\Idno\Core\Event $event) {
        // Try user binding first
        if ($this->hasBitly()) {
            $access_token = \Idno\Core\site()->session()->currentUser()->bitly['access_token'];
            // Generic access token shorten
        } else if (isset(\Idno\Core\site()->config->config['bitly'])) {
            // Shorten with GAT
            $access_token = \Idno\Core\site()->config->config['bitly']['generic_access_token'];
        }
        if ($access_token) {
            $url = $event->response();

but nothing shows up in the logs. I even put a var_dump($event) but still nothing happens.
If I do the same with in addEventHook('url/expandintext',...); it works well.
The strange thing is that when dumping the $event later I can see an entry url/shortener, but without any data.
Any ideas why the url/shortener is not triggered?
Thanks

Upgrade to api v4

Needs to move endpoint, use bearer token and parse different result

Funkyness in url expansion

Recently the lookup ->url_expansion_lookup was being populated with duplicate and ever expanding key values where "." in the value was being expanded into an ever expanding list of %25 (URL encoded "%" char).

Eventually this brought down the server.

I suspect there's some multiple url encoding going on in the expandintext line, perhaps the url is being sent encoded at that point.

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.