BlogEngine.Net SocialPublish (twitter) extension

While working on  project with BlogEngine.Net, there is a  feature I am working that I want to share it as an free extension.

The problem:

When I publish a blog on, I want to publish it as a tweet with shorten URL, and make a post to facebook wall.

There are probably are a couple BlogEngine.Net extensions that does tweet and facebook post (not yet ready), however the way I want it done is to have a customized template and URL shortening which Twitter API doesn’t do it automatically as of now!!    If this is something you are looking for, then SocialPublish is probably good for you.

Here are the general steps:

1. Download the extension, and extract the files to the proper folders.

2. Go to and create an twitter application.  First, set your application access Level to be Read and Write and get your Access Token.  You will need the consumer key, consumer secret, access_token, and access_token secret later.

3.  This is optional if you want to use shortening service to shorten your blog URL.  Go to and register for an account.  You will need your bitly username and api key later.

4. Start your blog website, and go to Extensions settings.  When you click on the “SocialPublish” extension settings on the right, you can enter the twitter consumer key, secret, access token, access token secret, optionally the bitly username and api key.

5. In the twitter post template, you can modify it the way you like it.   {url} will be turn into a shorten URL of your permanent link, and {title} is the title of your post.

6. Make a blog post and check your twitter 🙂

So how does it work (For the geeks)?

It is very simple, I used very awesome open source like library to call the Twitter API, Hammock’s Restful library and Newtonsoft Json library to call the bitly API.   When inserting a post, SocialPublish will figure out if this is a new post or not.  We only publish the tweet if it is a new post.   Since tweet is 140 characters long, SocialPublish will cut off the tweet, please watch out :).  Also the bitly doesn’t like links, so it won’t get shorten.

What is next?

As of now, SocialPublish only works with twitter, but I will get the facebook integration working soon.  I will post an update when that happens next couple of weeks.  Some of the things  I want to add:

  • Facebook wall post
  • Google+ post (if the API is available)
  • then adding a post, user can control if the want to publish the post or not
  • preview the tweet/facebook post when editing the post
I may think of more later, or leave me a comment if you want specific features.

By Raymond Tsang

Tagged with: , , ,
Posted in .NET, C# Programming, Technical
6 comments on “BlogEngine.Net SocialPublish (twitter) extension
  1. Thanks for the extension!!! I have it working using both the auto Twitter posting and URL shorting. Right now I only the ‘home’ page via the {url}, not the perm link… Any ideas?

  2. ak_netchat says:

    Excellent work, try to add LinkedIn and Facebook groups as well if possible

  3. Dante says:

    I must be doing somthing wrong. I load everything in and then the site fails. The lib folder gets uploaded to the root…correct?

    Is this compatible with BlogEngine 2.5?
    I have never loaded dll files into my BlogEngine instance for an Extension or Widget before, am I missing loading something?

  4. Hmm…I’ve set it up like you described above, but I’m not getting any post on Twitter when I create a new post. What could be wrong?

  5. Jonnie says:

    1. Download the extension, and extract the files to the proper folders.

    Can you elaborate on this? I’m unsure what to do with the downloaded files.

  6. Nader says:

    The link doesnt seem to be working. it says service unavailable, is there another link?

Leave a Reply