breathe-india icon indicating copy to clipboard operation
breathe-india copied to clipboard

Share button in `Post.svelte` to share a post to twitter

Open itsfarseen opened this issue 3 years ago • 7 comments

itsfarseen avatar May 08 '21 06:05 itsfarseen

We could use https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/guides/web-intent What should be the format of the tweet?

anandubajith avatar May 08 '21 13:05 anandubajith

Share buttons for Instagram and WhatsApp would also be a good addition.

sudormrfbin avatar May 08 '21 14:05 sudormrfbin

<thing> available at <location>
<more info>
breathe-india.com/post/<post-id>

<location> should be a concatenation of state, district, city, spot fields. But there are some issues with that. See https://github.com/itsfarseen/breathe-india/issues/8

We should skip empty fields among those location subfields. Currently, as I had put <input required> for all the fields, the current data contains - or N/A to denote unavailable fields. Consider them too as empty. Another issue is some of the fields are put as same, for example when both District and City are "Bangalore" we should concatenate it only once. If you do this, it would be nice if you could port it over to PostRow.svelte to fix #8

itsfarseen avatar May 08 '21 14:05 itsfarseen

as @gokulsoumya suggested it would be nice if we can add insta and whatsapp too, but if that is not possible a copy to clipboard button would do.

itsfarseen avatar May 08 '21 14:05 itsfarseen

  • It's possible to generate wa.me links with prefilled text for WhatsApp - https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app/?lang=en
  • I couldn't find anything relating to sharing directly to Instagram
  • https://caniuse.com/?search=clipboard - :thinking:

anandubajith avatar May 08 '21 14:05 anandubajith

I couldn't find anything relating to sharing directly to Instagram

It seems Instagram doesn't allow sharing from external websites to it's app (makes sense considering it's mainly for sharing photos and videos). IIRC it only allows users with more than 10K followers to directly post a link to their stories (that too from within the app). Forgot about it earlier :P

sudormrfbin avatar May 08 '21 14:05 sudormrfbin

the clipboard partial support means, if I understand correctly, that we can only copy data to clipboard and not paste from clipboard. Which makes sense because then random websites will be able to monitor our clipboard.

itsfarseen avatar May 08 '21 14:05 itsfarseen