Releases: altmetric/embiggen
1.6.0
Add 1190 New Domains:
- 927 domains from https://github.com/PeterDaveHello/url-shorteners
- 18 domains found by going through https://github.com/738/awesome-url-shortener
- 241 Branded Bitly domains
- 4 other domains
bitlybr.com, ir.uv.es, go.uv.es, link.uv.es
- Remove
mz.cn,
duplicate (https://github.com/altmetric/embiggen/blob/6b61cbee40209dbec518c35612ce12931cbc742c/shorteners.txt#L4856)
10 new domains, including World Bank
Merge pull request #32 from altmetric/add-world-bank-new-shortener Add wrld.bg, World Bank's new shortener and 9 other domains
1.1.0
- Extract the list of default shorteners into a separate text file,
shorteners.txt
and speed up identification of shortened links.
Thanks to @AvnerCohen for these contributions.
1.0.0
Simplify Embiggen's API by exposing a single expand
method (rather than two separate expand
and expand!
methods).
This means that Embiggen will no longer return sum types on expand
(encapsulating errors and exceptions) but raise exceptions if any of the following situations occur:
Embiggen::TooManyRedirects
: when a URI redirects more than the configured number of times;Embiggen::BadShortenedURI
: when a URI appears to be shortened but following it does not result in a valid redirect;Embiggen::NetworkError
: when an error occurs during expansion (e.g. a network timeout, connection reset, unreachable host, etc.).
All of the above inherit from Embiggen::Error
and have a uri
method for determining the problematic URI.
If you're upgrading from the 0.x line of Embiggen, this means you will now need to catch the above errors to preserve the same behaviour.
The other API change is in the list of shorteners used by Embiggen to determine whether to follow a link or not: Embiggen::Configuration.shorteners
is now an object which has an include?
method that takes a single URI and returns true
if it is shortened.
By default, this object is an instance of Embiggen::ShortenerList
and contains a set of domains and returns true on include?
if a URI's host matches one of the set.
shorteners = Embiggen::ShortenerList.new(%w(bit.ly example.com))
shorteners.include?(URI('http://bit.ly/foo')) #=> true
shorteners.include?(URI('http://example.com/bar')) #=> true
shorteners.include?(URI('http://notashortener.com/baz')) #=> false
This means you can plug in your own implementations, e.g. to query Bitly's API or to expand all URIs regardless of domain.
Install the latest version from RubyGems like so:
$ gem install embiggen -v '~> 1.0'
Or, add to your Gemfile like so:
gem 'embiggen', '~> 1.0'