nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.
https://nusmods.com
MIT License
582 stars 316 forks source link

Support sharing to WeChat and QQ #3290

Open davidsqf opened 3 years ago

davidsqf commented 3 years ago

image Is it possible to support sharing timetable via WeChat and QQ?

chrisgzf commented 3 years ago

Currently, sharing on WhatsApp / Telegram is done by stuffing the timetable into a stringified URL, then calling the sharing/message-sending features provided by WhatsApp / Telegram.

            <h3 className={styles.shareHeading}>Via messaging apps</h3>

            <a
              className="btn btn-outline-primary btn-block"
              href={`https://api.whatsapp.com/send?${qs.stringify({
                text: `My timetable: ${url}`,
              })}`}
              target="_blank"
              rel="noreferrer noopener"
            >
              WhatsApp
            </a>

            <a
              className="btn btn-outline-primary btn-block"
              href={`https://t.me/share/url?${qs.stringify({ url })}`}
              target="_blank"
              rel="noreferrer noopener"
            >
              Telegram
            </a>

I did a quick cursory search on whether something similar is available for WeChat / QQ, but it doesn't seem to be easily available. If anyone has any ideas on how this is typically done or can be easily done, feel free to comment below.

On a separate note: if we eventually do decide to implement support for more messaging platforms. We might want to convert these buttons into icons of the respective messaging apps instead. (Separate issue to be created to track this, if we do decide to go down this route.)