openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.15k stars 908 forks source link

When a user posts a story in their diary, give them the option to share with social media #1391

Open openbrian opened 7 years ago

openbrian commented 7 years ago

Give them the option to share with Twitter, Facebook, Instagram, Jabber (XMPP) etc.

pnorman commented 7 years ago

It's open source, so you can work on any issues you want to. This one is probably a reasonably good starter issue because it's a small front-end change, and it's unlikely anyone else is working on it.

tomhughes commented 7 years ago

I wouldn't say it was small myself. I mean it won't need that much code but it will presumably mean dragging in some third party component(s) and hence making a choice about which is best to use. There will also be significant privacy issues to deal with.

By all means do have a go at it - nobody else is as far as I know - but I wouldn't say it's trivial.

pnorman commented 7 years ago

I don't see significant privacy issues, maybe we're imagining different implementations? For the twitter case it'd be a link like https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fpaulnorman.ca%2Fblog%2F2016%2F11%2Fserving-vector-tiles%2F&ref_src=twsrc%5Etfw&text=Serving%20Vector%20Tiles%20-%20Paul%E2%80%99s%20Blog&tw_p=tweetbutton&url=http%3A%2F%2Fwww.paulnorman.ca%2Fblog%2F2016%2F11%2Fserving-vector-tiles%2F

e.g. image

There probably is some third-party component that URL formation for common social media networks

tomhughes commented 7 years ago

Well that's the ultra low tech approach for twitter sure, but I think a more normal approach would be to use one of the gems I'm sure exists that adds some sort of sharing panel for a range of sites - the important thing would be to ensure that it didn't load anything from the sites until you chose to use it.

gravitystorm commented 7 years ago

That's just a warning that can be ignored - I'll figure out how to get rid of it at some point!

hd719 commented 7 years ago

Hey @tomhughes, @pnorman, @gravitystorm I added the gem gem social-share-button, but in the gem's documentation it requires me to add *= require social-share-button to the application.scss file.

I do not see that file in the stylesheets folder. I was wondering should I create that file or should I place the content (*= require social-share-button) somewhere else within the stylesheets folder.

tomhughes commented 7 years ago

Probably best to put it in screen-ltr.css and screen-rtl.css although you might want to consider only loading it on those pages that need it rather than loading it site wide.

kcne commented 1 month ago

Side Note Regarding This Issue:

I've attempted to use the following gems for implementing social media sharing functionality:

  1. social-share-button
  2. shareable

While the bundle install command works fine, following the configuration steps in the README.md for both gems led to unresolved errors.

A few questions arise from these attempts:

  1. Alternative Gems: Are there any other gems you would suggest trying out for this functionality?
  2. Custom Implementation: Considering we may want to add social networks not covered by these gems, such as Mastodon and Instagram, would it make sense to implement this functionality from scratch? Specifically, I'm concerned about the effort required for customization and the ongoing maintenance of the code.

Thank you for your guidance!

tomhughes commented 1 month ago

Well neither of those has been maintained recently - in the case of shareable it hasn't been touched for ten years.

That in turn speaks to the lack of support for more recent networks and possibly also to why any installation instructions no longer work.

My inclination would definitely be to look to see if there are newer and/or better supported alternatives.

tomhughes commented 1 month ago

It does look like social-share-button is the main player in the is space but honestly it doesn't actually do that much - basically it provides a set of images and a helper to generate a button.

There's a bit of javascript client side but basically all it does is react to a button click by doing window.open on a service specific URL so I'm not sure there's much there that couldn't be done just as well with our own helper that generated buttons with appropriate links.

kcne commented 1 month ago

I'm currently working on implementing the social media sharing functionality, and everything is progressing well. I just have a couple of questions:

pnorman commented 1 month ago

Just a note for anyone reviewing the old history of this issue, it appears that comments were made by a deleted user. There are replies to comments that no longer exist.