Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Hubot Response Formatting Plugin? #11

Closed
jotterbot opened this issue Mar 4, 2015 · 1 comment
Closed

Hubot Response Formatting Plugin? #11

jotterbot opened this issue Mar 4, 2015 · 1 comment

Comments

@jotterbot
Copy link

Hey Guys,

if i do:
@hubot map me sydney, australia

I get a response like this:

http://maps.google.com/maps/api/staticmap?markers=sydney&size=400x400&maptype=roadmap&sensor=false&format=png
http://maps.google.com/maps?q=sydney&hl=en&sll=37.0625,-95.677068&sspn=73.579623,100.371094&vpsrc=0&hnear=sydney&t=m&z=11

I have played around with the replacements plugin (in lets-chat) and mapping eg. "maps.google.com.*" responses to img tags, but couldn't seem to make it work. Lets-chat seems to be hard coding everything as links - I can't override the result to be generic html code.

Can you describe what is required in order to have the first line be rendered as an image (if i tack on .png on the end it works) , and the second line as the URL linked to.

This is just one example. So I guess putting it another way, will there be some mechanism to integrate hubot responses (no matter what the hubot plugin) in lets-chat so that the formatting is "pretty" or more user friendly? Is this better to lodge as an issue in the main lets-chat repo?

@hhaidar
Copy link
Member

hhaidar commented Mar 4, 2015

Hey @jotterbot,

Yup, this is a feature request in the main repo: #244

I'm not sure when it'll be in (probably 0.5.x), but you can definitely try modifying the source to parse google maps: https://github.com/sdelements/lets-chat/blob/master/media/js/util/message.js

Another thing we can try is processing plugins before links. That might work for your use case too.

@hhaidar hhaidar closed this as completed Mar 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants