unwind
unwind copied to clipboard
Regex for attribute parsing doesn't work all the time
u = Unwind::RedirectFollower.new("http://www.npr.org/blogs/health/2013/05/06/181664781/why-a-slowdown-in-health-spending-is-starting-to-look-real")
u.resolve
u.final_url
"http://www.npr.org/blogs/health/2013/05/06/181664781/why-a-slowdown-in-health-spending-is-starting-to-look-real\" /><meta name=\"description\" content=\"The growth in health spending has definitely slowed, according to several recent studies. Some reasons: the weak economy, a shift of costs to patients and fewer expensive technologies being introduced.\" /><link rel=\"alternate\" type=\"application/rss+xml\" title=\"Health\" href=\"/rss/rss.php?id=1128\" /><link rel=\"alternate\" type=\"application/rss+xml\" title=\"Shots - Health News\" href=\"/rss/rss.php?id=103537970\" /><meta property=\"og:title\" content=\"Why A Slowdown In Health Spending Is Starting To Look Real : NPR\" /><meta property=\"og:url\" content=\"http://www.npr.org/blogs/health/2013/05/06/181664781/why-a-slowdown-in-health-spending-is-starting-to-look-real\" /><meta property=\"og:type\" content=\"article\" /><meta property=\"og:description\" content=\"The growth in health spending has definitely slowed, according to several recent studies. Some reasons: the weak economy, a shift of costs to patients and fewer expensive technologies being introduced.\" /><meta property=\"og:image\" content=\"http://media.npr.org/assets/img/2013/05/06/pillbill_wide-ca036eb36377b65c2c6ff15d3f7c7374464d3305.jpg\" /><meta property=\"og:site_name\" content=\"NPR.org\" /><meta property=\"fb:app_id\" content=\"138837436154588\" /><link type=\"text/css\" rel=\"stylesheet\" media=\"screen, print\" href=\"http://s.npr.org/templates/css/generated/fingerprint/newsStory-b667009c0dbfcff7f80bef7072f994b0d3dd1c0f.css\" /><link type=\"text/css\" rel=\"stylesheet\" media=\"screen\" href=\"http://www.npr.org/branding/blogs/health/branding.css\" /><script type=\"text/javascript\" src=\"http://s.npr.org/templates/javascript/generated/fingerprint/headerAllPages-d8f384a1120504dbce2f09f787e57b04d08656c2.js"
props to @divoxx