PinkBananaMedia.com

Reach the Gay & Lesbian Community
Leverage the Power of Social Relationships
Offices in New York and Los Angeles

Integrating Blog Content on your Website from an RSS Feed

Use DHTML or XML to integrate your blog, as well as photos and video on your website
By Matt Skallerud

One of the top questions I receive, after “should I do a blog” is “how do I best integrate the blog into my website?”  This report is intended to fully answer that question.

Managing content properly on a website has been a challenge since the first websites came online in the mid-90s.  Originally, if you wanted your website’s content updated or changed, you sent the changes to your web designer and waited until he or she was able to make the changes manually, in HTML format, for you.  Then, along came content management systems, some expensive and customized and some simpler and off-the shelf.  With content management, an administrator could set it up so that select writers could submit fully formatted articles online.  The article information, along with photos, would be saved in a database format (MySQL, MS Access, etc.) and programmed to display on the web site, without the writer having to know any HTML.  In addition, the writer could submit the article remotely from anywhere in the world where there was an Internet connection.

With content management came very in-depth content and community sites, sometimes with thousands of articles in the website’s database, categorized by theme, by region or some other means that best matched the website’s needs.  The articles were searchable, indexable and made large websites much easier to manage.

Fast forward to 2008… with the advent of blogs a few years back, there is no shortage of writers using off-the-shelf software supplied by companies such as WordPress (www.typepad.com) and Google (www.blogger.com) to get their words out far and wide!  Setting up a free account, anyone can begin blogging, and today we have thousands of bloggers out there, with some blogs receiving more monthly traffic than any other websites in their category (in the GLBT community, TowleRoad.com and OhLaLaMag.com are two of the top blogs online).

It is this blog software that is content management system of choice, working more efficiently than any other form of content management found today.  Setting up a blog, whether it’s the centerpiece of your website’s content or simply the more interactive and fun side of your website’s content, is incredibly easy to do.  Once set up, either one or multiple authors can contribute articles and keep this content fresh and up-to-date daily or weekly, depending on your website’s needs.

The attractiveness of using a blog for content management goes way beyond its ease of use and the ubiquity of its experienced user base of writers.  Blogs are interactive!  They allow your readers to interact and comment on any of the blog postings, and other readers can then interact and comment with each other as well.  Blogs are also very structured in terms of how they store content and thus very easy for search engines to index and include in various search results.  Since the blog will more than likely be pointing back to your company’s main website, the increased search engine exposure should result in increased traffic to your website.

The content of a blog is automatically exported using XML technology, into a format called RSS (Real Simple Syndication).  RSS is what makes blogs so viral, taking the content and putting it automatically into an exportable format that online viewers can subscribe to using an RSS Reader (Google’s RSS Reader is quite popular) as well as integrate on their custom start pages (Yahoo, Google and NetVibes are leaders in this market).  In addition, the RSS feeds can be integrated into a Facebook Group or Profile, a Plaxo.com profile and a FriendFeed.com profile, just to name a few.  From these integrations, the blog’s information is allowed to spread far and wide, allowing online viewers to stay up to date on your website’s content in their viewing method of choice.

Lastly, blogs have tags, allowing the writer posting a blog to include a set of key words that best match the blog’s content in the form of a comma-delimited tag unique for each blog posting.  Tags are also structured content and help increase search engine placement as well, serving as “key word metatags” that search engines have often used in the past when indexing your own website.

So how does this blog integrate quickly and easily into your current website, either as a separate blog or as the central part of your website’s content?  There are many ways of doing this, and each one has its pros and cons, depending on your unique website needs.

Frames:  this is probably the easiest way to integrate one website into another.  Using framing technology, as well as iFrames, a blog can be integrated into your website in the most straightforward means possible.  The downside to this is that the entire blog structure becomes part of your site, so if the blog has one design and your website has another, the two married together does not always look as smooth as it could be.

DHTML: using this more advanced style of HTML code, your programmer can integrate your blog more cleanly into your current website structure.  For more information on various ways to accomplish this, go to: http://www.dynamicdrive.com/dynamicindex18/ .  Using this style, even though the blog is more tightly integrated into your website, the links all go directly to your blog entries.  If you want full control over what the content looks like when a user clicks on a blog link, then an alternative method will need to be used.

XML Programming:  Although this style of integration will require you to work with a website programmer who is a bit more advanced than the rest, it is well worth your time to explore this option if the blog is to become tightly integrated and a fully functioning piece of your website’s content.  Using the RSS feed, a programmer is able to pull in the blog’s content and work with it in much the same way that he or she would have done using an older content management system.

The example shown below is done in Cold Fusion, but described in detail in such a way that a programmer proficient in PHP or ASP coding should be able to adapt it to your needs.

The RSS feed’s XML structure appears as follows.
RSS Feed XML Sample

<?xml version="1.0" encoding="UTF-8"?>
<rss version="0.92">
<channel>
    <title>Gay Gadget</title>
    <link>http://www.gaygadget.com</link>
    <description>Gadgets for Gays</description>
    <lastBuildDate>Tue, 25 Nov 2008 12:37:34 +0000</lastBuildDate>
    <docs>http://backend.userland.com/rss092</docs>
    <language>en</language>   

    <item>
        <title>High Def and Portable - the new Flip MinoHD</title>
        <description>We've been enjoying the Flip Mino for quite some
        time, which is why we're excited about the company's latest
        release.
        The new MinoHD does exactly what its name implies, recording
        720p footage—up to 60 minutes worth—on a 4GB flash drive.
        They're touting it as the world's smallest HD video camera.
        It's ...
        </description>
        <category>gay technology</category>
        <media:thumbnail>
            http://www.gaygadget.com/thumbs/thumb123.jpg
        </media:thumbnail>
        <link>http://www.gaygadget.com/2008/11/</link>
    </item>  
</channel>
</rss>

You can see that all elements of the blog entry are available in a structured format, including the thumbnail photo and the blog’s tags (seen as categories in this example).

RSS feeds come in two primary formats, ATOM and RSS (and a 3rd, called RDF, which is less used).  The first example shown below is for an ATOM feed in Cold Fusion, and the 2nd one, without comments, is for an RSS feed. 

They are both basically the same and simply two different XML language formats.

Example 1: Reading and Displaying an Atom Feed from a Google Blog

<cfhttp url="http://www.yourblog.com/rssfeed/" method="get">
(This line of code grabs the content from the blog’s RSS feed)

<cfset objRSS = xmlParse(cfhttp.filecontent)>
(This line of code turns the structured content and turns it into a query, just as if the content had originated in a database using a content management system)

<cfset Item_Length = arraylen(objRSS.feed.entry)>
(This line of code determines how many blog entries are available for use)

<cfloop index="index" from="1" to="#length#">
(This line of code loops through each blog entry, one by one)

    <cfif structKeyExists(objRSS["feed"]["entry"][index],"media:thumbnail")>
    <cfset MediaThumb = objRSS["feed"]["entry"][index]["media:thumbnail"].xmlattributes.url>
    </cfif>
    (This line of code checks for the existence of a thumbnail image)

<cfoutput>
<cfif isDefined("mediathumb")><img src="#mediathumb#" align="right" hspace="5" vspace="1" border="0" width="72">
/cfif>
(This line of code displays the thumbnail image, if present)

#objRSS.feed.entry[index].title.xmltext#
(This line of code is the blog title text)

#objRSS.feed.entry[index].content.xmltext#
(This line of code is the blog’s content – in some RSS feeds, the content is not available and only a link to the blog is… in those cases, only part of the blog is able to be integrated into your website.  Google’s blog software does make the content fully available.)

</cfoutput>
</cfloop>

Example 2: Reading and Displaying an RSS Feed from a Google Blog

<cfset Item_Length = arraylen(objRSS.rss.channel.item)>
<cfloop index="index" from="1" to="#length#">
cfif structKeyExists(objRSS["rss"]["channel"]["item"][index],"media:thumbnail")>
<cfset MediaThumb = objRSS["rss"]["channel"]["item"][index]["media:thumbnail"].xmlattributes.url>
</cfif>
<cfoutput>
<cfif isDefined("mediathumb")><img src="#mediathumb#" align="right" hspace="5" vspace="1" border="0" width="72"></cfif>
#objRSS.rss.channel.item[index].title.xmltext#
#objRSS.rss.channel.item[index].description.xmltext#....
</cfoutput>
</cfloop>

The other elements of the blog, including the tags, the link to the blog, as well as direct links to any blog comments, are all found in the RSS feed, as displayed in the RSS Feed XML Sample shown above.

Once mastered, your blog is now fully integrated into your website.  You can format it exactly the same as any other content found on your site, as well as place your menu, your ads and any other website elements anywhere around these blog entries.

It is this same technology that would allow you to pull YouTube videos of your choice into your website, as well as Flickr and Picasa photos, Delicious and StumbleUpon bookmarks and Digg.com stories you’ve found of interest.  All of these sites and others output your unique content (photos, videos, etc.) in an XML feed which is easily integrated into your website to best meet your company’s needs.

In addition, this technology can be used to pull relevant content for use in your website from other blog content sources.  You can do a search in BlogCatalog.com, MyBlogLog.com, Technorati.com or Google’s Blog Search program and have an automatic RSS feed generated for that search that can be fully integrated into your website. An example of all of this in action has been put together and is found at http://newmedia.pinkbananaworld.com.

Lastly, it is this technology that would also allow you to pull in your online member’s blog entries, photos, videos and more and both integrate into the member’s profile on your website, as well as allow you to feature select User-Generated Content that your online viewers will love.

In summary, blogs as content and blog software used as content management software for your website have become the preferred method of many companies seeking to both simplify their use of technology and make the adding and updating of content as efficient as possible.  Adding to that the unique search engine placement that blogs command, as well as the interactive capabilities blogs bring to any website’s content layout, and one can easily see why integrating a blog directly into your company’s website could give you a unique advantage in your website’s success online.






Gay and Lesbian Social Networking
Advertising - Marketing - Community

For the full-color PDF version of this story, go here:
http://www.PinkBananaMedia.com/pdf/GMG2009_RSS_Prog.pdf

To subscribe to the PBM Monthly Gay Business Report, go here:
http://www.PinkBananaMedia.com/BusinessReport/

For the annual PBM Gay Market Report, go here:
http://www.PinkBananaMedia.com/MarketReport/


NOTE: This article is part of the Gay Market Report 2009 and is FREE TO USE as long as byline above, credit, logo and link are included with story. Credit Pink Banana Media, www.PinkBananaMedia.com/MarketReport/, and please use the following logo linked below:
http://www.pinkbananamedia.com/images/pbmlogo_200.jpg

WEB LINK » PinkBananaMedia.com

Pink Banana Media 2008 - All Rights Reserved
Share |

Return to Article List