Saturday, January 12, 2013

Using popular share links

Nowadays almost every application needs connection with some kind of social network. The most common task is to publish something on the user's wall. So today I will show how easy you can share your content with Facebook, Twitter, Google+, Tumblr and VK users.

First let's discuss Twitter and Tumblr. To share something on Twitter from your site all you need is just to add link in the following format:
<a href=" - Ideas, solutions and tips for Java developer" target="_blank">Twitter</a>
For Tumblr:
<a href=" - ideas, solutions and tips for Java developer" target="_blank">Tumblr</a>     
Now let's make it for Facebook. But it won't be that straightforward as with previous ones. Facebook uses Open Graph and we need to provide the link with our page that has right ol meta tags. Here are the meta tags that you'll need:
<meta property="og:url" content=""/>
<meta property="og:title" content="Java Dev Tips - ideas, solutions and tips"/>
<meta property="og:image" content=""/>
<meta property="og:site_name" content="Java Dev Tips"/>
<meta property="og:description" content="Java Dev Tips - ideas, solutions and tips for Java developer"/>
And we are ready to put the link:
<a href="" target="_blank">FB</a>
The same OG meta tags will work for Google+, so here is it's link:
<a href="" target="_blank">Google+</a>
As for VK, it will work with OG meta tags if usual meta tags will not be provided:
<meta name="description" content="Java Dev Tips - ideas, solutions and tips for Java developer" />
And VK link:
<a href="" target="_blank">VK</a>

FB | Google+ | VK | Twitter | Tumblr

If you cannot share on Facebook or your shared content is outdated try this solution.

Facebook caches your page and so your updates are not refreshed on FB. You should use Open Graph Debugger to fix it:
  1. Go to
  2. Enter your URL that has the issue
  3. Press Debug button

OG Debugger also provides information how your URL will be parsed by Open Graph engine. 

Read how to share on different social networks