hmemcpy / xkcd-slackbot

An /xkcd command for Slack!
The Unlicense
27 stars 4 forks source link

Unfurling and Encoding #4

Closed gRanger777 closed 8 years ago

gRanger777 commented 9 years ago

This isn't really an issue, but I have a couple of questions. I've looked at your code and compared it to a script i was working on in python to do a similar thing, but I wanted to know about a couple of things in your code.

First, with unfurling. I set my json data that is sent to slack to 'unfurl_links' : 'true' as I saw you did in your code. Do you have an issue with posting the same comic back to back? If I try to send the comic twice, the first one unfurls, but the second one does not. Even if I send 1 comic, it unfurls, then send a different one it too will unfurl, but if i send the original one again it doesn't unfurl. My question here is do you experience this with your code? I am wondering if this is a slack limitation. I am trying to decipher your code and understand it to a point but I'm not as experienced with the syntax of c#.

The second question I had pertains to the encoding of certain character in the hoverover/alt text. In particular I have a problem with comic 1588. It has the copyright symbol after the Dorito's name and when my parser (BeautifulSoup) tries to send it, I end up with a weird encoding issue. Again, I have not run your script because I don't have the proper setup but I was curious how your script handles this encoding issue for certain comics.

Thanks, Rich

hmemcpy commented 9 years ago

Hi!

Sorry it took me a while to answer... Hmm, I just checked with my own bot, and it seems that you're right: Slack does not unfurl subsequent comics with the same url, only the first one! I think they might be filtering it, to prevent flooding the channel...

Also, I have the same encoding issue with comic 1588. Not sure I can specify encoding in the payload to Slack, though...