SE Trick – Modify RSS Feed URL using jQuery

This is a simple tutorial (to the original question) on how you can replace your existing StackExchange questions feed link with a third-party feed tracker service such as FeedBurner.

By default, your questions feed should look something like: http://{SITE_NAME}/feeds where you will also have answers feed: http://{SITE_NAME}/feeds/question/{QUESTION_ID}, user feed: http://{SITE_NAME}/feeds/user/{USER_ID} and tags feed: http://{SITE_NAME}/feeds/tag?tagnames={TAG_SLUG}&sort={SORT_VERB}.

Using simple jQuery, you can replace existing questions feed link to specified URL without effecting other feed links:

$(document).ready(function()
{
    if($("#feed-link-text a").text() == "recent questions feed")
    {
        $("#feed-link-text a").attr("href", "{NEW_FEED_URL}");
    }
});

Done!

List of Customised StackExchange Sites

Ever since StackExchange went public beta in September 2009, there has been a growing number of sites running on StackExchage platform with a touh of creativity. If you still not sure what the StackExchange is, take a walk through StackOverflow, ask a question and you will be amazed by its awesomeness.

Now you know what a StackExchange site looks like, here is a show case on some of the StackExchange sites using very creative elements.

Epic Advice – Q&A for World of Warcraft

http://epicadvice.com/

  • Custom icon next to tags
  • Present reputation as experience bar
  • Allow customised user field and display corresponding icons
  • Able to embed YouTube videos

doctype – Q&A for Web Design and Development

http://doctype.com/

  • Community theme
  • Display web page screenshots next to the question
  • Customised avatar display

petnibs.com – Q&A for pet related

http://petnibs.com/

  • “ask a question” box on homepage
  • Customised page header

Travel Gurus – Q&A for Traveling

http://www.travel-gurus.com/

  • Image background
  • High contrast theme

PhoneHow – Q&A for SmartyPhone

http://phonehow.com/

  • Customised question metadata layout
  • Customised header

Lastly, a StackExchange site that uses few tricks that may worth mentioning…

ZergOverflow – Q&A for StarCraft

http://zergoverflow.com/

  • Customised icon in front of tags bar
  • Image background
  • Able to embed YouTube videos

Like me to mention your StackExchange site? leave your details in comment as I will may a batch 2 sometime.

SE Track – Customise Tag List with CSS

While hacking away my StackExchange site: Zerg Overflow, I use couple of tricks that one can use to customise their website design without modifying existing HTML structure. I will start a series of CSS/jQuery tricks that uses StackExchange platform as example but yet can be utilise in any other way.

In StackExchange sites, tags for questions are listed in horizontally and depends on the contents of tags, I want to place a customised icon in front of the tag list. This can be done with a simple CSS. First, let’s understand the HTML semantics here in StackExchange.

tags_icon_2009-12-03In element <div> you will find tag name appears as class name with a t- prefix. For example:


Use CSS to create a space in front of the tags bar (by using padding) and add a background image like this:

.t-canada {
    padding: 0 0 0 [IMAGE WIDTH]px;
    background: url(http://[URL]/canada_flag.gif) no-repeat 0 50% transparent;
}

There! You have an ‘canada’ related icon appear in front of the tags bar when ‘canada’ tag is mentioned.

This will only show 1 image per question and that’s its feature. If multiple tags are triggered to show icon, then the later one in CSS will be shown. So sort your tags priority if needed.

Short come

This is sort of semi-automatic, you will have to update/add CSS whenever you have new tag you want to trigger.

Something to watch out for

In ‘Unanswered’ page, the tags bar is fixed width of 410px. Adding paddings may cause your tags bar move to undesired position (below user-info box rather the next to it). This can be resolved by modify tags bar width:

.excerpt .t-canada {
    width: [410 - PADDING WIDTH]px !important;
}

Potential Problem

If your tags ever have more than 1 line, the position of your image may seems weird as it will sit in the left middle of 2 lines. I’m not taking this into account as having maximum of 5 tags to go over 410px is kind of hard with default font-size and margin.

However if it bothers you, you can change the backgroup position to appear on top left corner instead:

.t-canada {
    padding: 0 0 0 [IMAGE WIDTH]px;
    background: url(http://[URL]/canada_flag.gif) no-repeat 0 0 transparent;
}

Alternative Solution

If you want icon to appear inside individual tag instead of beginning of tags bar, then you will need to use some javascript trick to make it happen. OR maybe in the coming beta(s), we can have tag name in <a> element like this:


Note: pt- prefix stands for post tag.

Feel free to leave your feedback on StackExchange Meta or commenting on this post.

A weekend of StackExchange

stackexchangelogoIf you are a programmer and always has plenty of questions about zero and ones, then you must have been to Stack Overflow sometime in your life. In September, the power behind Stack Overflow: the StackExchange has gone beta and made available for anyone to try out.

Stack Overflow (or StackExchange rather) is a knowledge exchange platform with a brilliant design to encourage quality answers and fast response for your audience.

It’s public beta appearance attracted over 100 StackExchange sites within 2 months and some of the sites are already gain quite a bit of reputations:

  • Moms4Mom – Moms and dads to ask questions about parenthood.
  • Photo QnA – Ask questions about photography related
  • Draw3Cards – Questions about Magic: The Gathering

With all the hype and its easiness, I decide to join the hype. Over the weekend I setup my own knowledge exchange platform: ZergOverflow, Q&As for Starcraft related questions (since I am such a Starcraft fan boy). The sign up to completion took no longer than 1 afternoon:

Currently, StackExchange is in beta 5 and there are still rough edges all over the place. But that wouldn’t be a bad thing as it is free during beta and every site owners are enjoying the benefits. Once the beta is over, the running cost will be US$129+ a month… that will become an expensive hobby for anyone.

I had a lot of fun: learning and making new friends. The learning curve is fairly low and I recommend website enthusiasts should give it a shot while it’s beta.