Skip to content

Releases: altmetric/embiggen

1.6.0

20 Nov 07:43
194344f
Compare
Choose a tag to compare

Add 1190 New Domains:

10 new domains, including World Bank

16 Nov 14:09
a4255c2
Compare
Choose a tag to compare
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

15 Jan 16:08
Compare
Choose a tag to compare
  • 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

21 Nov 15:17
Compare
Choose a tag to compare

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'