Custom URL for LINK for Facebook and G +

I don’t know if this question welcomes SO or not, but I am very starting to program. I share links from my page on facebook and google + with the following technique.

http://www.facebook.com/sharer.php?u=txtUrl.txt&t=txtTitle.text https://plusone.google.com/_/+1/confirm?hl=en&url=txtUrl.txt 

But in this way I open a new window where users get an additional share button. But I want users to share the link directly with the title, which is respectively taken from the current URL and the title tag.
This is only possible if I use their API or not!

+4
source share
1 answer

The only official way to share with Google+ is + 1 button . Users can add a comment when they share, but the title is automatically pulled from the <title/> attribute on HTML pages.

Facebook has a button that works just like a +1 button. Users will have the opportunity to add a comment to this, but the link title will be automatically pulled out of the HTML page.

Facebook also supports the post method through its API. You can create sharing with one click, but users will have to authenticate and allow access to your application. The title will still be automatically populated from the page.

+3
source

Source: https://habr.com/ru/post/1399045/


All Articles