You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 9, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 9, 2018. It is now read-only.
Replace HTML entities in tweets pushed to IRC? #29
Example: <showbot> @5by5: The Critical Path with @asymco & @danbenjamin is starting now - http://t.co/sI19cI8S (17 seconds ago)
For what it's worth, I had the same issue with something very similar I wrote in perl, where I was passing tweets through decode_entities() as provided by HTML::Entities. The problem seemed to be solely with & not being properly decoded, and I ended up fixing that with a simple replace before I passed the tweet text on to decode_entities()--kludgy, but it worked.
There are also occasional issues with the website not showing entities properly on Link suggestions. I have been meaning to use http://htmlentities.rubyforge.org/ to fix this up.
FWIW, I was just looking at my own Twitter bot, trying to diagnose why my entity replacement didn't seem to be working, and noticed that the Twitter API returns double-escaped entities.
For example, literal < is returned as <.
I solved the issue by running the text trough the filter twice.
Example:
<showbot> @5by5: The Critical Path with @asymco & @danbenjamin is starting now - http://t.co/sI19cI8S (17 seconds ago)For what it's worth, I had the same issue with something very similar I wrote in perl, where I was passing tweets through decode_entities() as provided by HTML::Entities. The problem seemed to be solely with & not being properly decoded, and I ended up fixing that with a simple replace before I passed the tweet text on to decode_entities()--kludgy, but it worked.