Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate social media functionality with sharing microservice #673

Merged
merged 8 commits into from
May 29, 2017

Conversation

goldpbear
Copy link
Contributor

@goldpbear goldpbear commented Mar 31, 2017

Addresses: #292, #655

Changes introduced:

  • Remove a hard-coded use of the place/ dataset slug in a template helper function used for generating Twitter and Facebook sharing urls
    * Move all social meta tag handling client-side. That way, we can update the content of meta tags as users navigate around the app, instead of relying on the Django-generated tags on page load. This actually addresses a bit of Static site conversion #655
  • Use the social.mapseed.org microservice to create sharing metadata

@goldpbear goldpbear force-pushed the goldpbear/social-media-previews-292 branch 2 times, most recently from c4e8d79 to 75df6f4 Compare April 2, 2017 04:42
@goldpbear goldpbear requested a review from modulitos April 2, 2017 04:48
@goldpbear
Copy link
Contributor Author

goldpbear commented Apr 2, 2017

@Lukeswart -- curious if you think the strategy of updating social meta tags client-side in this PR is a good idea.

I think part of the problem with the social media previews is that the page's meta tags were being generated once by Django on page load, but when a user starts navigating client-side, those meta tags become obsolete.

Instead, I think we can just update them on the client whenever anyone clicks a social media sharing button. This also knocks off one to-do on the static site conversion as well.

@goldpbear goldpbear force-pushed the goldpbear/social-media-previews-292 branch from 75df6f4 to 004e19b Compare April 2, 2017 04:54
@modulitos
Copy link
Member

@goldpbear Yes, I think moving this onto the client is a good idea, and it knocks another TODO off of our static site conversion. But we can't do this entirely on the client via javascript - the twitter/facebook bots don't parse any js - they only read the HTML meta tags that comes back from that link. So we can't simply update the metatags via js.

I'm happy to help implement a simple solution for this - it involves creating a separate service that will render the html with the proper meta tags for the bots, whenever someone shares a link. I'm happy to meet up and discuss anytime. It's basically a simplified version of what pre-rendering engines are doing, like this one: https://github.com/prerender/prerender

@goldpbear
Copy link
Contributor Author

Oh, duh. That makes sense. I'll take a look at the prerendering engine...

@goldpbear goldpbear force-pushed the goldpbear/social-media-previews-292 branch from e3d3aa4 to 890801e Compare May 20, 2017 20:59
@goldpbear goldpbear force-pushed the goldpbear/social-media-previews-292 branch from 890801e to 316d235 Compare May 26, 2017 23:54
@goldpbear goldpbear changed the title Accommodate variable dataset slugs in social media sharing functionality Integrate social media services with sharing microservice May 27, 2017
@goldpbear goldpbear changed the title Integrate social media services with sharing microservice Integrate social media functionality with sharing microservice May 27, 2017
@goldpbear goldpbear force-pushed the goldpbear/social-media-previews-292 branch from 959b8aa to bdab27a Compare May 29, 2017 18:50
@goldpbear goldpbear merged commit 96ee7ff into master May 29, 2017
@goldpbear goldpbear deleted the goldpbear/social-media-previews-292 branch March 11, 2018 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants