Praveen Rawat
Praveen Rawat

Reputation: 658

post on Google plus stream with custom Content

I want to know that, is there any way to post our Formatted(Bold and Italic or \n) text as content of Post on User stream (using google plus Api).

I have tried Intractive Posts and share dialog offered by google but they do not support formatted content.

Upvotes: 1

Views: 163

Answers (1)

class
class

Reputation: 8681

As best I know, you cannot control whether the content that Google calculates from your page content will be bold or not. However, in post content, you can * BOLD * and _ ITALICIZE _ using tags similar to markdown. Because you can pre-fill text in interactive posts, you can just pre-fill some bold words for your users suggesting they emphasize content in shares from your site.

Some code:

This goes in your page head tags

<script type="text/javascript">
  (function() {
   var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
   po.src = 'https://apis.google.com/js/client:plusone.js';
   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 })();
</script>

... and this goes in the body

<!-- Place the tag where you want the button to render -->
<span
  class="g-interactivepost"
  data-contenturl="http://wheresgus.com/ipostdemo/gplusbw.png"
  data-contentdeeplinkid="/nothingtoseehere"
  data-clientid="268858962829.apps.googleusercontent.com"
  data-cookiepolicy="single_host_origin"
  data-prefilltext="Prefill *bold* and _italic_ content."
  data-calltoactionlabel="JOIN"
  data-calltoactionurl="https://plus.google.com/+GusClass"
  data-calltoactiondeeplinkid="/account/signup">
<img src="gplusbw.png" width=28 height=23>
</span>

Demo here.

Upvotes: 2

Related Questions