如何通过URL在LinkedIn、Twitter等平台分享网站图片?附示例链接
在LinkedIn和Twitter分享图片的链接格式
嘿,根据你给出的Facebook、Google+和Pinterest的分享示例,我整理了LinkedIn和Twitter平台用于分享图片的对应链接格式,直接替换参数就能用:
LinkedIn 分享链接
LinkedIn的分享接口用url参数指定要分享的图片地址,格式如下:
https://www.linkedin.com/sharing/share-offsite/?url=你的图片直接URL
举个实际例子,分享Google logo的链接就是:
https://www.linkedin.com/sharing/share-offsite/?url=https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png
Twitter 分享链接
Twitter用intent接口实现分享,你可以通过url参数指定图片地址,还能可选添加text参数设置默认分享文案,格式如下:
https://twitter.com/intent/tweet?url=你的图片直接URL&text=自定义分享文案(可选)
不带自定义文案的示例:
https://twitter.com/intent/tweet?url=https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png
带自定义文案的示例:
https://twitter.com/intent/tweet?url=https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png&text=Check out this awesome logo!
小提醒:一定要确保你的图片URL是直接可访问的图片资源地址(后缀是.jpg/.png/.gif这类图片格式),这样平台才能正确抓取并显示图片哦。
内容的提问来源于stack exchange,提问作者Riyas Muhammed
相关产品推荐
相关产品推荐

