I am looking to use Google Link shortener with Wordpress. I want to use shorter links to help users post more in social media, bitly is far to expensive. Google gives a massive allowance, which want to use. API key is available but need to implement using php prior Wordpress rendering the page.
Current Code
<a rel="nofollow" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post on Facebook">
<img src="<?php echo get_template_directory_uri(); ?>/images/facebook.png" border="0" alt="Facebook"/>
</a>
<a rel="nofollow" href="http://twitter.com/home?status=<?php echo urlencode("Currently reading: "); ?><?php the_permalink(); ?>" title="Share this article with your Twitter followers">
<img src="<?php echo get_template_directory_uri(); ?>/images//twitter.png" border="0" alt="Twitter"/>
</a>
<a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" title="Share this on Google+">
<img src="<?php echo get_template_directory_uri(); ?>/images/google_plusone_share.png" border="0" alt="Google+"/>
</a>
To summarise I need a example of how to enforce Google link shortener API while using the in built functions such as:
the_permalink();
Many thanks.
</div>