Vote API

From Progressive Bloggers Library

Increase the votes your posts get by adding a link on your site that will automatically allow your readers to vote for your post simply by clicking. No longer do you need to hope your readers browse over to Progressive Bloggers for your posts to get exposure. Instead, you can have a post footer that looks like this:

posted by progressive_blogger at 7:22 PM | 26 comments | recommend this post

Contents

Basics

To allow your readers to vote for your post directly from your site, simply create a link that points here:

http://www.progressivebloggers.ca/vote/[put post permalink here]

For example, if you have a post located at http://www.domain.com/archives/0001.html then a link to...

http://www.progressivebloggers.ca/vote/http://www.domain.com/archives/0001.html

...would cast a vote for your post.

Simple Link

Adding this link next to the Comments link or other suitable location on your site's template will allow users to vote for your post on Progressive Bloggers without having to leave your site.

If you are using Blogger (the 'new' version of it that Google has switched everyone over to as of 2007), you need to add the following line:

<a class='comment-link' expr:href='"http://www.progressivebloggers.ca/vote/" + data:post.url'>Recommend this Post</a>


To add this code to your template in the NEW blogger, you need to:

1. Open your blogger template.

2. On the Edit HTML tab, click Expand Widget Templates

3. Find this code's line:

<data:post.body/>

You can then add the above url just before the </p> tag. This puts the link at the end of your post.

UPDATE: March 25/09: Blogger's '07 template does not have the </p> tag anymore. Instead of looking for the </p> you'll be looking for the first

</div>

Insert the API code right before that and you should be good to go.


If you are using WordPress, update your main template and add this code:

<a href="http://www.progressivebloggers.ca/vote/<?php the_permalink(); ?>">Recommend this Post</a>

Image:VoteAPI.png

Javascript Widget

If you would prefer your users not leave your siate at all (the simple link directs users to the Progressive Bloggers site briefly), you can use our Javascript voting widget.

<iframe src="http://www.progressivebloggers.ca/tools/vote_widget.php?permalink=[PERMALINK]"
        width="140"
        height="15"
        marginwidth="0"
        marginheight="0"
        frameborder="0" 
        scrolling="no"></iframe>

Replace [PERMALINK] with the appropriate template tag to output the post's permalink. For Blogger, this is <$BlogItemPermalinkUrl$>. For WordPress this is <?php the_permalink(); ?>

Using this code, users will see a small graphic button that they can click to recommend your post. When they click this button the vote is cast "behind the scenes" and the user never leaves your site at all or loses his/her place.

Note however, that this requires the user to load the widget directly from our site, which may slow page load times down a little bit.

Image:JavascriptVoteAPI.png

UPDATE: March 25/09 - Some folks, primarily with the '07 Blogger theme/template, has informed us that the above Javascript code does not work with Blogger. For those blogs with that problem, please try the following code for the Javascript button if the above code will not work:

<iframe alt='recommend this post' expr:src='"http://www.progressivebloggers.ca/tools/vote_widget.php?permalink=" + data:post.url' frameborder='0' height='15' marginheight='0' marginwidth='0' scrolling='no' width='140'/>

Feed Burner and Other Technical Issues

If you are using a FeedBurner feed on Progressive Bloggers, this system will not work. That is because the permalink provided by FeedBurner will not match the the permalink on your website. To resolve this, contact us about switching your feed from your FeedBurner feed to your Atom or RSS feed.

Abuse

Please do not abuse this feature by using bots or other automated methods of ballot stuffing. Users must physically click on the voting link by their own volition. Any blogs found abusing this feature will be removed from Progressive Bloggers.