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

img and/or open graph parsing #2

Open
Flet opened this issue Apr 30, 2015 · 5 comments
Open

img and/or open graph parsing #2

Flet opened this issue Apr 30, 2015 · 5 comments

Comments

@Flet
Copy link
Member

Flet commented Apr 30, 2015

From @derekr on April 28, 2015 4:23

Understandably not a desired feature, but I appreciate link/og parsing found in apps like slack and hipchat. Happy to work on it, but looking for some feedback on if this is wanted before I spend some time on it.

Copied from original issue: moose-team/friends#29

@Flet
Copy link
Member Author

Flet commented Apr 30, 2015

From @maxogden on April 28, 2015 4:27

+1 to gifs/pngs/jpgs for starters

would be nice to have a 'embed-media' module that matched strings for media urls, then turned them into embed html. bonus points if it can verify they are valid images before rendering (e.g. render to invisible canvas and make sure it loads correctly)

@Flet
Copy link
Member Author

Flet commented Apr 30, 2015

From @maxogden on April 28, 2015 16:52

since we have markdown now all you need to do is transform .jpg, .png, .gif into ![meta](url)

@Flet
Copy link
Member Author

Flet commented Apr 30, 2015

From @derekr on April 28, 2015 16:54

Yeah I think that'll work for now. To provide a decent experience like slack (verifying a valid url and what not) message parsing would need be async and was more work than I could put in to it last night haha.

@Flet
Copy link
Member Author

Flet commented Apr 30, 2015

From @derekr on April 28, 2015 17:3

Thoughts from last night:

message = richMessage(message)

// parse <a> from rendered html
// check for first valid embed (or just grab the first url and if it doesn't work then ¯\_(ツ)_/¯
parseEmbeds(message, cb (err, embed) {
  // embed could share the same structure as a message { text: 'url', html: 'embed html' }
  message = richMessage.mergeMessages(message, embed)
  render()
})
  • Loading/parsing indicator
  • Ensuring embed renders below relevant message and not at the bottom of all merged messages

@Flet
Copy link
Member Author

Flet commented Apr 30, 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

1 participant