Syndicated Blog Post Signatures in Community Server

Another day, another Community Server add-on!

A member in the Community Server forums needs a way to add a statement to every blog post that is syndicated in order to prevent scrapers from "using" their content with no mention of the rightful owner. This seems like a real good idea for anyone, including me, who syndicates their content. Jose Lema came through with the basic idea of how to handle this situation so I figured I would run with it.

The code, as Jose provided, is real simple however I wanted to make it easy to change the "RSS Signature." I figured we could store the signature text in an ExtendedAttribute rather than a config file so here is what I have:

public void Init(CSApplication csa, XmlNode node)
{
  csa.PreRenderPost += new CSPostEventHandler(csa_PreRenderPost);
}

void csa_PreRenderPost(IContent content, CSPostEventArgs e)
{
  WeblogPost post = content as WeblogPost;
  if (post == null)
    return;
  if (e.ApplicationType == ApplicationType.Weblog && e.Target == PostTarget.Syndication)
  {
    string sig = post.Section.GetExtendedAttribute("BlogRssSignature");
    if (String.IsNullOrEmpty(sig))
      return;
    post.FormattedBody = String.Concat(post.FormattedBody, sig);
  }
}

Now for the Control Panel Administration of the signature. I do not like modifying the core code for Community Server; it makes it a pain to handle updates. So what I did was create a new page to handle the setting of the extended attribute, with the codebehind residing in my CarKnee Bundle. The result is a simple page to create/edit the signature text used for your blog. I should also mention that I dislike having to edit language xml files for basic text. Again, this is just a pain for installing quick modules, but if you are using any language other than English you will have to manually edit the aspx file.

Create your signature:

And here it is:

To install this, download the CarKnee Bundle and follow the instructions in the readme.txt file.

Published Wednesday, January 31, 2007 10:17 AM

Comments

# CS Byte for February 2, 2007

Friday, February 02, 2007 12:04 AM by Dave Burke

blog bits The "Big Fajitas" Report (Part 2.) Jose Lema keeps his promise of releasing his new Member

# This Week's News for February 2, 2007

Friday, February 02, 2007 10:36 AM by Announcements

This week... Ben Tiedt introduces us to Chameleon Utility Controls. "Chameleon includes a set of

# An RSS Signature CSModule

Friday, February 02, 2007 10:41 AM by Daily News List Blog

Sean Kearney (CarKnee), my new Community Server Rising Star Designate, adds another goodie to his CarKnee

# This Week's News for February 2, 2007

Friday, February 02, 2007 10:57 AM by Community Server

This week... Ben Tiedt introduces us to Chameleon Utility Controls. "Chameleon includes a set of

# re: Syndicated Blog Post Signatures in Community Server

Friday, February 02, 2007 11:13 AM by Kingsley Tagbo

Does this go back and retro-fit all your blog posts with the signature or is it only for newly added blog posts?

# re: Syndicated Blog Post Signatures in Community Server

Friday, February 02, 2007 11:50 AM by Sean Kearney

Kingsley,

This module will append the text to the Rss/Atom feeds for EVERY blog post you have made. It will not alter the text in the database so you can disable this module and your blog post will go back to normal.

# re: Syndicated Blog Post Signatures in Community Server

Friday, February 02, 2007 2:15 PM by Richard Dudley

Friggin awesome!  Since I was the one who asked the question and hadn't gotten around to working through Jose's answer, I'm thrilled.  Thank you!

# re: Syndicated Blog Post Signatures in Community Server

Friday, February 02, 2007 6:23 PM by Ryan Farley

Awesome stuff, thanks for sharing.

BTW, I don't suppose there is any way to append the sig to the posts in the site's main feed as well?

Thanks!

# re: Syndicated Blog Post Signatures in Community Server

Monday, February 05, 2007 10:07 AM by Sean Kearney

Ryan,

The settings are on a "Per Blog" basis. If Blog A has a signature set, it will be displayed in the MainFeed. If Blog B doesn't have a signature set, then there will be no signature to display in the MainFeed.

If you want all of the blogs on your site to have a signature then you will have to modify the settings for each blog. You could also modify the AggregateRssHandler.cs file in the CS core to alter the text of every post that gets aggregated.

-Sean

# An RSS Signature CSModule

Monday, March 12, 2007 12:04 AM by Community Server Bits

Sean Kearney (CarKnee), my new Community Server Rising Star Designate, adds another goodie to his CarKnee

Powered by Community Server (Non-Commercial Edition), by Telligent Systems