dentarg / pynik

:tiger: Internet Relay Chat bot
Other
3 stars 2 forks source link

tweet.py: tags (<, >, &) shouln't be presented escaped/encoded #10

Closed dentarg closed 8 years ago

dentarg commented 8 years ago
18:19:03 < osund> https://twitter.com/AlecMuffett/status/666665508574502912
18:19:04 < rufwebot> @AlecMuffett: Epic thanks to @twbtwb! #facebookcorewwwi is 
                     now running an experimental Tor feature: reduced Onion hop 
                     count =&gt; Lower latency =&gt; faster :-)

image

dentarg commented 8 years ago

Still a problem

16:12:08 <..... dentarg> https://twitter.com/AlecMuffett/status/666665508574502912
16:12:09 <.... rufwebot> @AlecMuffett: Epic thanks to @twbtwb! 
                         #facebookcorewwwi is now running an experimental Tor 
                         feature: reduced Onion hop count =&gt; Lower latency   
                         =&gt; faster :-)
dentarg commented 8 years ago

I suspect the Twitter API does the escaping/encoding

dentarg commented 8 years ago

Same thing in Ruby, so yes, it has to be the API

https://twitter.com/eoinmackenrob/status/698626240895393794

[9] pry(main)> status.to_h
=> {:created_at=>"Sat Feb 13 21:54:10 +0000 2016",
 :id=>698626240895393794,
 :id_str=>"698626240895393794",
 :text=>"hej hej &amp; lite mer text &lt; tag slut tag &gt; foo",

Interesting story: http://www.hanselman.com/blog/WhyTheAskObamaTweetWasGarbledOnScreenKnowYourUTF8UnicodeASCIIAndANSIDecodingMrPresident.aspx

But no problem with that

22:55:17 <..... dentarg> https://twitter.com/eoinmackenrob/status/698626355802607622                     
22:55:17 <.... rufwebot> @eoinmackenrob: "that's left us deeper..." but he   
                         tweeted "that’s." Note the "smart" apostrophe testing