4 ms·
The attention to detail in spec output is exemplary. Uploading to Imgur for displaying card images to users seems like a strange choice, though. Why not have t
by lotyrin 11y ago
The attention to detail in spec output is exemplary.
Uploading to Imgur for displaying card images to users seems like a strange choice, though. Why not have the bot serve its own images up over HTTP and attach URLs to itself? I could even imagine a badges.io style image preparation microservice that could be shared by several playing-card based bot apps.
- deleted 11y ago[deleted]
- GauntletWizard 11y agoPossibly because running a bot client is much different from running a webserver. Dialing outbound to connect to slack is much easier than figuring out or configuring your own canonical URL, opening ports, etc. On the other hand, preparing hands as a single image seems a bad way of doing this; Does the slack API only allow a single image per conversation? I agree with your preparation microservice idea - There should be (and probably are several) a service that allows you to specify a poker hand as a query string and get back an image of the hand. More simply, though: A webfont and https://en.wikipedia.org/wiki/Playing_cards_in_Unicode https://en.wikipedia.org/wiki/Playing_cards_in_Unicode
- OJFord 11y ago> preparing hands as a single image seems a bad way of doing this I don't believe there's another way to display them inline?
- TazeTSchnitzel 11y agoAre images even necessary, anyway? Unicode has playing card codepoints (the full 52) and playing card house codepoints (️, ️, ️, ️). Edit: What the hell? Hacker News stripped the Unicode characters?! https://news.ycombinator.com/item?id=10156894 https://news.ycombinator.com/item?id=10156894
- CharlieHess 11y agoYou can't control the font rendering in Slack (it's Lato, at a certain size). The Unicode cards are far too small to read.
- TazeTSchnitzel 11y agoI did think of that. But you could use the symbols for the houses and pair them with a number/letter.
- Vexs 11y agoI saw it on HN a while ago- a webservice that does poker hands using a URL; you could pass it cards in the URL and it would display them.
- jeeva 11y agodeckofcardsapi.com, if it's the one I'm thinking of?
- CharlieHess 11y agoThe Slack API only allows a single image URL for attachments. I was also keen on the idea of being able to swap out the card assets whenever. Unicode playing cards is a decent idea, except Slack only renders in Lato.
- icebraining 11y agoDoes Slack accept images with data URIs instead of URLs? Seems like it'd give you the best of both worlds.
- e12e 11y agoClearly the author is able to watch imgurl access logs... (or does imgurl list number of views for images? With good enough timing, that might be enough...)... ;-)
- CharlieHess 11y agoThe [imgur](https://github.com/kaimallea/node-imgur https://github.com/kaimallea/node-imgur) API lets you upload an image (anonymously) and responds with a URL. I promisify'd that and the result is super straightforward. You don't even need to auth.