Giter VIP home page Giter VIP logo

url-unshort's Introduction

Forums / Blogs / Groups / ...

Build Status

Live demo: https://rcopen.com

Nodeca itself is not expected for wide use. It's intended to replace old RC Design forum software and make programmer's life more comfortable.

But during development we create a lot of useful and popular packages for node.js. See organizations of @puzrin profile. Everything we do is published on github. Enjoy!

url-unshort's People

Contributors

itibbers avatar kirill89 avatar puzrin avatar rlidwka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

url-unshort's Issues

Option for deep follow on branded shorteners

Some branded shorteners (flic.kr, ali.pub) do multiple redirects via several domains. Now we have to list all such domains or write custom code. It would be nice to have option:

  • follow all next redirects
  • do not count next redirects

Important: with branded shorneters we can be sure that link will be landed predictably (not forwarded to another shortener).

suggestion

{ follow: true } or { deep: true }

Next (3.0.0)

  • callbacks -> promises (internal api)
  • request -> got
    • restrict max body size by default

url-unshort does not work for tinyURL

Hi,

Just a small note on tinyUrl shortening service (https://github.com/nodeca/url-unshort/blob/master/domains.yml).

When shorten an URL with tinyUrl the process is:

  1. Shorten the URL with tinyUrl.com
  2. Access the shorten URL from step 1 will open the page preview.tinyUrl.com
  3. Is a redirection but to an intermediary page that says:

This TinyURL redirects to:
URL from step 1
Proceed to this site.

Conclusion:

url-unshort will receive the redirection code and interpret it as the full unshorten URL. So, in the end, for tinyUrl, url-unshorten will return preview.tinyURL and not the correct one.

v6 checklist

  • Drop mdurl.
  • Revisit returned errors.
    • What is criteria of cache store.
  • Consider support select in .add().
    • Drop src attr check.
    • Document select rule (it's for <a> elements only).
  • Consider support text_select.
  • Should we add www. variant or leave that to aliases? Currently exists, but seems useless.
  • Implement skipped test.

Not sure:

  • Add famous partner program redirectors for aliexpress/ebay...
  • Cleanup Google Analytics query params (probably should be done before/after unshort independently).

Hangs forever

When used on something that is not a shortened url, it will hang forever:

require('url-unshort')().expand('https://google.com/').then(console.log)
Promise { <pending> }

The promise will never resolve. IMO this is risky behavior and causes memory leaks on our server. I would expect it to for example throw an error

Cookies tracking

Some shorteners can do several redirects and use cookies to pass data between. In theory we could process received cookies.

Notes:

  1. Only vk.com use this method, but it can be processed without url request
  2. Existing shorteners can behave different with cookies (should be tested)

suggestion

{ cookies: true}

DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

When running the example I get this deprecation message

(node:56484) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
Original url is: https://github.com/nodeca/url-unshort

Is it possible to fix this?

My versions:

node --version                                                        
v16.9.0

npm --version   
7.21.1

grep url-unshort package.json 
    "url-unshort": "^5.0.0",

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.