New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unwind

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unwind

  • 0.13.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Description

Enables following a series of redirects (shortened urls)

Prerequisites

Tested on Ruby 1.9.3 & 2.0 (likely still works on 1.8.7, but you are on your own.)

Example Code

require 'unwind'

follower = Unwind::RedirectFollower.new('http://j.mp/xZVND1')
follower.resolve
assert_equal 'http://ow.ly/i/s1O0', follower.final_url 
assert_equal 'http://j.mp/xZVND1', follower.original_url
assert_equal 2, follower.redirects.count

Hat tip

Most of the code is based on John Nunemaker's blog post Following Redirects with Net/HTTP.

License

Provided under the Do Whatever You Want With This Code License.

FAQs

Package last updated on 28 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc