Chinaunix首页 | 论坛 | 博客
  • 博客访问: 574827
  • 博文数量: 207
  • 博客积分: 10128
  • 博客等级: 上将
  • 技术积分: 2440
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-10 21:40
文章分类

全部博文(207)

文章存档

2009年(200)

2008年(7)

我的朋友

分类: 系统运维

2009-04-23 12:28:42

Social media sites have gone mainstream over the past few years, and it's affected web developers everywhere. With the success of sites like , , , and , many developers have turned to adopting some of the practices of social media into their own sites. In fact, it's not that hard to build your own social news portal, with the help of a few key coding techniques and libraries.

Here you'll learn 10 clever coding techniques to help you build killer social media websites for yourself and your clients.

Here are a few "total packages" that you can use to build your own social media site:

  • - A module that converts Drupal into a Digg clone.
  • - A digg clone script, complete with extra modules and themes.
  • - A fully-featured social media content management system.

We're going to dissect the most important features of social news sites, and showcase example code and libraries that can help you on your way to developing your own social media website.

1. Activity Stream

Ever since Facebook introduced activity streams to their user profiles, the concept has gone mainstream. It turns out that people are fascinated by their friend's activities. Really fascinated. Knowing every move that friends make, (without technically being a stalker), adds a lot of engagement and another "sticky" factor, keeping visitors at the site longer.

Joomla has a , and Drupal has an module that accomplishes this as well.


Photo by .

2. User Authentication and Profiles

Kind of a no-brainer, right? It turns out that there are many different methods for setting up a user management system, and it all depends on your preference. Would you rather use a pre-existing solution, or create your own? What language do you want to build the site in? How many will your site need? These are a few of many questions that will be asked along the way.

If you'd like a more fine-tuned approach to building your site, you might try a framework like (python) or (PHP) to build out your authentication system. These frameworks have built-in user authentication, and make it easy to develop the site around the user system.

If you're wanting to spend less time on authentication, you might try a content management system like (PHP) to build your site around. Drupal is an excellent CMS to use for building community sites, and has many to help you build out other functionality that you might need on your social site. Other content management systems like and can also work well for building social sites.


Photo by .

3. Invite a friend

At the heart of every social media site is the desire to become "viral". One of the best ways to go viral is to have an "invite your friend" script that furrows into your user's email address book and does at least one of two things:

  1. It helps you find and link your contacts who are also members of the social media site.
  2. It invites contacts who aren't part of the social media site

Essentially all of the major social media sites like Friendfeed, Digg and Twitter have this feature. Having your users promote your product is the most effective form of advertising, and best of all it's 100% free.


Photo by .

4. Recommendation Engine

Showing recommended and relevant content is an excellent way to increase engagement and activity on the site. Reddit and Digg have excellent examples of recommendation engines, and the Digg blog even gives a snippet as to how big of an impact the addition of their recommendation engine has had on their stats.

- Digging activity is up significantly: the total number of Diggs increased 40% after launch. - Friend activity/friends added is up 24%. - Commenting is up 11% since launch.

With stats like that, it's pretty apparent that a recommendation engine could really help your social site. Many of these content recommendation engines are built on the . Drupal has a , which is also based on the Slope One Algorithm.

If you can create a great recommendation engine for your site, you'll have higher engagement and more clicks.


Photo by .

5. Private Messaging

Private messaging is another solid feature that a social media site should have. Any way you can increase communication amongst your site's users, the better. Private messaging is a great way to keep your users coming back to the site. It's not as intrusive as email (unless you enable email notifications), and it isn't in real-time like IM. It's a simple layer of functionality that makes communicating across your site easier.

The great part about the private messaging feature is that it's already built-in to many CMS scripts. However, many sites don't even turn on this feature. Take advantage of this (mostly) pre-built functionality and keep your visitors happy and chatting with each other.


Photo by .

6. Status Updates

Twitter has made the status update another mainstream aspect of social media sites. Letting the world know what you're doing at an exact moment a popular way to add engagement to a site. As most Twitter users will vouch, it's incredibly addicting.

What's even better for the developer is that it's probably quite easy to implement on your system. Status updates (or microblogging) is only a matter of having a limited content type (Twitter limits to 140 characters), and adding comments to it. Facebook's implementation of status updates allows friends to tack comments onto the statuses.

is an open source platform for microblogging, and it powers sites like . If you're using a content management system like Drupal or Joomla, it's quite easy to make a content type that has a limited number of characters and allows commenting.


Photo by .

7. Multiple Ways of Viewing the Data

In order to increase engagement and clicks on the site, social media sites like Digg allow you to view data in many different ways. For example, on the Digg site you can view:

  • New upcoming stories
  • Popular upcoming stories
  • Popular stories in the last 24 hours
  • Popular stories in the last 7 days
  • Popular stories in the last 30 days
  • Popular stories in the last year

... and many more.

Adding useful navigation that highlights different ways of viewing data like stories and statuses is a superb way to increase the clicks on your social media site. Everyone has different preferences, and allowing people the flexibility to tailor their experience viewing your site is a big incentive to keep them coming back.


Photo by .

8. An API

This is probably the hardest aspect of an advanced social news site. Opening up your site with a public API for developers is a stellar way to increase awareness of your product. Now you've got hundreds (maybe thousands!) of different developers creating websites and software that allow to more easily find your site and data. Instead of having to fulfill every request for new features, an API allows anyone to mashup your data and display it however they want.

The only problem with an API is that it takes lots of work by the developer. Aside from the extra programming, there's documentation, support requests and all sorts of issues that surround having an API. And there's no really good way to provide a true API without advanced programming. However, there is a new service that just launched today called that allows you to quickly and easily create an API for your web service.


Photo by .

9. Voting

At the heart of most social media sites is the ability to vote on content. On sites like Digg and Reddit, your vote determines whether or not the story will be made "popular" and shown on the homepage, or it can prevent the story from being seen by many people. Aside from the psychological aspect of being in control, voting provides lots of engagement factors to the site. If you're going to vote on one story, odds are you'll vote on many more. Click, click, click.

There are many great libraries for adding voting to sites for any different platform or language. Drupal has the robust which allows you to hook voting into many other Drupal modules. Joomla has over . A simple search on Google will reveal tons of PHP, ASP and Perl open source scripts for integrating voting into your site.


Photo by .

10. Widgets

What would a social media site be without a widget? Digg derives a hefty chunk of their traffic from voting widgets that people place on their site, in hopes of being submitted or to increase their vote count. Twitter, Friendfeed and Delicious allow you to put JavaScript or Flash widgets that show your latest interactions across these sites. By adding a widget to your social site's offering, you're increasing it's viral factor.

The beauty of most widgets is that they usually derive from a simple piece of JavaScript (or Flash), and could be made using RSS feeds or API calls. Sites like allow anyone to quickly and easily create a widget, if you're needing inspiration.

The widget is at the core of viral distribution of content in a social media site. Showcasing your best content or user content on blogs across the Internet helps bring traffic and interest from every corner of the Net.


Photo by .

  • Subscribe to the for more daily web development tutorials and articles.

Glen Stansberry is a web developer and blogger who's struggled more times than he'd wish to admit with CSS. You can read more tips on web development at his blog Web Jackalope.

阅读(1066) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~