[英]Sharing via Twitter, Facebook, LinkedIn, and Google Plus
I would like a section where users can share a certain link on different social media platforms from our app.我想要一个部分,用户可以在我们的应用程序中在不同的社交媒体平台上共享某个链接。 I have the twitter link working properly but Facebook, LinkedIn, and G+ are only sharing the URL and not a custom message.我的 twitter 链接工作正常,但 Facebook、LinkedIn 和 G+ 只共享 URL 而不是自定义消息。
Twitter推特
a.twitter-share-button href="http://twitter.com/intent/tweet?source=sharethiscom&text=BlahBlahBlah&url=http://#{Figs.ms.url}/#{@app.uuid}" target="_blank"
Facebook Facebook
a.fb-share-button href="https://www.facebook.com/sharer.php?u=http://#{Figs.ms.url}/#{@app.uuid}&t=BlahBlahBlah target="_blank"
LinkedIn领英
a.linkedin-share-button href="https://www.linkedin.com/cws/share?url=http://#{Figs.ms.url}/#{@app.uuid}&summary=BlahBlahBlah” target="_blank"
G+ G+
a.gplus-share-button href="https://plus.google.com/share?url=http://#{Figs.ms.url}/#{@app.uuid}" target="_blank"
I'd like the custom message to be BlahBlahBlah so when they click any of these links it would fill out the custom message and include the link.我希望自定义消息为 BlahBlahBlah,因此当他们单击这些链接中的任何一个时,它会填写自定义消息并包含链接。
The current page url is (request.original_url )当前页面 url 是 (request.original_url )
%a.fb-share-button{:href => " https://www.facebook.com/dialog/share?app_id=# {APP_ID}&display=popup&href=#{URL_TO_SHARE}&redirect_uri=#{request.original_url}", role: "menuitem", tabindex: "-1", target: "_blank"} %a.fb-share-button{:href => " https://www.facebook.com/dialog/share?app_id=# {APP_ID}&display=popup&href=#{URL_TO_SHARE}&redirect_uri=#{request.original_url} ", 角色: "menuitem", tabindex: "-1", target: "_blank"}
You can customize the page title, description, previewed photo by addting them to the URL_TO_SHARE meta tags.您可以通过将它们添加到 URL_TO_SHARE 元标记来自定义页面标题、描述、预览照片。 Check Open Graph Object Meta Tags for more details.查看Open Graph Object Meta Tags了解更多详细信息。
%meta{:content => "1234567890", :property => "fb:app_id"}/
%meta{:content => "http://samples.ogp.me/136756249803614", :property => "og:url"}/
%meta{:content => "Chocolate Pecan Pie", :property => "og:title"}/
%meta{:content => "https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xpa1/t39.2178-6/851565_496755187057665_544240989_n.jpg", :property => "og:image"}/
%a{:href => " http://www.linkedin.com/shareArticle?mini=true&url=# {URL_TO_SHARE}&title=#{TILTE}&summary=#{SUMMARY}&source=www.YOUR_DOMAIN.com", role: "menuitem", tabindex: "-1", target: "_blank"} %a{:href => " http://www.linkedin.com/shareArticle?mini=true&url=# {URL_TO_SHARE}&title=#{TILTE}&summary=#{SUMMARY}&source=www.YOUR_DOMAIN.com", 角色:“菜单项”,tabindex:“-1”,目标:“_blank”}
Twitter: Official Twitter Share Documentation Twitter: 官方 Twitter 共享文档
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
Facebook: Official Facebook Dialog Documentation / Official Facebook Sharer Documentation Facebook: 官方 Facebook 对话文档/官方 Facebook 共享器文档
If you have an API key...如果您有 API 密钥...
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
And if you don't...如果你不...
https://www.facebook.com/sharer.php?u={url}
LinkedIn: Official LinkedIn Share Documentation LinkedIn:官方 LinkedIn 共享文档
https://www.linkedin.com/sharing/share-offsite/?url={url}
Google+: Official Google+ Share Documentation Google+: 官方 Google+ 共享文档
N/A : Service disabled.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.