draugiem.lv Fans iframe Widget

Positive changes have touched not only the visual appearance of draugiem.lv, but a step has finally been taken in the direction of socialisation - a draugiem.lv page follower (fan) widget has been created. It must be said, previously it was also possible to load page followers in JSON format using JavaScript, but that stopped working with the launch of the new design. And as is customary in the best of manners - without prior notice and without offering an alternative. And here I discovered that draugiem finally has a fan widget that can very conveniently be integrated into any page using iframe.

Positive changes have touched not only the visual appearance of draugiem.lv, but a step has finally been taken in the direction of socialisation - a draugiem.lv page follower (fan) widget has been created. It must be said, previously it was also possible, using JavaScript, to load page followers in JSON format, but that stopped working with the launch of the new design. For some reason, links to profile images were no longer working. And as is customary in the best of manners - without prior notice and without offering an alternative. At least I couldn't find anything on the web, and I never got a reply from draugiem.lv.

The old way worked like this:

<script type="text/javascript" src="http://www.draugiem.lv/iinuu/js/fans/?count=9"></script>

D = {
  w:function(par){

    // par = "fans":[{"name":"x1","url":"/user/12345/"}

  }
}

For some time now, a WordPress plugin created by Rolands Umbrovskis [1] has been available to all interested parties. Credit where credit is due - the plugin was quickly adapted to the new changes, as announced on the social web - Twitter.

Since WordPress wasn't suitable for my purposes, I took a look at the plugin's code ;) And that is where I discovered that draugiem finally has a fan widget that can very conveniently be integrated into any page using iframe.

This is not the official documentation!

Two options:

1. JavaScript

<div id="fans"></div>

<script type="text/javascript" src="http://www.draugiem.lv/api/api.js"></script>

<script type="text/javascript">

var fans = new DApi.BizFans( {

    name: '{page-name}',
    count: {number},
    showFans: 1,
    count=12

} );

fans.append( 'fans' );

</script>

2. iframe

<iframe src="http://www.draugiem.lv/business/ext/fans/?name={page_name}&showFans=1&count=12"
        scrolling="no"
        frameborder="0"
        style="border:none; overflow:hidden; width:203px; height:357px;">
</iframe>

{page_name} and {number} should be replaced with the appropriate text and numeric values.

The result can be seen right here - on the left side.

[1] http://umbrovskis.com/
[2] http://wordpress.org/extend/plugins/draugiemlvlapas-fan-page/

 

Share:
Rate: 4 (10)

comments

anlita

07407348029



What are others reading?