sferik/twitter — pull request #459 by michaelherold (2013-10-01 18:11:41+00:00)
Title: Truncated display_urls raise an error

The way that Twitter truncates their URL entity display_urls is causing an error at lib/twitter/base.rb:57, which uses the ```::URI.parse``` method to parse the display_urls. This becomes a problem when printing out HTML versions of the tweets and using the entity location information given in the Tweet entity.

To see an example of this, pull tweet 381940500032258049 and check out the result. An example of this is shown at [this gist][gist].

According to the [Twitter Entity docs][twitter-docs], ```display_url```s are "[n]ot a URL but a string to display instead of the media URL," so I don't think they should actually be parsed as URIs, but instead just made into strings.

This pull request contains a failing spec in the first commit. I've actually committed a set of changes that makes ```display_uri```s into Strings, along with all the spec changes that that entails, but Github isn't showing it at the moment (I think due to the issues on their status board). It's a pretty heavy commit, so I don't know that it's the preferred way to go about it, but I wanted to give you an attempt at it.

[twitter-docs]: https://dev.twitter.com/docs/tweet-entities
[gist]: https://gist.github.com/michaelherold/6781697