How do I get the destination URL of a shortened URL using Ruby?

前端 未结 4 2114
北荒
北荒 2021-01-04 06:59

How do I take this URL http://t.co/yjgxz5Y and get the destination URL which is http://nickstraffictricks.com/4856_how-to-rank-1-in-google/

4条回答
  •  不知归路
    2021-01-04 07:33

    You would have to follow the redirect. I think that would help :

    http://shadow-file.blogspot.com/2009/03/handling-http-redirection-in-ruby.html

提交回复
热议问题