<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Jay Harris is Cpt. LoadTest - Blogging</title>
    <link>http://www.cptloadtest.com/</link>
    <description>a .net developers blog on improving user experience of humans and coders</description>
    <language>en-us</language>
    <copyright>Jason Harris</copyright>
    <lastBuildDate>Thu, 01 Oct 2009 02:33:55 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.12105.0</generator>
    <managingEditor>jharris@harrisdesigns.com</managingEditor>
    <webMaster>jharris@harrisdesigns.com</webMaster>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=fa601dad-9032-43a8-ba67-195baa859d88</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,fa601dad-9032-43a8-ba67-195baa859d88.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,fa601dad-9032-43a8-ba67-195baa859d88.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=fa601dad-9032-43a8-ba67-195baa859d88</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you have read my post on <a title="Blog Post: Misconceptions on JavaScript Plugins and SEO" href="http://www.cptloadtest.com/2009/08/31/Misconceptions-On-JavaScript-Plugins-And-SEO.aspx" target="_blank">Misconceptions
on JavaScript Plugins and SEO</a>, you know that search engines don't do JavaScript.
Though these plugins and libraries (such as one for pulling your latest Twitter Updates)
are nice for adding dynamic content for your users, they are just end-user flare and
add nothing to your SEO rankings. They also put an unnecessary tax on your users,
as each client browser is responsible for independently retrieving the external content;
the time for your page to render is extended by a few seconds as the client must first
download the JS library then make the JSON/AJAX request for your content.
</p>
        <p>
In response to this, I have created <a title="dasControls on CodePlex" href="http://dascontrols.codeplex.com/" target="_blank">dasControls</a>,
a library of custom macros for dasBlog (the blogging engine that powers <a href="http://www.cptloadtest.com">www.cptloadtest.com</a>).
I have started with content that is driven by custom JavaScript libraries and convert
the content and data retrieval into server-side controls. For now, dasControls contains
only a Twitter Status macro, but I intend to add more controls in the coming months.
</p>
        <p>
dasControls [Build 1.0.0.0] : <a title="Download dasControls v1.0" href="http://dascontrols.codeplex.com/Release/ProjectReleases.aspx" target="_blank">Download</a> | <a title="dasControls on CodePlex" href="http://dascontrols.codeplex.com/" target="_blank">Project
Page</a></p>
        <h3>dasControls TwitterStatus Macro
</h3>
        <p>
The TwitterStatus macro uses server-side retrieval of your Twitter data, eliminating
all client-side JavaScript calls for your tweets. By placing the Twitter request on
the server, the data is also available to any search engines that index your page.
Additionally, data is cached on the server, and new updates are retrieved based on
the polling interval you specify. When using real-time client-side JavaScript calls,
there is a 2-5 second delay for your end-users while the data is retrieved from Twitter;
by caching the data on the local server, this delay is eliminated, and the content
for each user is delivered from the local cache, lightening the load for the end-user
while avoiding an undue burden for high-traffic sites.
</p>
        <p>
          <strong>Macro Name:</strong> TwitterStatus 
<br /><strong>Macro Syntax:</strong> &lt;% TwitterStatus("user name"[, number
of tweets[, polling interval]])|dasControls %&gt;
</p>
        <ul>
          <li>
            <strong>User Name</strong> : String. Your Twitter handle. 
</li>
          <li>
            <strong>Number of Tweets</strong> : Integer. The number of tweets to retrieve and
display. [default: 10] 
</li>
          <li>
            <strong>Polling Interval </strong>: Integer. The number of minutes between each Twitter
retrieval. [default: 5] 
</li>
        </ul>
        <p>
          <strong>Relevant CSS:</strong>
        </p>
        <ul>
          <li>
            <strong>TwitterStatusItem</strong> : CSS class given to each Tweet, rendered as a
DIV. 
</li>
          <li>
            <strong>TwitterStatusTimestamp</strong> : CSS class given to each Tweet's timestamp
("32 minutes ago"), rendered as an inline SPAN within each Tweet element. 
</li>
        </ul>
        <h4>Using the Macro within a dasBlog Template
</h4>
        <p>
This macro is for use in the dasBlog HomeTemplate. The macro works just like any out-of-the
box macro, except that you must also include the alias specified within dasControls
entry the web.config (the value of the "macro" attribute). Your twitter
handle is required, though you can also optionally include the number of Tweets to
pull from Twitter (default: 10) and the number of minutes between each Twitter data
request (default: 5). Because everything happens on the server, there is no need to
include any of the Twitter JSON JavaScript libraries or HTML markup.
</p>
        <pre>&lt;% TwitterStatus("jayharris", 6, 5)|dasControls %&gt;</pre>
        <h3>Installation and Setup of dasControls
</h3>
        <p>
Download dasControls, extract the assembly into your dasBlog 'bin' directory.
</p>
        <p>
dasControls [Build 1.0.0.0] : <a title="Download dasControls v1.0" href="http://dascontrols.codeplex.com/Release/ProjectReleases.aspx" target="_blank">Download</a> | <a title="dasControls on CodePlex" href="http://dascontrols.codeplex.com/" target="_blank">Project
Page</a></p>
        <p>
Enable Custom Macros within your dasBlog installation, and add the Twitter macro to
your list of Custom Macros. 
<br />
First, ensure that the &lt;newtelligence.DasBlog.Macros&gt; section exists within
your web.config:
</p>
        <pre class="xml:nocontrols" name="code">&lt;newtelligence.DasBlog.Macros&gt;
  &lt;!-- Other Macro Libraries --&gt;
&lt;/newtelligence.DasBlog.Macros&gt;</pre>
        <p>
Second, ensure that the Macros Configuration Section is defined in to your web.config
&lt;configSections&gt;:
</p>
        <pre class="xml:nocontrols" name="code">&lt;configSections&gt;
  &lt;!—Other Configuration Sections --&gt;
  &lt;section requirePermission="false" name="newtelligence.DasBlog.Macros"
    type="newtelligence.DasBlog.Web.Core.MacroSectionHandler,
      newtelligence.DasBlog.Web.Core" /&gt;
&lt;/configSections&gt;</pre>
        <p>
Third, add the dasControls library entry to the dasBlog Macros section:
</p>
        <pre class="xml:nocontrols" name="code">&lt;newtelligence.DasBlog.Macros&gt;
  &lt;add macro="dasControls"
    type="HarrisDesigns.Controls.dasBlogControls.Macros,
      HarrisDesigns.Controls.dasBlogControls"/&gt;
&lt;/newtelligence.DasBlog.Macros&gt;</pre>
        <h4>
        </h4>
        <h3>Roadmap for dasControls
</h3>
        <p>
In the upcoming weeks and months, I plan on adding additional macros to the dasControls
library, including Delicious, Google Reader's Shared Items, and Facebook. If you're
interested in any others, or have any ideas, please let me know.
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:238d54f0-5dde-4a71-b7ed-b73b8f647b47" class="wlWriterEditableSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/dasBlog" rel="tag">dasBlog</a>,<a href="http://technorati.com/tags/dasControls" rel="tag">dasControls</a>,<a href="http://technorati.com/tags/Open+Source" rel="tag">Open
Source</a>,<a href="http://technorati.com/tags/CodePlex" rel="tag">CodePlex</a>,<a href="http://technorati.com/tags/SEO" rel="tag">SEO</a>,<a href="http://technorati.com/tags/Twitter" rel="tag">Twitter</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=fa601dad-9032-43a8-ba67-195baa859d88" />
      </body>
      <title>dasControls v1.0, a Twitter Status Macro for dasBlog</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,fa601dad-9032-43a8-ba67-195baa859d88.aspx</guid>
      <link>http://www.cptloadtest.com/2009/10/01/dasControls-V10-A-Twitter-Status-Macro-For-DasBlog.aspx</link>
      <pubDate>Thu, 01 Oct 2009 02:33:55 GMT</pubDate>
      <description>&lt;p&gt;
If you have read my post on &lt;a title="Blog Post: Misconceptions on JavaScript Plugins and SEO" href="http://www.cptloadtest.com/2009/08/31/Misconceptions-On-JavaScript-Plugins-And-SEO.aspx" target="_blank"&gt;Misconceptions
on JavaScript Plugins and SEO&lt;/a&gt;, you know that search engines don't do JavaScript.
Though these plugins and libraries (such as one for pulling your latest Twitter Updates)
are nice for adding dynamic content for your users, they are just end-user flare and
add nothing to your SEO rankings. They also put an unnecessary tax on your users,
as each client browser is responsible for independently retrieving the external content;
the time for your page to render is extended by a few seconds as the client must first
download the JS library then make the JSON/AJAX request for your content.
&lt;/p&gt;
&lt;p&gt;
In response to this, I have created &lt;a title="dasControls on CodePlex" href="http://dascontrols.codeplex.com/" target="_blank"&gt;dasControls&lt;/a&gt;,
a library of custom macros for dasBlog (the blogging engine that powers &lt;a href="http://www.cptloadtest.com"&gt;www.cptloadtest.com&lt;/a&gt;).
I have started with content that is driven by custom JavaScript libraries and convert
the content and data retrieval into server-side controls. For now, dasControls contains
only a Twitter Status macro, but I intend to add more controls in the coming months.
&lt;/p&gt;
&lt;p&gt;
dasControls [Build 1.0.0.0] : &lt;a title="Download dasControls v1.0" href="http://dascontrols.codeplex.com/Release/ProjectReleases.aspx" target="_blank"&gt;Download&lt;/a&gt; | &lt;a title="dasControls on CodePlex" href="http://dascontrols.codeplex.com/" target="_blank"&gt;Project
Page&lt;/a&gt;
&lt;/p&gt;
&lt;h3&gt;dasControls TwitterStatus Macro
&lt;/h3&gt;
&lt;p&gt;
The TwitterStatus macro uses server-side retrieval of your Twitter data, eliminating
all client-side JavaScript calls for your tweets. By placing the Twitter request on
the server, the data is also available to any search engines that index your page.
Additionally, data is cached on the server, and new updates are retrieved based on
the polling interval you specify. When using real-time client-side JavaScript calls,
there is a 2-5 second delay for your end-users while the data is retrieved from Twitter;
by caching the data on the local server, this delay is eliminated, and the content
for each user is delivered from the local cache, lightening the load for the end-user
while avoiding an undue burden for high-traffic sites.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Macro Name:&lt;/strong&gt; TwitterStatus 
&lt;br /&gt;
&lt;strong&gt;Macro Syntax:&lt;/strong&gt; &amp;lt;% TwitterStatus(&amp;quot;user name&amp;quot;[, number
of tweets[, polling interval]])|dasControls %&amp;gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User Name&lt;/strong&gt; : String. Your Twitter handle. 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of Tweets&lt;/strong&gt; : Integer. The number of tweets to retrieve and
display. [default: 10] 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polling Interval &lt;/strong&gt;: Integer. The number of minutes between each Twitter
retrieval. [default: 5] 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Relevant CSS:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TwitterStatusItem&lt;/strong&gt; : CSS class given to each Tweet, rendered as a
DIV. 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TwitterStatusTimestamp&lt;/strong&gt; : CSS class given to each Tweet's timestamp
(&amp;quot;32 minutes ago&amp;quot;), rendered as an inline SPAN within each Tweet element. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Using the Macro within a dasBlog Template
&lt;/h4&gt;
&lt;p&gt;
This macro is for use in the dasBlog HomeTemplate. The macro works just like any out-of-the
box macro, except that you must also include the alias specified within dasControls
entry the web.config (the value of the &amp;quot;macro&amp;quot; attribute). Your twitter
handle is required, though you can also optionally include the number of Tweets to
pull from Twitter (default: 10) and the number of minutes between each Twitter data
request (default: 5). Because everything happens on the server, there is no need to
include any of the Twitter JSON JavaScript libraries or HTML markup.
&lt;/p&gt;
&lt;pre&gt;&amp;lt;% TwitterStatus(&amp;quot;jayharris&amp;quot;, 6, 5)|dasControls %&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Installation and Setup of dasControls
&lt;/h3&gt;
&lt;p&gt;
Download dasControls, extract the assembly into your dasBlog 'bin' directory.
&lt;/p&gt;
&lt;p&gt;
dasControls [Build 1.0.0.0] : &lt;a title="Download dasControls v1.0" href="http://dascontrols.codeplex.com/Release/ProjectReleases.aspx" target="_blank"&gt;Download&lt;/a&gt; | &lt;a title="dasControls on CodePlex" href="http://dascontrols.codeplex.com/" target="_blank"&gt;Project
Page&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Enable Custom Macros within your dasBlog installation, and add the Twitter macro to
your list of Custom Macros. 
&lt;br /&gt;
First, ensure that the &amp;lt;newtelligence.DasBlog.Macros&amp;gt; section exists within
your web.config:
&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;newtelligence.DasBlog.Macros&amp;gt;
  &amp;lt;!-- Other Macro Libraries --&amp;gt;
&amp;lt;/newtelligence.DasBlog.Macros&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Second, ensure that the Macros Configuration Section is defined in to your web.config
&amp;lt;configSections&amp;gt;:
&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;configSections&amp;gt;
  &amp;lt;!—Other Configuration Sections --&amp;gt;
  &amp;lt;section requirePermission=&amp;quot;false&amp;quot; name=&amp;quot;newtelligence.DasBlog.Macros&amp;quot;
    type=&amp;quot;newtelligence.DasBlog.Web.Core.MacroSectionHandler,
      newtelligence.DasBlog.Web.Core&amp;quot; /&amp;gt;
&amp;lt;/configSections&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Third, add the dasControls library entry to the dasBlog Macros section:
&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;newtelligence.DasBlog.Macros&amp;gt;
  &amp;lt;add macro=&amp;quot;dasControls&amp;quot;
    type=&amp;quot;HarrisDesigns.Controls.dasBlogControls.Macros,
      HarrisDesigns.Controls.dasBlogControls&amp;quot;/&amp;gt;
&amp;lt;/newtelligence.DasBlog.Macros&amp;gt;&lt;/pre&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h3&gt;Roadmap for dasControls
&lt;/h3&gt;
&lt;p&gt;
In the upcoming weeks and months, I plan on adding additional macros to the dasControls
library, including Delicious, Google Reader's Shared Items, and Facebook. If you're
interested in any others, or have any ideas, please let me know.
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:238d54f0-5dde-4a71-b7ed-b73b8f647b47" class="wlWriterEditableSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/dasBlog" rel="tag"&gt;dasBlog&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dasControls" rel="tag"&gt;dasControls&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Open+Source" rel="tag"&gt;Open
Source&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CodePlex" rel="tag"&gt;CodePlex&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SEO" rel="tag"&gt;SEO&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Twitter" rel="tag"&gt;Twitter&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=fa601dad-9032-43a8-ba67-195baa859d88" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,fa601dad-9032-43a8-ba67-195baa859d88.aspx</comments>
      <category>Blogging</category>
      <category>dasControls</category>
      <category>JavaScript</category>
      <category>SEO</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=88fb8162-b06b-4df8-91ef-c2aefe0e1b8f</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,88fb8162-b06b-4df8-91ef-c2aefe0e1b8f.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,88fb8162-b06b-4df8-91ef-c2aefe0e1b8f.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=88fb8162-b06b-4df8-91ef-c2aefe0e1b8f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Search Engine Optimization is high on the radar, right now. Whether it be the quest
for the first Coupon site in Bing, the highest Cosmetics site on Google, or the top-ranked
"Jay Harris" on every search engine, the war is waged daily throughout the
internet. For companies, it's the next sale. For people, it's the next job. Dollars
are on the line in a never-ending battle for supremacy.
</p>
        <p>
One of the contributing factors in your Search Engine Ranking is Content. Fresh, new
content brings more search engine crawls. More crawls contributes to higher rankings.
Search engines like sites that are constantly providing new content; it lets the engine
know that the site is not dead or abandoned. And though this new content idea works
out well for the New York Times and CNN, not everyone has a team of staff writers
who are paid to constantly produce new content. So we shortcut. We don't so much have
to have new content as long as we make Google think we have new content. There are
hundreds if not thousands of JavaScript plugins out there to provide fresh content
to our readers, ranging from Picasa photos, to Twitter updates, to AdWords, to Microsoft
Gamercard tags. But I have to let you in on a little secret:
</p>
        <p>
JavaScript Plugins do nothing for SEO. 
<br />
Nothing. 
<br />
Search engine spiders don't do JavaScript.
</p>
        <p>
"This must be a lie. When I look at my site, I see my new photos, or my new tweets,
or my new Achievement Points; why don't the spiders see it, too?" Well, it's
true. Google Spiders, and most other Search Engine Spiders, <a title="Google Webmaster Guidelines: Search Engine spiders do not execute JavaScript" href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=35769#2" target="_blank">don't
do JavaScript</a>, which is why JS provides no SEO contribution; spiders do not index
what they do not see. A look through your traffic monitor, like Google Analytics,
will often show a disparity between logged traffic and what is actually accounted
for in Web Server logs. Analytics, a JavaScript-based traffic monitor, only logs about
40% of the total traffic to this site (excluding traffic to the RSS feed), which means
that the other 60% of my visitors have JavaScript disabled. A JavaScript Disabled
on 60% of all browsers seems like a ridiculously high percentage unless you consider
that Spiders and Bots do not execute JavaScript.
</p>
        <p>
Just like Google doesn't see the pretty layout from your stylesheet, Google also doesn't
see the dynamic content from your JavaScript. Pulling down HTML, (since it is all
just text, anyway) is easy; there's not even a lot of overhead associated with parsing
that HTML. But add in some JavaScript, and suddenly there's a lot more effort involved
in crawling your page, especially since there is a lot of bad JavaScript out there.
So search engines just check what has been written into your HTML. They read the the
URL, the keywords and META description, but only the content as rendered by the server.
JavaScript is not touched, and JavaScript-based content is not indexed.
</p>
        <p>
So how do you get around this? How do you get this SEO boost, since JavaScript isn't
an available option?
</p>
        <p>
Use plug-ins and utilities that pull your dynamic data server-side, rather than client-side.
Create a custom WebControl that will download and parse your latest Twitter updates.
Create a dasBlog macro to create your Microsoft Gamertag. By putting this responsibility
on the server, not only will you make life easier on your end user (one less JavaScript
library to download), but you also make this new content available to indexing engines,
which can only help your Google Juice.
</p>
        <h4>Update:
</h4>
        <p>
I've been working on a set of macros for dasBlog to start pulling my dynamic content
retrievals to the server. Keep an eye out over the next couple of days for the release
of my first macro, a Twitter Status dasBlog macro that will replace the need for the
Twitter JS libraries on your site.
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aac5652b-95d9-407d-8780-9361eae9b5de" class="wlWriterEditableSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/JavaScript" rel="tag">JavaScript</a>,<a href="http://technorati.com/tags/SEO" rel="tag">SEO</a>,<a href="http://technorati.com/tags/Twitter" rel="tag">Twitter</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=88fb8162-b06b-4df8-91ef-c2aefe0e1b8f" />
      </body>
      <title>Misconceptions on JavaScript Plugins and SEO</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,88fb8162-b06b-4df8-91ef-c2aefe0e1b8f.aspx</guid>
      <link>http://www.cptloadtest.com/2009/08/31/Misconceptions-On-JavaScript-Plugins-And-SEO.aspx</link>
      <pubDate>Mon, 31 Aug 2009 12:47:29 GMT</pubDate>
      <description>&lt;p&gt;
Search Engine Optimization is high on the radar, right now. Whether it be the quest
for the first Coupon site in Bing, the highest Cosmetics site on Google, or the top-ranked
&amp;quot;Jay Harris&amp;quot; on every search engine, the war is waged daily throughout the
internet. For companies, it's the next sale. For people, it's the next job. Dollars
are on the line in a never-ending battle for supremacy.
&lt;/p&gt;
&lt;p&gt;
One of the contributing factors in your Search Engine Ranking is Content. Fresh, new
content brings more search engine crawls. More crawls contributes to higher rankings.
Search engines like sites that are constantly providing new content; it lets the engine
know that the site is not dead or abandoned. And though this new content idea works
out well for the New York Times and CNN, not everyone has a team of staff writers
who are paid to constantly produce new content. So we shortcut. We don't so much have
to have new content as long as we make Google think we have new content. There are
hundreds if not thousands of JavaScript plugins out there to provide fresh content
to our readers, ranging from Picasa photos, to Twitter updates, to AdWords, to Microsoft
Gamercard tags. But I have to let you in on a little secret:
&lt;/p&gt;
&lt;p&gt;
JavaScript Plugins do nothing for SEO. 
&lt;br /&gt;
Nothing. 
&lt;br /&gt;
Search engine spiders don't do JavaScript.
&lt;/p&gt;
&lt;p&gt;
&amp;quot;This must be a lie. When I look at my site, I see my new photos, or my new tweets,
or my new Achievement Points; why don't the spiders see it, too?&amp;quot; Well, it's
true. Google Spiders, and most other Search Engine Spiders, &lt;a title="Google Webmaster Guidelines: Search Engine spiders do not execute JavaScript" href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;amp;answer=35769#2" target="_blank"&gt;don't
do JavaScript&lt;/a&gt;, which is why JS provides no SEO contribution; spiders do not index
what they do not see. A look through your traffic monitor, like Google Analytics,
will often show a disparity between logged traffic and what is actually accounted
for in Web Server logs. Analytics, a JavaScript-based traffic monitor, only logs about
40% of the total traffic to this site (excluding traffic to the RSS feed), which means
that the other 60% of my visitors have JavaScript disabled. A JavaScript Disabled
on 60% of all browsers seems like a ridiculously high percentage unless you consider
that Spiders and Bots do not execute JavaScript.
&lt;/p&gt;
&lt;p&gt;
Just like Google doesn't see the pretty layout from your stylesheet, Google also doesn't
see the dynamic content from your JavaScript. Pulling down HTML, (since it is all
just text, anyway) is easy; there's not even a lot of overhead associated with parsing
that HTML. But add in some JavaScript, and suddenly there's a lot more effort involved
in crawling your page, especially since there is a lot of bad JavaScript out there.
So search engines just check what has been written into your HTML. They read the the
URL, the keywords and META description, but only the content as rendered by the server.
JavaScript is not touched, and JavaScript-based content is not indexed.
&lt;/p&gt;
&lt;p&gt;
So how do you get around this? How do you get this SEO boost, since JavaScript isn't
an available option?
&lt;/p&gt;
&lt;p&gt;
Use plug-ins and utilities that pull your dynamic data server-side, rather than client-side.
Create a custom WebControl that will download and parse your latest Twitter updates.
Create a dasBlog macro to create your Microsoft Gamertag. By putting this responsibility
on the server, not only will you make life easier on your end user (one less JavaScript
library to download), but you also make this new content available to indexing engines,
which can only help your Google Juice.
&lt;/p&gt;
&lt;h4&gt;Update:
&lt;/h4&gt;
&lt;p&gt;
I've been working on a set of macros for dasBlog to start pulling my dynamic content
retrievals to the server. Keep an eye out over the next couple of days for the release
of my first macro, a Twitter Status dasBlog macro that will replace the need for the
Twitter JS libraries on your site.
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aac5652b-95d9-407d-8780-9361eae9b5de" class="wlWriterEditableSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/JavaScript" rel="tag"&gt;JavaScript&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SEO" rel="tag"&gt;SEO&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Twitter" rel="tag"&gt;Twitter&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=88fb8162-b06b-4df8-91ef-c2aefe0e1b8f" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,88fb8162-b06b-4df8-91ef-c2aefe0e1b8f.aspx</comments>
      <category>Blogging</category>
      <category>JavaScript</category>
      <category>SEO</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=43d7519f-a17a-4fb2-a33d-3b27cd39f994</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,43d7519f-a17a-4fb2-a33d-3b27cd39f994.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,43d7519f-a17a-4fb2-a33d-3b27cd39f994.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=43d7519f-a17a-4fb2-a33d-3b27cd39f994</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
You may have heard of Robots.txt. Or, you may have seen requests for /Robots.txt in
your web traffic logs, and if the file doesn't exist, a related HTTP 404. But what
is this Robot file, and what does it do?
</p>
        <h3>Introduction to Robots.txt
</h3>
        <p>
When on a web server, Robots.txt is a file that directs Robots (a.k.a. Spiders or
Web Crawlers) on which files and directories to ignore when indexing a site. The file
is located on the root directory of the domain, and is typically used to hide areas
of a site from search engine indexing, such as to keep a page off of Google's radar
(such as my DasBlog login page) or if a page or image is not relevant to the traditional
content of a site (maybe a mockup page for a CSS demo contains content about puppies,
and you don't want to mislead potential audience). Robots request this file prior
to indexing your site, and its absence indicates that the robot is free to index the
entire domain. Also, note that each sub-domain uses a unique Robots.txt. When a spider
is indexing msdn.microsoft.com, it won't look for the file on www.microsoft.com; MSDN
will need its own copy of Robots.txt. 
</p>
        <h3>How do I make a Robots.txt?
</h3>
        <p>
Robots.txt is a simple text file. You can create it in Notepad, Word, Emacs, DOS Edit,
or your favorite text editor. Also, the file belongs in the root of the domain on
your web server.
</p>
        <h4>Allow all robots to access everything:
</h4>
        <p>
The most basic file will be to authorize all robots to index the entire site. The
asterisk [*] for <em>User Agent</em> indicates that the rule applies to all robots,
and by leaving the value of <em>Disallow</em> blank rather than including a path,
it effectively disallows nothing and allows everything.
</p>
        <pre class="plain:nocontrols" name="code"># Allow all robots to access everything
User-agent: *
Disallow:</pre>
        <h4>Block all robots from accessing anything:
</h4>
        <p>
Conversely, with only one more character, we can invert the entire file and block
everything. By setting <em>Disallow</em> to a root slash, every file and directory
stemming from the root (in other words, the entire site) will be blocked from robot
indexing.
</p>
        <pre class="plain:nocontrols" name="code"># Block all robots from accessing anything
User-agent: *
Disallow: /</pre>
        <h4>Allow all robots to index everything except scripts, logs, images, and that CSS
demo on Puppies:
</h4>
        <p>
          <em>Disallow</em> is a partial-match string; setting <em>Disallow</em> to "image"
would match both <em>/images/</em> and <em>/imageHtmlTagDemo.html</em>. <em>Disallow</em> can
also be included multiple times with different values to disallow a robot from multiple
files and directories.
</p>
        <pre class="plain:nocontrols" name="code"># Block all robots from accessing scripts, logs,
#    images, and that CSS demo on Puppies
User-agent: *
Disallow: /images/
Disallow: /logs/
Disallow: /scripts/
Disallow: /demos/cssDemo/puppies.html</pre>
        <h4>Block all robots from accessing anything, except Google, which is only blocked
from images:
</h4>
        <p>
Just as a browser has a user agent, so does a robot. For example, "Googlebot/2.1
(http://www.google.com/bot.html)", is one of the user agents for Google's indexer.
Like <em>Disallow</em>, the <em>User-agent</em> value in Robots.txt is a partial-match
string, so simply setting the value to "Googlebot" is sufficient for a match.
Also, the <em>User-agent</em> and <em>Disallow</em> entries cascade, with the most
specific User Agent setting is the one that is recognized.
</p>
        <pre class="plain:nocontrols" name="code"># Block all robots from accessing anything,
#    except Google, which is only blocked from images
User-agent: *
Disallow: /
User-agent: Googlebot
Disallow: /images/</pre>
        <h3>Shortcomings of Robots.txt
</h3>
        <p>
Similar to the <a title="Wikipedia: Pirate Code" href="http://en.wikipedia.org/wiki/Pirate_code" rel="nofollow">Code
of the Order of the Brethren</a>, Robots.txt "is more what you'd call 'guidelines'
than actual rules." Robots.txt is not a standardized protocol, nor is it a requirement.
Only the "honorable" robots such as the Google or Yahoo search spiders adhere
to the file's instructions; other less-honorable bots, such as a spam spider searching
for email addresses, largely ignore the file.
</p>
        <p>
Also, do not use the file for access control. Robots.txt is just a suggestion for
search indexing, and will by no means block requests to a disallowed directory of
file. These disallowed URLs are still freely available to anyone on the web. Additionally,
the contents of this file can be used to against you, as it the items you place in
it may indicate areas of the site that are intended to be secret or private; this
information could be used to prioritize candidates for a malicious attack with disallowed
pages being the first places to target.
</p>
        <p>
Finally, this file must be located in the root of the domain: www.mydomain.com/robots.txt.
If your site is in a sub-folder from the domain, such as www.mydomain.com/~username/,
the file must still be on the root of the domain, and you may need to speak with your
webmaster to get your modifications added to the file.
</p>
        <h3>Other Resources:
</h3>
        <ul>
          <li>
The Web Robots Pages : <a href="http://www.robotstxt.org">http://www.robotstxt.org</a></li>
          <li>
Wikipedia : <a title="http://en.wikipedia.org/wiki/Robots.txt" href="http://en.wikipedia.org/wiki/Robots.txt">http://en.wikipedia.org/wiki/Robots.txt</a></li>
        </ul>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e5842e47-5b09-4532-a0d2-8f965492aefc" class="wlWriterEditableSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/SEO" rel="tag">SEO</a>,<a href="http://technorati.com/tags/Robots.txt" rel="tag">Robots.txt</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=43d7519f-a17a-4fb2-a33d-3b27cd39f994" />
      </body>
      <title>Virtues and Villainy of Robots.txt</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,43d7519f-a17a-4fb2-a33d-3b27cd39f994.aspx</guid>
      <link>http://www.cptloadtest.com/2009/05/15/Virtues-And-Villainy-Of-Robotstxt.aspx</link>
      <pubDate>Fri, 15 May 2009 13:31:37 GMT</pubDate>
      <description>&lt;p&gt;
You may have heard of Robots.txt. Or, you may have seen requests for /Robots.txt in
your web traffic logs, and if the file doesn't exist, a related HTTP 404. But what
is this Robot file, and what does it do?
&lt;/p&gt;
&lt;h3&gt;Introduction to Robots.txt
&lt;/h3&gt;
&lt;p&gt;
When on a web server, Robots.txt is a file that directs Robots (a.k.a. Spiders or
Web Crawlers) on which files and directories to ignore when indexing a site. The file
is located on the root directory of the domain, and is typically used to hide areas
of a site from search engine indexing, such as to keep a page off of Google's radar
(such as my DasBlog login page) or if a page or image is not relevant to the traditional
content of a site (maybe a mockup page for a CSS demo contains content about puppies,
and you don't want to mislead potential audience). Robots request this file prior
to indexing your site, and its absence indicates that the robot is free to index the
entire domain. Also, note that each sub-domain uses a unique Robots.txt. When a spider
is indexing msdn.microsoft.com, it won't look for the file on www.microsoft.com; MSDN
will need its own copy of Robots.txt. 
&lt;/p&gt;
&lt;h3&gt;How do I make a Robots.txt?
&lt;/h3&gt;
&lt;p&gt;
Robots.txt is a simple text file. You can create it in Notepad, Word, Emacs, DOS Edit,
or your favorite text editor. Also, the file belongs in the root of the domain on
your web server.
&lt;/p&gt;
&lt;h4&gt;Allow all robots to access everything:
&lt;/h4&gt;
&lt;p&gt;
The most basic file will be to authorize all robots to index the entire site. The
asterisk [*] for &lt;em&gt;User Agent&lt;/em&gt; indicates that the rule applies to all robots,
and by leaving the value of &lt;em&gt;Disallow&lt;/em&gt; blank rather than including a path,
it effectively disallows nothing and allows everything.
&lt;/p&gt;
&lt;pre class="plain:nocontrols" name="code"&gt;# Allow all robots to access everything
User-agent: *
Disallow:&lt;/pre&gt;
&lt;h4&gt;Block all robots from accessing anything:
&lt;/h4&gt;
&lt;p&gt;
Conversely, with only one more character, we can invert the entire file and block
everything. By setting &lt;em&gt;Disallow&lt;/em&gt; to a root slash, every file and directory
stemming from the root (in other words, the entire site) will be blocked from robot
indexing.
&lt;/p&gt;
&lt;pre class="plain:nocontrols" name="code"&gt;# Block all robots from accessing anything
User-agent: *
Disallow: /&lt;/pre&gt;
&lt;h4&gt;Allow all robots to index everything except scripts, logs, images, and that CSS
demo on Puppies:
&lt;/h4&gt;
&lt;p&gt;
&lt;em&gt;Disallow&lt;/em&gt; is a partial-match string; setting &lt;em&gt;Disallow&lt;/em&gt; to &amp;quot;image&amp;quot;
would match both &lt;em&gt;/images/&lt;/em&gt; and &lt;em&gt;/imageHtmlTagDemo.html&lt;/em&gt;. &lt;em&gt;Disallow&lt;/em&gt; can
also be included multiple times with different values to disallow a robot from multiple
files and directories.
&lt;/p&gt;
&lt;pre class="plain:nocontrols" name="code"&gt;# Block all robots from accessing scripts, logs,
#    images, and that CSS demo on Puppies
User-agent: *
Disallow: /images/
Disallow: /logs/
Disallow: /scripts/
Disallow: /demos/cssDemo/puppies.html&lt;/pre&gt;
&lt;h4&gt;Block all robots from accessing anything, except Google, which is only blocked
from images:
&lt;/h4&gt;
&lt;p&gt;
Just as a browser has a user agent, so does a robot. For example, &amp;quot;Googlebot/2.1
(http://www.google.com/bot.html)&amp;quot;, is one of the user agents for Google's indexer.
Like &lt;em&gt;Disallow&lt;/em&gt;, the &lt;em&gt;User-agent&lt;/em&gt; value in Robots.txt is a partial-match
string, so simply setting the value to &amp;quot;Googlebot&amp;quot; is sufficient for a match.
Also, the &lt;em&gt;User-agent&lt;/em&gt; and &lt;em&gt;Disallow&lt;/em&gt; entries cascade, with the most
specific User Agent setting is the one that is recognized.
&lt;/p&gt;
&lt;pre class="plain:nocontrols" name="code"&gt;# Block all robots from accessing anything,
#    except Google, which is only blocked from images
User-agent: *
Disallow: /
User-agent: Googlebot
Disallow: /images/&lt;/pre&gt;
&lt;h3&gt;Shortcomings of Robots.txt
&lt;/h3&gt;
&lt;p&gt;
Similar to the &lt;a title="Wikipedia: Pirate Code" href="http://en.wikipedia.org/wiki/Pirate_code" rel="nofollow"&gt;Code
of the Order of the Brethren&lt;/a&gt;, Robots.txt &amp;quot;is more what you'd call 'guidelines'
than actual rules.&amp;quot; Robots.txt is not a standardized protocol, nor is it a requirement.
Only the &amp;quot;honorable&amp;quot; robots such as the Google or Yahoo search spiders adhere
to the file's instructions; other less-honorable bots, such as a spam spider searching
for email addresses, largely ignore the file.
&lt;/p&gt;
&lt;p&gt;
Also, do not use the file for access control. Robots.txt is just a suggestion for
search indexing, and will by no means block requests to a disallowed directory of
file. These disallowed URLs are still freely available to anyone on the web. Additionally,
the contents of this file can be used to against you, as it the items you place in
it may indicate areas of the site that are intended to be secret or private; this
information could be used to prioritize candidates for a malicious attack with disallowed
pages being the first places to target.
&lt;/p&gt;
&lt;p&gt;
Finally, this file must be located in the root of the domain: www.mydomain.com/robots.txt.
If your site is in a sub-folder from the domain, such as www.mydomain.com/~username/,
the file must still be on the root of the domain, and you may need to speak with your
webmaster to get your modifications added to the file.
&lt;/p&gt;
&lt;h3&gt;Other Resources:
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
The Web Robots Pages : &lt;a href="http://www.robotstxt.org"&gt;http://www.robotstxt.org&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
Wikipedia : &lt;a title="http://en.wikipedia.org/wiki/Robots.txt" href="http://en.wikipedia.org/wiki/Robots.txt"&gt;http://en.wikipedia.org/wiki/Robots.txt&lt;/a&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e5842e47-5b09-4532-a0d2-8f965492aefc" class="wlWriterEditableSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/SEO" rel="tag"&gt;SEO&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Robots.txt" rel="tag"&gt;Robots.txt&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=43d7519f-a17a-4fb2-a33d-3b27cd39f994" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,43d7519f-a17a-4fb2-a33d-3b27cd39f994.aspx</comments>
      <category>Blogging</category>
      <category>SEO</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=1969da77-0f42-4e5a-97cb-78a60ba0c946</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,1969da77-0f42-4e5a-97cb-78a60ba0c946.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,1969da77-0f42-4e5a-97cb-78a60ba0c946.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1969da77-0f42-4e5a-97cb-78a60ba0c946</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
FeedBurner used to allow adding DotNetKicks FeedFlare to your feeds. Even today, the
FeedFlare catalog lists "Kick It" using DNK's <a href="http://static.dotnetkicks.com/tools/feedflare/kickitflare.xml">FeedFlareUnit
file</a>. Unfortunately, when adding this file to FeedFlare using the link given in
the catalog, the unfortunate user receives only a JavaScript alert of "We could not
find a valid FeedFlare file at that location" instead of an enhanced feed. Why? No
XML Declaration is contained within DNK's XML file.
</p>
        <h3>Example XML Declaration
</h3>
        <pre class="xml:nocontrols" name="code">&lt;?xml version="1.0" encoding="utf-8"?&gt;</pre>
        <p>
By adding only an XML Declaration to the top of the file, FeedBurner is now able to
properly parse the document, and add the new flare to a feed. This would also apply
to any custom FeedFlareUnit that you develop; be sure to add an XML Declaration to
your XML.
</p>
        <h3>Corrected File for DotNetKicks
</h3>
        <p>
Download: <a href="http://www.cptloadtest.com/content/text/kickitflare.xml">kickitflare.xml</a></p>
        <pre class="xml:nocontrols" name="code">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;FeedFlareUnit&gt;
  &lt;Catalog&gt;
    &lt;Title&gt;Kick it&lt;/Title&gt;
    &lt;Description&gt;Kick this story on dotnetkicks.com&lt;/Description&gt;
  &lt;/Catalog&gt;
  &lt;FeedFlare&gt;
    &lt;Text&gt;Kick it&lt;/Text&gt;
    &lt;Link href="http://www.dotnetkicks.com/kick/?url=${link}" /&gt;
  &lt;/FeedFlare&gt;
&lt;/FeedFlareUnit&gt;</pre>
        <p>
I have <a href="http://code.google.com/p/dotnetkicks/issues/detail?id=249">logged
a ticket</a> with DotNetKicks on their <a href="http://code.google.com/p/dotnetkicks/">Google
Code issue tracker</a>. Hopefully, as opportunity allows, they can update the file
on dotnetkicks.com so that the FeedFlare catalog entry will work once again. Feel
free to add DotNetKicks FeedFlare to your FeedBurner feed using the file link above
until they have an opportunity to address the ticket.
</p>
        <h3>Adding DotNetKicks FeedFlare to your FeedBurner Feed
</h3>
        <p>
To add the "Kick It" FeedFlare to your existing FeedBurner feed:
</p>
        <ol>
          <li>
Copy the URL for the updated kickitflare.xml file to your clipboard:<br /><em>http://www.cptloadtest.com/content/text/kickitflare.xml</em></li>
          <li>
Log in to FeedBurner at <a href="http://feedburner.google.com">http://feedburner.google.com</a></li>
          <li>
Navigate to your feed details, then to the Optimize tab, then to FeedFlare 
</li>
          <li>
Paste the URL into the textbox, and click <em>Add New Flare</em>. 
</li>
          <li>
As desired, check the appropriate checkboxes to add the flare to your RSS feed and
to your site. 
</li>
          <li>
Click the <em>Save</em> button at the bottom of the page.</li>
        </ol>
        <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9f91e4d9-f2f1-4e0b-aba8-871515dfa427" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati
Tags: <a href="http://technorati.com/tags/Blogging" rel="tag">Blogging</a>,<a href="http://technorati.com/tags/DotNetKicks" rel="tag">DotNetKicks</a>,<a href="http://technorati.com/tags/FeedBurner" rel="tag">FeedBurner</a>,<a href="http://technorati.com/tags/FeedFlare" rel="tag">FeedFlare</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=1969da77-0f42-4e5a-97cb-78a60ba0c946" />
      </body>
      <title>[Fixed] Adding DotNetKicks FeedFlare to FeedBurner</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,1969da77-0f42-4e5a-97cb-78a60ba0c946.aspx</guid>
      <link>http://www.cptloadtest.com/2009/04/02/Fixed-Adding-DotNetKicks-FeedFlare-To-FeedBurner.aspx</link>
      <pubDate>Thu, 02 Apr 2009 13:07:41 GMT</pubDate>
      <description>&lt;p&gt;
FeedBurner used to allow adding DotNetKicks FeedFlare to your feeds. Even today, the
FeedFlare catalog lists "Kick It" using DNK's &lt;a href="http://static.dotnetkicks.com/tools/feedflare/kickitflare.xml"&gt;FeedFlareUnit
file&lt;/a&gt;. Unfortunately, when adding this file to FeedFlare using the link given in
the catalog, the unfortunate user receives only a JavaScript alert of "We could not
find a valid FeedFlare file at that location" instead of an enhanced feed. Why? No
XML Declaration is contained within DNK's XML file.
&lt;/p&gt;
&lt;h3&gt;Example XML Declaration
&lt;/h3&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/pre&gt;
&lt;p&gt;
By adding only an XML Declaration to the top of the file, FeedBurner is now able to
properly parse the document, and add the new flare to a feed. This would also apply
to any custom FeedFlareUnit that you develop; be sure to add an XML Declaration to
your XML.
&lt;/p&gt;
&lt;h3&gt;Corrected File for DotNetKicks
&lt;/h3&gt;
&lt;p&gt;
Download: &lt;a href="http://www.cptloadtest.com/content/text/kickitflare.xml"&gt;kickitflare.xml&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;FeedFlareUnit&amp;gt;
  &amp;lt;Catalog&amp;gt;
    &amp;lt;Title&amp;gt;Kick it&amp;lt;/Title&amp;gt;
    &amp;lt;Description&amp;gt;Kick this story on dotnetkicks.com&amp;lt;/Description&amp;gt;
  &amp;lt;/Catalog&amp;gt;
  &amp;lt;FeedFlare&amp;gt;
    &amp;lt;Text&amp;gt;Kick it&amp;lt;/Text&amp;gt;
    &amp;lt;Link href="http://www.dotnetkicks.com/kick/?url=${link}" /&amp;gt;
  &amp;lt;/FeedFlare&amp;gt;
&amp;lt;/FeedFlareUnit&amp;gt;&lt;/pre&gt;
&lt;p&gt;
I have &lt;a href="http://code.google.com/p/dotnetkicks/issues/detail?id=249"&gt;logged
a ticket&lt;/a&gt; with DotNetKicks on their &lt;a href="http://code.google.com/p/dotnetkicks/"&gt;Google
Code issue tracker&lt;/a&gt;. Hopefully, as opportunity allows, they can update the file
on dotnetkicks.com so that the FeedFlare catalog entry will work once again. Feel
free to add DotNetKicks FeedFlare to your FeedBurner feed using the file link above
until they have an opportunity to address the ticket.
&lt;/p&gt;
&lt;h3&gt;Adding DotNetKicks FeedFlare to your FeedBurner Feed
&lt;/h3&gt;
&lt;p&gt;
To add the "Kick It" FeedFlare to your existing FeedBurner feed:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Copy the URL for the updated kickitflare.xml file to your clipboard:&lt;br&gt;
&lt;em&gt;http://www.cptloadtest.com/content/text/kickitflare.xml&lt;/em&gt; 
&lt;li&gt;
Log in to FeedBurner at &lt;a href="http://feedburner.google.com"&gt;http://feedburner.google.com&lt;/a&gt; 
&lt;li&gt;
Navigate to your feed details, then to the Optimize tab, then to FeedFlare 
&lt;li&gt;
Paste the URL into the textbox, and click &lt;em&gt;Add New Flare&lt;/em&gt;. 
&lt;li&gt;
As desired, check the appropriate checkboxes to add the flare to your RSS feed and
to your site. 
&lt;li&gt;
Click the &lt;em&gt;Save&lt;/em&gt; button at the bottom of the page.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9f91e4d9-f2f1-4e0b-aba8-871515dfa427" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Blogging" rel="tag"&gt;Blogging&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DotNetKicks" rel="tag"&gt;DotNetKicks&lt;/a&gt;,&lt;a href="http://technorati.com/tags/FeedBurner" rel="tag"&gt;FeedBurner&lt;/a&gt;,&lt;a href="http://technorati.com/tags/FeedFlare" rel="tag"&gt;FeedFlare&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=1969da77-0f42-4e5a-97cb-78a60ba0c946" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,1969da77-0f42-4e5a-97cb-78a60ba0c946.aspx</comments>
      <category>Blogging</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=54e51040-72cb-4297-9012-bfaa4caa364f</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,54e51040-72cb-4297-9012-bfaa4caa364f.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,54e51040-72cb-4297-9012-bfaa4caa364f.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=54e51040-72cb-4297-9012-bfaa4caa364f</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
My earlier post on creating custom brushes in Google Syntax Highlighter (<a title="Jay Harris, Blog Post: Extending Language Support in Google Syntax Highlighter" href="http://www.cptloadtest.com/2008/12/10/ExtendingLanguageSupportInGoogleSyntaxHighlighter.aspx">Extending
Language Support in Google Syntax Highlighter</a>) contains a rudimentary brush for
ActionScript. The original is designed for Stone Soup; it is something to get an AS
brush established, but is not meant to be exhaustive. I have revisited the brush and
added some meat. The bush should now supply a more thorough coverage of the language.
A download is provided below.
</p>
        <h3>ActionScript Brush
</h3>
        <pre class="js:nocontrols" name="code">dp.sh.Brushes.ActionScript = function() {
  var keywords = 'and arguments asfunction break call case catch clear ' +
    'continue default do else escape eval false finally for getProperty ' +
    'if ifFrameLoaded in instanceof loop NaN new newline not null or ' +
    'prototype return set super switch targetPath tellTarget this throw ' +
    'trace true try typeof undefined unescape var visible void while with';
  var builtin = '_currentframe _droptarget _framesloaded _global _height ' +
    '_level _name _root _rotation _target _totalframes _url _visible ' +
    '_width _x _xmouse _xscale _y _ymouse _yscale Array Boolean Button ' +
    'bytesLoaded bytesTotal Camera Color Date enabled Error focusEnabled ' +
    'Key LoadVars Math Mouse MovieClip nextFrame Number Object Selection ' +
    'Sound Stage String StyleSheet System TextFormat';
  var funcs = 'addProperty attachMovie attachVideo browse cancel ' +
    'clearInterval clone concat createEmptyMovieClip createTextField ' +
    'dispose draw duplicateMovieClip dynamic equals extends function ' +
    'getInstanceAtDepth gotoAndPlay gotoAndStop identity implements ' +
    'import interface isEmpty isFinite isNAN join length loadClip ' +
    'loadMovie loadMovieNum loadVariables loadVariablesNum merge moveTo ' +
    'on onClipEvent onDragOut onDragOver onEnterFrame onKeyDown onKeyUp ' +
    'onKillFocus onMouseDown onMouseMove onMouseUp onPress onRelease ' +
    'onReleaseOutside onRollOut onRollOver onUnload play pop prevFrame ' +
    'private public push registerClass removeMovieClip reverse rotate ' +
    'scale setEmpty setInterval setProperty shift slice sort sortOn ' +
    'splice startDrag static stopAllSounds stopDrag subtract swapDepths ' +
    'toString toString translate union unloadClip unloadMovie ' +
    'unloadMovieNum unshiftclass unwatch valueOf watch';
  var includes = '#include #initClip #endInitClip';

  this.regexList = [
    {regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment' },
    {regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment' },
    {regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' },
    {regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' },
    {regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' },
    {regex: new RegExp(this.GetKeywords(funcs), 'gm'), css: 'func' },
    {regex: new RegExp(this.GetKeywords(builtin), 'gm'), css: 'builtin' },
    {regex: new RegExp(this.GetKeywords(includes), 'gm'), css: 'preprocessor'}
  ];
  this.CssClass = 'dp-as';
  this.Style = '.dp-as .func { color: #000099; }' +
               '.dp-as .builtin { color: #990000; }';
}

dp.sh.Brushes.ActionScript.prototype = new dp.sh.Highlighter();
dp.sh.Brushes.ActionScript.Aliases = ['actionscript', 'as'];</pre>
        <h3>Usage
</h3>
        <p>
Upload the Brush javascript file to your Google Syntax Highlighter <em>Scripts</em> directory,
and load the file in unto your HTML with a &lt;SCRIPT&gt; tag with your other brushes.
</p>
        <pre class="html:nogutter:nocontrols" name="code">&lt;script language="javascript"
  src="dp.SyntaxHighlighter/Scripts/shBrushAs.js"&gt;&lt;/script&gt;</pre>
        <p>
Display syntax-highlighted ActionScript using a traditional Google Syntax Highlighter
&lt;PRE&gt; tag, using <em>as</em> or <em>actionscript</em> as the language alias.
</p>
        <pre class="html:nogutter:nocontrols" name="code">&lt;pre name="code" class="as"&gt;
  // Some ActionScript Code
&lt;/pre&gt;</pre>
        <h3>Brush In Action
</h3>
        <pre class="as:nocontrols" name="code">/*
Sample ActionScript for Demo
ActionScript Brush for Google Syntax Highlighter
*/
if (dteDate.getMonth() == intCurrMonth &amp;&amp; intCurrMonth == intOldMonth
    &amp;&amp; intOldYear == intCurrYear) {
  if (dteDate.getDay() == 0 and dteDate.getDate()&gt;1) {
    intYPosition = intYPosition+20;
  }
  duplicateMovieClip ("DayContainer", "DayContainer"+intDate, intDate);
  setProperty ("DayContainer"+intDate, _y, intYPosition);
  setProperty ("DayContainer"+intDate, _x, intXPosition[dteDate.getDay()]);

  } else if (intCurrMonth == 6) {
    if (intDate == 4) {
      clrFColor = new Color("DayContainer"+intDate+".foreground");
      clrFColor.setRGB(0xFF0000);
      clrBColor = new Color("DayContainer"+intDate+".background");
      clrBColor.setRGB(0xFF0000);
    }
  } else if (intCurrMonth == 9) {
    if (intDate == 31) {
      clrFColor = new Color("DayContainer"+intDate+".foreground");
      clrFColor.setRGB(0xFF9922);
      clrBColor = new Color("DayContainer"+intDate+".background");
      clrBColor.setRGB(0xFF9922);
    }
  } else if (intCurrMonth == 10) {
    if (intDate &gt;= 22 &amp;&amp; intDate &lt;= 28 &amp;&amp; dteDate.getDay() == 4) {
      clrFColor = new Color("DayContainer"+intDate+".foreground");
      clrFColor.setRGB(0xFFCC00);
      clrBColor = new Color("DayContainer"+intDate+".background");
      clrBColor.setRGB(0xFFCC00);
    }
  set ("DayContainer"+intDate+":MyDate", new Date(dteDate.getFullYear(),
    dteDate.getMonth(), dteDate.getDate()));
  setProperty ("DayContainer"+intDate, _visible, true);
  intDate++;
  dteDate.setDate(intDate);
}</pre>
        <h3>Download
</h3>
        <blockquote>
          <p>
            <strong>Download:</strong>
            <a title="ActionScript Brush for Google Syntax Highlighter" href="http://www.cptloadtest.com/content/binary/shBrushAs.zip">shBrushAs.zip</a>
            <br />
Includes:
</p>
          <ul>
            <li>
Compressed <em>shBrushAs.js</em> for production.  
</li>
            <li>
Uncompressed <em>shBurshAs.js</em> for debugging.</li>
          </ul>
          <p>
As always, this code is provided with no warranties or guarantees. Use at your own
risk. Your mileage may vary.
</p>
        </blockquote>
        <pre>
          <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a7707e63-5a44-4a88-b27c-59fab2383def" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati
Tags: <a href="http://technorati.com/tags/Google%20Code" rel="tag">Google Code</a>,<a href="http://technorati.com/tags/SyntaxHighlighter" rel="tag">SyntaxHighlighter</a>,<a href="http://technorati.com/tags/Syntax%20Highlighter" rel="tag">Syntax
Highlighter</a>,<a href="http://technorati.com/tags/ActionScript" rel="tag">ActionScript</a></div>
        </pre>
        <pre> </pre>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=54e51040-72cb-4297-9012-bfaa4caa364f" />
      </body>
      <title>ActionScript Brush for Google Syntax Highlighter</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,54e51040-72cb-4297-9012-bfaa4caa364f.aspx</guid>
      <link>http://www.cptloadtest.com/2008/12/12/ActionScript-Brush-For-Google-Syntax-Highlighter.aspx</link>
      <pubDate>Fri, 12 Dec 2008 13:25:38 GMT</pubDate>
      <description>&lt;p&gt;
My earlier post on creating custom brushes in Google Syntax Highlighter (&lt;a title="Jay Harris, Blog Post: Extending Language Support in Google Syntax Highlighter" href="http://www.cptloadtest.com/2008/12/10/ExtendingLanguageSupportInGoogleSyntaxHighlighter.aspx"&gt;Extending
Language Support in Google Syntax Highlighter&lt;/a&gt;) contains a rudimentary brush for
ActionScript. The original is designed for Stone Soup; it is something to get an AS
brush established, but is not meant to be exhaustive. I have revisited the brush and
added some meat. The bush should now supply a more thorough coverage of the language.
A download is provided below.
&lt;/p&gt;
&lt;h3&gt;ActionScript Brush
&lt;/h3&gt;
&lt;pre class="js:nocontrols" name="code"&gt;dp.sh.Brushes.ActionScript = function() {
  var keywords = 'and arguments asfunction break call case catch clear ' +
    'continue default do else escape eval false finally for getProperty ' +
    'if ifFrameLoaded in instanceof loop NaN new newline not null or ' +
    'prototype return set super switch targetPath tellTarget this throw ' +
    'trace true try typeof undefined unescape var visible void while with';
  var builtin = '_currentframe _droptarget _framesloaded _global _height ' +
    '_level _name _root _rotation _target _totalframes _url _visible ' +
    '_width _x _xmouse _xscale _y _ymouse _yscale Array Boolean Button ' +
    'bytesLoaded bytesTotal Camera Color Date enabled Error focusEnabled ' +
    'Key LoadVars Math Mouse MovieClip nextFrame Number Object Selection ' +
    'Sound Stage String StyleSheet System TextFormat';
  var funcs = 'addProperty attachMovie attachVideo browse cancel ' +
    'clearInterval clone concat createEmptyMovieClip createTextField ' +
    'dispose draw duplicateMovieClip dynamic equals extends function ' +
    'getInstanceAtDepth gotoAndPlay gotoAndStop identity implements ' +
    'import interface isEmpty isFinite isNAN join length loadClip ' +
    'loadMovie loadMovieNum loadVariables loadVariablesNum merge moveTo ' +
    'on onClipEvent onDragOut onDragOver onEnterFrame onKeyDown onKeyUp ' +
    'onKillFocus onMouseDown onMouseMove onMouseUp onPress onRelease ' +
    'onReleaseOutside onRollOut onRollOver onUnload play pop prevFrame ' +
    'private public push registerClass removeMovieClip reverse rotate ' +
    'scale setEmpty setInterval setProperty shift slice sort sortOn ' +
    'splice startDrag static stopAllSounds stopDrag subtract swapDepths ' +
    'toString toString translate union unloadClip unloadMovie ' +
    'unloadMovieNum unshiftclass unwatch valueOf watch';
  var includes = '#include #initClip #endInitClip';

  this.regexList = [
    {regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment' },
    {regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment' },
    {regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string' },
    {regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' },
    {regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' },
    {regex: new RegExp(this.GetKeywords(funcs), 'gm'), css: 'func' },
    {regex: new RegExp(this.GetKeywords(builtin), 'gm'), css: 'builtin' },
    {regex: new RegExp(this.GetKeywords(includes), 'gm'), css: 'preprocessor'}
  ];
  this.CssClass = 'dp-as';
  this.Style = '.dp-as .func { color: #000099; }' +
               '.dp-as .builtin { color: #990000; }';
}

dp.sh.Brushes.ActionScript.prototype = new dp.sh.Highlighter();
dp.sh.Brushes.ActionScript.Aliases = ['actionscript', 'as'];&lt;/pre&gt;
&lt;h3&gt;Usage
&lt;/h3&gt;
&lt;p&gt;
Upload the Brush javascript file to your Google Syntax Highlighter &lt;em&gt;Scripts&lt;/em&gt; directory,
and load the file in unto your HTML with a &amp;lt;SCRIPT&amp;gt; tag with your other brushes.
&lt;/p&gt;
&lt;pre class="html:nogutter:nocontrols" name="code"&gt;&amp;lt;script language="javascript"
  src="dp.SyntaxHighlighter/Scripts/shBrushAs.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Display syntax-highlighted ActionScript using a traditional Google Syntax Highlighter
&amp;lt;PRE&amp;gt; tag, using &lt;em&gt;as&lt;/em&gt; or &lt;em&gt;actionscript&lt;/em&gt; as the language alias.
&lt;/p&gt;
&lt;pre class="html:nogutter:nocontrols" name="code"&gt;&amp;lt;pre name="code" class="as"&amp;gt;
  // Some ActionScript Code
&amp;lt;/pre&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Brush In Action
&lt;/h3&gt;
&lt;pre class="as:nocontrols" name="code"&gt;/*
Sample ActionScript for Demo
ActionScript Brush for Google Syntax Highlighter
*/
if (dteDate.getMonth() == intCurrMonth &amp;amp;&amp;amp; intCurrMonth == intOldMonth
    &amp;amp;&amp;amp; intOldYear == intCurrYear) {
  if (dteDate.getDay() == 0 and dteDate.getDate()&amp;gt;1) {
    intYPosition = intYPosition+20;
  }
  duplicateMovieClip ("DayContainer", "DayContainer"+intDate, intDate);
  setProperty ("DayContainer"+intDate, _y, intYPosition);
  setProperty ("DayContainer"+intDate, _x, intXPosition[dteDate.getDay()]);

  } else if (intCurrMonth == 6) {
    if (intDate == 4) {
      clrFColor = new Color("DayContainer"+intDate+".foreground");
      clrFColor.setRGB(0xFF0000);
      clrBColor = new Color("DayContainer"+intDate+".background");
      clrBColor.setRGB(0xFF0000);
    }
  } else if (intCurrMonth == 9) {
    if (intDate == 31) {
      clrFColor = new Color("DayContainer"+intDate+".foreground");
      clrFColor.setRGB(0xFF9922);
      clrBColor = new Color("DayContainer"+intDate+".background");
      clrBColor.setRGB(0xFF9922);
    }
  } else if (intCurrMonth == 10) {
    if (intDate &amp;gt;= 22 &amp;amp;&amp;amp; intDate &amp;lt;= 28 &amp;amp;&amp;amp; dteDate.getDay() == 4) {
      clrFColor = new Color("DayContainer"+intDate+".foreground");
      clrFColor.setRGB(0xFFCC00);
      clrBColor = new Color("DayContainer"+intDate+".background");
      clrBColor.setRGB(0xFFCC00);
    }
  set ("DayContainer"+intDate+":MyDate", new Date(dteDate.getFullYear(),
    dteDate.getMonth(), dteDate.getDate()));
  setProperty ("DayContainer"+intDate, _visible, true);
  intDate++;
  dteDate.setDate(intDate);
}&lt;/pre&gt;
&lt;h3&gt;Download
&lt;/h3&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;strong&gt;Download:&lt;/strong&gt; &lt;a title="ActionScript Brush for Google Syntax Highlighter" href="http://www.cptloadtest.com/content/binary/shBrushAs.zip"&gt;shBrushAs.zip&lt;/a&gt;
&lt;br&gt;
Includes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Compressed &lt;em&gt;shBrushAs.js&lt;/em&gt; for production.&amp;nbsp; 
&lt;li&gt;
Uncompressed &lt;em&gt;shBurshAs.js&lt;/em&gt; for debugging.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
As always, this code is provided with no warranties or guarantees. Use at your own
risk. Your mileage may vary.
&lt;/p&gt;
&lt;/blockquote&gt;&lt;pre&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a7707e63-5a44-4a88-b27c-59fab2383def" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Google%20Code" rel="tag"&gt;Google Code&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SyntaxHighlighter" rel="tag"&gt;SyntaxHighlighter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Syntax%20Highlighter" rel="tag"&gt;Syntax
Highlighter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ActionScript" rel="tag"&gt;ActionScript&lt;/a&gt;
&lt;/div&gt;
&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=54e51040-72cb-4297-9012-bfaa4caa364f" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,54e51040-72cb-4297-9012-bfaa4caa364f.aspx</comments>
      <category>Blogging</category>
      <category>Flash</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As I discussed in an earlier post (<a title="Jay Harris, Blog Post: Blog your code using Google Syntax Highlighter" href="http://www.cptloadtest.com/2008/11/24/BlogYourCodeUsingGoogleSyntaxHighlighter.aspx">Blog
your code using Google Syntax Highlighter</a>), Google Syntax Highlighter is a simple
tool that allows bloggers to easily display code in a format that is familiar end
users. The tool renders the code in a very consumable fashion that includes colored
syntax highlighting, line highlighting, and line numbers. Out of the box it supports
most of the common languages of today, and a few from yesterday, but some common languages
are unsupported. Perl, ColdFusion, and Flash's ActionScript all are unloved by Google
Syntax Highlighter, as are many others that you may want to post to your blog. For
these languages, the solution is a custom brush.
</p>
        <h3>Syntax Highlighting Brushes
</h3>
        <p>
For Google Syntax Highlighter, brushes are JavaScript files that govern the syntax
highlighting process, with names following the format of shBrushLanguage.js, such
as shBrushXml.js. Brushes contain information about the keywords, functions, and operators
of a language, as well as the syntax for comments, strings, and other syntax characteristics.
Keyword-level syntax is applied to any specific word in the language, including keywords,
functions, and any word operators, such as <em>and</em>, <em>or</em>, and <em>not</em>.
Regular expressions apply character-level syntax to code, and identifies items such
as character operators, the remainder of an inline comment, or the entire contents
of a comment block. Finally, aliases are defined for the brush; these are the language
aliases that are used within the <em>class</em> attribute of the Google Syntax Highlighter
&lt;PRE&gt; tag. With this information, the brush applies the syntax highlighting
styles according to the CSS defined for each component of the language. 
</p>
        <h3>Breaking Down Brushes
</h3>
        <h4>Decomposing the SQL Brush
</h4>
        <p>
In JavaScript, everything is an object that can be assigned to a variable, whether
its a number, string, function, or class. Brushes are each a delegate function. The
variable name of the brush must match <em>dp.sh.Brushes.SomeLanguage</em>.
</p>
        <pre class="js:nocontrols:firstline[1]" name="code">dp.sh.Brushes.Sql = function() {</pre>
        <p>
Next, define the list of keywords for applying syntax highlighting. Each list is not
an array, but rather a single-space delimited string of keywords that will be highlighted.
Also, multiple keyword lists can exist, such as one list for function names, another
for keywords, and perhaps another for types, and unique styling can be applied to
each grouping (we'll get to styling a little later). 
</p>
        <pre class="js:nocontrols:firstline[2]" name="code">  var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
    'current_user day isnull left lower month nullif replace right ' +
    'session_user space substring sum system_user upper user year';

  var keywords = 'absolute action add after alter as asc at authorization ' +
    'begin bigint binary bit by cascade char character check checkpoint ' +
    'close collate column commit committed connect connection constraint ' +
    'contains continue create cube current current_date current_time ' +
    'cursor database date deallocate dec decimal declare default delete ' +
    'desc distinct double drop dynamic else end end-exec escape except ' +
    'exec execute false fetch first float for force foreign forward free ' +
    'from full function global goto grant group grouping having hour ' +
    'ignore index inner insensitive insert instead int integer intersect ' +
    'into is isolation key last level load local max min minute modify ' +
    'move name national nchar next no numeric of off on only open option ' +
    'order out output partial password precision prepare primary prior ' +
    'privileges procedure public read real references relative repeatable ' +
    'restrict return returns revoke rollback rollup rows rule schema ' +
    'scroll second section select sequence serializable set size smallint ' +
    'static statistics table temp temporary then time timestamp to top ' +
    'transaction translation trigger true truncate uncommitted union ' +
    'unique update values varchar varying view when where with work';

  var operators = 'all and any between cross in join like not null or ' +
    'outer some';</pre>
        <p>
Following the keyword definitions is the Regular Expression pattern and Style definition
object list. The list, <em>this.regexList</em>, is an array of pattern/style objects: <em>{regex:
regexPattern, css: classString}</em>. The <em>regexPattern</em> is a JavaScript <em>RegExp</em> object,
and defines the pattern to match in the source code; this pattern can be created using
one of three options within Google Syntax Highlighter. 
</p>
        <dl>
          <dt>Predefined Patterns </dt>
          <dd>Within Google Syntax Highlighter, <em>dp.sh.RegexLib</em> contains five predefined
regular expression patterns. <em>MultiLineCComments</em> is used for any language
that uses C-style multi-line comment blocks: <em>/* my comment block */</em>. <em>SingleLineCComments</em> is
used for any language that uses C-style single line or inline comments: <em>// my
comment</em>. <em>SingleLinePerlComments</em> applies for Perl-style single line comments: <em>#
my comment</em>. <em>DoubleQuotedString</em> identifies any string wrapped in double-quotes
and <em>SingleQuotedString</em> identifies strings wrapped in single-quotes. These
options are used in place of creating a new instance of the <em>RegExp</em> object. 
</dd>
          <dt>Keyword Patterns </dt>
          <dd>Google Syntax Highlighter has a <em>GetKeywords(string)</em> function which will
build a pattern string based on one of the brush's defined keyword strings. However,
this is only the pattern string, and not the <em>RegExp</em> object. Pass this value
into the <em>RegExp</em> constructor: <em>new RegExp(this.GetKeyword(keywords), 'gmi')</em></dd>
          <dt>Custom Pattern Definition </dt>
          <dd>Create a new <em>RegExp</em> object using a custom pattern. For example, use <em>new
RegExp('--(.*)$', 'gm')</em> to match all Sql comments, such as <em>--my comment</em>.</dd>
        </dl>
        <p>
For these pattern/style objects, the regular expression pattern is followed by the
name of the CSS class to apply to any regular expression matches. The style sheet
packaged with Google Syntax Highlighter, SyntaxHighlighter.css, already defines the
many CSS classes used by GSH; place the additional styles for your custom brushes
within this file, in a new file, in your HTML, or defined them within the brush using
JavaScript.
</p>
        <pre class="js:nocontrols:firstline[27]" name="code">  this.regexList = [
    {regex: new RegExp('--(.*)$', 'gm'), css: 'comment'},
    {regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string'},
    {regex: dp.sh.RegexLib.SingleQuotedString, css: 'string'},
    {regex: new RegExp(this.GetKeywords(funcs), 'gmi'), css: 'func'},
    {regex: new RegExp(this.GetKeywords(operators), 'gmi'), css: 'op'},
    {regex: new RegExp(this.GetKeywords(keywords), 'gmi'), css: 'keyword'}
  ];</pre>
        <p>
The delegate definition ends with any style specifications. Apply a style sheet to
the entire code block using <em>this.CssClass</em>. Also, as mentioned above, the
brush can define custom CSS using this.Style as an alternative to placing the CSS
in HTML or a CSS file. When finished, close the delegate.
</p>
        <pre class="js:nocontrols:firstline[36]" name="code">  this.CssClass = 'dp-sql';
  this.Style = '.dp-sql .func { color: #ff1493; }' +
    '.dp-sql .op { color: #808080; }'; }
</pre>
        <p>
The final component of a Brush, set outside of your delegate, contains the prototype
declaration and any aliases to apply to the Brush. Aliases consist of a string array
(a real array this time, not a space-delimited string) of language aliases to use,
such as ['c#','c-sharp','csharp']. Alias values must be unique across all defined
brushes that you have included into your site.
</p>
        <pre class="js:nocontrols:firstline[40]" name="code">dp.sh.Brushes.Sql.prototype = new dp.sh.Highlighter();
dp.sh.Brushes.Sql.Aliases = ['sql'];</pre>
        <h3>Making a Custom Brush (for ActionScript) 
</h3>
        <p>
I like rich media applications, such as those developed in Flash or Silverlight. I
was surprised when I found that Google Syntax Highlighter does not ship with an ActionScript
brush, and more surprised when I found out that no one has written one, yet. So, using
the methods from above, I created one. This isn't meant to be an exhaustive brush,
but more like <a href="http://en.wikipedia.org/wiki/Stone_soup">Stone Soup</a>. It's
a start. Please feel free to add to it.
</p>
        <pre class="js" name="code">dp.sh.Brushes.ActionScript = function() {

  var keywords = 'and break case catch class continue default do dynamic else ' +
    'extends false finally for if implements import in interface NaN new not ' +
    'null or private public return static super switch this throw true try ' +
    'undefined var void while with';

  this.regexList = [{regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment'},
    {regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment'},
    {regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string'},
    {regex: dp.sh.RegexLib.SingleQuotedString, css: 'string'},
    {regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword'}];

    this.CssClass = 'dp-as';
}

dp.sh.Brushes.ActionScript.prototype = new dp.sh.Highlighter();
dp.sh.Brushes.ActionScript.Aliases = ['actionscript', 'as'];</pre>
        <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:51b61cce-ee33-4c5c-9de4-a3c6cf350c46" style="margin: 0px; padding: 0px; display: inline;">Technorati
Tags: <a href="http://technorati.com/tags/Syntax%20Highlighter" rel="tag">Syntax Highlighter</a>,<a href="http://technorati.com/tags/SyntaxHighlighter" rel="tag">SyntaxHighlighter</a>,<a href="http://technorati.com/tags/Google%20Code" rel="tag">Google
Code</a>,<a href="http://technorati.com/tags/ActionScript" rel="tag">ActionScript</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9" />
      </body>
      <title>Extending Language Support in Google Syntax Highlighter</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9.aspx</guid>
      <link>http://www.cptloadtest.com/2008/12/10/Extending-Language-Support-In-Google-Syntax-Highlighter.aspx</link>
      <pubDate>Wed, 10 Dec 2008 21:47:27 GMT</pubDate>
      <description>&lt;p&gt;
As I discussed in an earlier post (&lt;a title="Jay Harris, Blog Post: Blog your code using Google Syntax Highlighter" href="http://www.cptloadtest.com/2008/11/24/BlogYourCodeUsingGoogleSyntaxHighlighter.aspx"&gt;Blog
your code using Google Syntax Highlighter&lt;/a&gt;), Google Syntax Highlighter is a simple
tool that allows bloggers to easily display code in a format that is familiar end
users. The tool renders the code in a very consumable fashion that includes colored
syntax highlighting, line highlighting, and line numbers. Out of the box it supports
most of the common languages of today, and a few from yesterday, but some common languages
are unsupported. Perl, ColdFusion, and Flash's ActionScript all are unloved by Google
Syntax Highlighter, as are many others that you may want to post to your blog. For
these languages, the solution is a custom brush.
&lt;/p&gt;
&lt;h3&gt;Syntax Highlighting Brushes
&lt;/h3&gt;
&lt;p&gt;
For Google Syntax Highlighter, brushes are JavaScript files that govern the syntax
highlighting process, with names following the format of shBrushLanguage.js, such
as shBrushXml.js. Brushes contain information about the keywords, functions, and operators
of a language, as well as the syntax for comments, strings, and other syntax characteristics.
Keyword-level syntax is applied to any specific word in the language, including keywords,
functions, and any word operators, such as &lt;em&gt;and&lt;/em&gt;, &lt;em&gt;or&lt;/em&gt;, and &lt;em&gt;not&lt;/em&gt;.
Regular expressions apply character-level syntax to code, and identifies items such
as character operators, the remainder of an inline comment, or the entire contents
of a comment block. Finally, aliases are defined for the brush; these are the language
aliases that are used within the &lt;em&gt;class&lt;/em&gt; attribute of the Google Syntax Highlighter
&amp;lt;PRE&amp;gt; tag. With this information, the brush applies the syntax highlighting
styles according to the CSS defined for each component of the language. 
&lt;/p&gt;
&lt;h3&gt;Breaking Down Brushes
&lt;/h3&gt;
&lt;h4&gt;Decomposing the SQL Brush
&lt;/h4&gt;
&lt;p&gt;
In JavaScript, everything is an object that can be assigned to a variable, whether
its a number, string, function, or class. Brushes are each a delegate function. The
variable name of the brush must match &lt;em&gt;dp.sh.Brushes.SomeLanguage&lt;/em&gt;.
&lt;/p&gt;
&lt;pre class="js:nocontrols:firstline[1]" name="code"&gt;dp.sh.Brushes.Sql = function() {&lt;/pre&gt;
&lt;p&gt;
Next, define the list of keywords for applying syntax highlighting. Each list is not
an array, but rather a single-space delimited string of keywords that will be highlighted.
Also, multiple keyword lists can exist, such as one list for function names, another
for keywords, and perhaps another for types, and unique styling can be applied to
each grouping (we'll get to styling a little later). 
&lt;/p&gt;
&lt;pre class="js:nocontrols:firstline[2]" name="code"&gt;  var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
    'current_user day isnull left lower month nullif replace right ' +
    'session_user space substring sum system_user upper user year';

  var keywords = 'absolute action add after alter as asc at authorization ' +
    'begin bigint binary bit by cascade char character check checkpoint ' +
    'close collate column commit committed connect connection constraint ' +
    'contains continue create cube current current_date current_time ' +
    'cursor database date deallocate dec decimal declare default delete ' +
    'desc distinct double drop dynamic else end end-exec escape except ' +
    'exec execute false fetch first float for force foreign forward free ' +
    'from full function global goto grant group grouping having hour ' +
    'ignore index inner insensitive insert instead int integer intersect ' +
    'into is isolation key last level load local max min minute modify ' +
    'move name national nchar next no numeric of off on only open option ' +
    'order out output partial password precision prepare primary prior ' +
    'privileges procedure public read real references relative repeatable ' +
    'restrict return returns revoke rollback rollup rows rule schema ' +
    'scroll second section select sequence serializable set size smallint ' +
    'static statistics table temp temporary then time timestamp to top ' +
    'transaction translation trigger true truncate uncommitted union ' +
    'unique update values varchar varying view when where with work';

  var operators = 'all and any between cross in join like not null or ' +
    'outer some';&lt;/pre&gt;
&lt;p&gt;
Following the keyword definitions is the Regular Expression pattern and Style definition
object list. The list, &lt;em&gt;this.regexList&lt;/em&gt;, is an array of pattern/style objects: &lt;em&gt;{regex:
regexPattern, css: classString}&lt;/em&gt;. The &lt;em&gt;regexPattern&lt;/em&gt; is a JavaScript &lt;em&gt;RegExp&lt;/em&gt; object,
and defines the pattern to match in the source code; this pattern can be created using
one of three options within Google Syntax Highlighter. 
&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Predefined Patterns &lt;/dt&gt;
&lt;dd&gt;Within Google Syntax Highlighter, &lt;em&gt;dp.sh.RegexLib&lt;/em&gt; contains five predefined
regular expression patterns. &lt;em&gt;MultiLineCComments&lt;/em&gt; is used for any language
that uses C-style multi-line comment blocks: &lt;em&gt;/* my comment block */&lt;/em&gt;. &lt;em&gt;SingleLineCComments&lt;/em&gt; is
used for any language that uses C-style single line or inline comments: &lt;em&gt;// my
comment&lt;/em&gt;. &lt;em&gt;SingleLinePerlComments&lt;/em&gt; applies for Perl-style single line comments: &lt;em&gt;#
my comment&lt;/em&gt;. &lt;em&gt;DoubleQuotedString&lt;/em&gt; identifies any string wrapped in double-quotes
and &lt;em&gt;SingleQuotedString&lt;/em&gt; identifies strings wrapped in single-quotes. These
options are used in place of creating a new instance of the &lt;em&gt;RegExp&lt;/em&gt; object. 
&lt;/dd&gt;
&lt;dt&gt;Keyword Patterns &lt;/dt&gt;
&lt;dd&gt;Google Syntax Highlighter has a &lt;em&gt;GetKeywords(string)&lt;/em&gt; function which will
build a pattern string based on one of the brush's defined keyword strings. However,
this is only the pattern string, and not the &lt;em&gt;RegExp&lt;/em&gt; object. Pass this value
into the &lt;em&gt;RegExp&lt;/em&gt; constructor: &lt;em&gt;new RegExp(this.GetKeyword(keywords), 'gmi')&lt;/em&gt; 
&lt;/dd&gt;
&lt;dt&gt;Custom Pattern Definition &lt;/dt&gt;
&lt;dd&gt;Create a new &lt;em&gt;RegExp&lt;/em&gt; object using a custom pattern. For example, use &lt;em&gt;new
RegExp('--(.*)$', 'gm')&lt;/em&gt; to match all Sql comments, such as &lt;em&gt;--my comment&lt;/em&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;
For these pattern/style objects, the regular expression pattern is followed by the
name of the CSS class to apply to any regular expression matches. The style sheet
packaged with Google Syntax Highlighter, SyntaxHighlighter.css, already defines the
many CSS classes used by GSH; place the additional styles for your custom brushes
within this file, in a new file, in your HTML, or defined them within the brush using
JavaScript.
&lt;/p&gt;
&lt;pre class="js:nocontrols:firstline[27]" name="code"&gt;  this.regexList = [
    {regex: new RegExp('--(.*)$', 'gm'), css: 'comment'},
    {regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string'},
    {regex: dp.sh.RegexLib.SingleQuotedString, css: 'string'},
    {regex: new RegExp(this.GetKeywords(funcs), 'gmi'), css: 'func'},
    {regex: new RegExp(this.GetKeywords(operators), 'gmi'), css: 'op'},
    {regex: new RegExp(this.GetKeywords(keywords), 'gmi'), css: 'keyword'}
  ];&lt;/pre&gt;
&lt;p&gt;
The delegate definition ends with any style specifications. Apply a style sheet to
the entire code block using &lt;em&gt;this.CssClass&lt;/em&gt;. Also, as mentioned above, the
brush can define custom CSS using this.Style as an alternative to placing the CSS
in HTML or a CSS file. When finished, close the delegate.
&lt;/p&gt;
&lt;pre class="js:nocontrols:firstline[36]" name="code"&gt;  this.CssClass = 'dp-sql';
  this.Style = '.dp-sql .func { color: #ff1493; }' +
    '.dp-sql .op { color: #808080; }'; }
&lt;/pre&gt;
&lt;p&gt;
The final component of a Brush, set outside of your delegate, contains the prototype
declaration and any aliases to apply to the Brush. Aliases consist of a string array
(a real array this time, not a space-delimited string) of language aliases to use,
such as ['c#','c-sharp','csharp']. Alias values must be unique across all defined
brushes that you have included into your site.
&lt;/p&gt;
&lt;pre class="js:nocontrols:firstline[40]" name="code"&gt;dp.sh.Brushes.Sql.prototype = new dp.sh.Highlighter();
dp.sh.Brushes.Sql.Aliases = ['sql'];&lt;/pre&gt;
&lt;h3&gt;Making a Custom Brush (for ActionScript) 
&lt;/h3&gt;
&lt;p&gt;
I like rich media applications, such as those developed in Flash or Silverlight. I
was surprised when I found that Google Syntax Highlighter does not ship with an ActionScript
brush, and more surprised when I found out that no one has written one, yet. So, using
the methods from above, I created one. This isn't meant to be an exhaustive brush,
but more like &lt;a href="http://en.wikipedia.org/wiki/Stone_soup"&gt;Stone Soup&lt;/a&gt;. It's
a start. Please feel free to add to it.
&lt;/p&gt;
&lt;pre class="js" name="code"&gt;dp.sh.Brushes.ActionScript = function() {

  var keywords = 'and break case catch class continue default do dynamic else ' +
    'extends false finally for if implements import in interface NaN new not ' +
    'null or private public return static super switch this throw true try ' +
    'undefined var void while with';

  this.regexList = [{regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment'},
    {regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment'},
    {regex: dp.sh.RegexLib.DoubleQuotedString, css: 'string'},
    {regex: dp.sh.RegexLib.SingleQuotedString, css: 'string'},
    {regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword'}];

    this.CssClass = 'dp-as';
}

dp.sh.Brushes.ActionScript.prototype = new dp.sh.Highlighter();
dp.sh.Brushes.ActionScript.Aliases = ['actionscript', 'as'];&lt;/pre&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:51b61cce-ee33-4c5c-9de4-a3c6cf350c46" style="margin: 0px; padding: 0px; display: inline;"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Syntax%20Highlighter" rel="tag"&gt;Syntax Highlighter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SyntaxHighlighter" rel="tag"&gt;SyntaxHighlighter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Google%20Code" rel="tag"&gt;Google
Code&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ActionScript" rel="tag"&gt;ActionScript&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,e54fb1b0-d25c-4f0b-a4cd-eefa8c3715e9.aspx</comments>
      <category>Blogging</category>
      <category>Flash</category>
      <category>JavaScript</category>
      <category>Programming</category>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=71ba8b42-6bcc-49e3-9f2f-48de47d8f275</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,71ba8b42-6bcc-49e3-9f2f-48de47d8f275.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,71ba8b42-6bcc-49e3-9f2f-48de47d8f275.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=71ba8b42-6bcc-49e3-9f2f-48de47d8f275</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Did you know that <em>yourdomain.com</em> and <em>www.yourdomain.com</em> are actually
different sites? Are they both serving the same content? If so, it may be negatively
impacting your search engine rankings.
</p>
        <h3>Subdomains and the Synonymous 'WWW'
</h3>
        <p>
Sub-domains are the prefix to a domain (<em>http://subdomain.yourdomain.com</em>),
and are treated by browsers, computers, domain name systems (DNS), search engines,
and the general internet as separate, individual web sites. Google's primary web presence, <a href="http://www.google.com">http://www.google.com</a>,
is very different than Google Mail, <a href="http://mail.google.com">http://mail.google.com</a>,
or Google Documents, <a href="http://docs.google.com">http://docs.google.com</a>,
all because of subdomains. However, what many do not realize is that <em>www</em> is,
itself, a subdomain.
</p>
        <p>
A domain, on its own, requires no <em>www</em> prefix; a subdomain-less <em>http://yourdomain.com</em> should
be sufficient for serving up a web site. And since <em>www</em> is a subdomain, dropping
the prefix could potentially return a different response. There are some sites that
will fail to return without the prefix, and some sites that fail with it, but the
most common practice is that the <em>www</em> subdomain is synonymous for no subdomain
at all.
</p>
        <h3>The Synonymous WWW and SEO
</h3>
        <p>
The issue with having two synonymous URLs (<em>http://yourdomain.com</em> and <em>http://www.yourdomain.com</em>)
is that search engines may interpret them as separate sites, even if they are serving
the same content. The two addresses are technically independent and are potentially
serving unique content; to a cautious search engine, even if pages appear to contain
the same content, there may be something different under the covers. This means your
audience's search results returns two entries for the same content. Some users will
happen to click on <em>yourdomain.com</em> while others navigate to <em>www.yourdomain.com</em>,
splitting your traffic, your page hits, your search ranking between two sites, unnecessarily.
</p>
        <p>
HTTP Redirects will cure the issue. If you access <a href="http://google.com">http://google.com</a>,
your browser is instantly redirected to <a href="http://www.google.com">http://www.google.com</a>.
This is done through a HTTP 301 permanent redirect. Search Spiders recognize HTTP
response codes, and understand the 301 as a "use this other URL instead" command.
Many search engines, such as Google, will then update all page entries for the original
URI (<em>http://yourdomain.com</em>) and replace it with the 301's destination URL
(<em>http://www.yourdomain.com</em>). If there is already an entry for the destination
URL, the two entries will be merged together. The search entries for <em>yourdomain.com</em> and <em>www.yourdomain.com</em> will
now share traffic, share page hits, and share search ranking. Instead of having two
entries on the second and third pages of search results, combining these entries may
be just enough to place you on the first page of results.
</p>
        <blockquote>In addition to combining search entries for subdomains, you can also combine
root-level domains through HTTP 301. On this site, in addition to adding the <em>www</em> prefix
if no subdomain is specified, <a href="http://captainloadtest.com">captainloadtest.com</a> will
HTTP 301 redirect to <a href="http://www.cptloadtest.com">www.cptloadtest.com</a>.</blockquote>
        <h3>Combining the Synonyms
</h3>
        <p>
We need a way to implement an HTTP 301 redirect at the domain level for all requests
to a site; however, often we are using applications that may not grant us access to
the source, or we don't have the access into IIS through our host to set up redirects
for ourselves. <a href="http://www.cptloadtest.com/2008/11/11/URLRewritePart2HTTP301MovedPermanently.aspx">URL
Rewrite, Part 2</a> covers a great <a href="http://www.pluralsight.com/community/blogs/fritz/archive/2004/07/21/1651.aspx">drop-in
redirect module</a> by <a href="http://www.pluralsight.com/community/blogs/fritz/">Fritz
Onion</a> that uses a stand-alone assembly with a few additions in web.config to HTTP
301 redirect paths in your domain (it also supports HTTP 302 redirects). This module
is perfect for converting a WordPress blog post URL, such as <a href="http://www.cptloadtest.com/?p=56">cptloadtest.com/?p=56</a>,
to a DasBlog blog post URL like <a href="http://www.cptloadtest.com/2006/05/31/VSNetMacroCollapseAll.aspx">cptloadtest.com/2006/05/31/VSNetMacroCollapseAll.aspx</a>.
However, to redirect domains and subdomains, the module must go a step further and
redirect based on matches against the entire URL, such as directing http:// to https://
or captainloadtest.com to cptloadtest.com, which it does not support. It's time for
some modifications.
</p>
        <pre class="csharp:nocontrols:linenumber[20]" name="code">private void OnBeginRequest(object src, EventArgs e) {
  HttpApplication app = src as HttpApplication;
  string reqUrl = app.Request.Url.AbsoluteUri;
  redirections redirs
    = (redirections) ConfigurationManager.GetSection("redirections");

  foreach (Add a in redirs.Adds) {
    Regex regex = new Regex(a.targetUrl, RegexOptions.IgnoreCase);
    if (regex.IsMatch(reqUrl)) {
      string targetUrl = regex.Replace(reqUrl, a.destinationUrl, 1);

      if (a.permanent) {
        app.Response.StatusCode = 301; // make a permanent redirect
        app.Response.AddHeader("Location", targetUrl);
        app.Response.End();
      }
      else
        app.Response.Redirect(targetUrl);

      break;
    }    
  }
}</pre>
        <p>
By converting <em>app.Request.RawURL</em> to <em>app.Request.AbsoluteUri</em>, the
regular expression will now match against the entire URL, rather than just the requested
path. There is one downside to this change: the value is the actual path processed,
not necessarily what was in the originally requested URL. To this effect, the value
of <em>AbsoluteUri</em> for requesting <a href="http://www.cptloadtest.com?p=56">http://www.cptloadtest.com?p=56</a> is
actually <a href="http://www.cptloadtest.com/default.aspx?p=56">http://www.cptloadtest.com/default.aspx?p=56</a>;
by requesting the root directory, the default page is being processed, not the directory
itself, so <em>default.aspx</em> is added to the URL. Keep this in mind when setting
up your redirection rules. Also, the original code converted the URL to lower case;
with my modifications, I chose to maintain the case of the URL, since sometimes case
matters, and instead ignore case in the regular expression match using <em>RegexOptions.IgnoreCase</em>.
Finally, I made some other minor enhancements, like using the ConfigurationManager,
since ConfigurationSettings is now obsolete, and reusing the matching Regex instance
for replacements.
</p>
        <blockquote>
          <p>
            <strong>Download:</strong>
            <a href="http://www.cptloadtest.com/content/binary/RedirectModule.zip">RedirectModule.zip</a>
          </p>
          <p>
Includes:
</p>
          <ul>
            <li>
Source code for the drop-in Redirect Module 
</li>
            <li>
Sample web.config that uses the module 
</li>
            <li>
Compiled version of redirectmodule.dll</li>
          </ul>
          <p>
The code is based on the original <a href="http://www.pluralsight.com/community/blogs/fritz/archive/2004/07/21/1651.aspx">Redirect
Module</a> by <a href="http://www.pluralsight.com/community/blogs/fritz/default.aspx">Fritz
Onion</a> and the <a href="http://alt.pluralsight.com/wiki/default.aspx/Craig/XmlSerializerSectionHandler.html">Xml
Serializer Section Handler</a> by <a href="http://www.pluralsight.com/community/blogs/craig/default.aspx">Craig
Andera</a>. As always, this code is provided with no warranties or guarantees. Use
at your own risk. Your mileage may vary. Thanks to Fritz Onion for the original work,
and allowing me extend his code further.
</p>
        </blockquote>
        <p>
The usage is the same as Fritz Onion's original module. Drop the assembly into your
site's bin, and place a few lines into the web.config. The example below contains
the rules as they would apply to this site, 301 redirecting <a href="http://www.captainloadtest.com">http://www.captainloadtest.com</a> to <a href="http://www.cptloadtest.com">http://www.cptloadtest.com</a>,
and adding the <em>www</em> subdomain to any domain requests that have no subdomain.
</p>
        <pre class="xml:nocontrols:linenumber[20]" name="code">&lt;?xml version="1.0"?&gt;
&lt;configuration&gt;
  &lt;configSections&gt;
    &lt;section name="redirections"
      type="Pluralsight.Website.XmlSerializerSectionHandler, redirectmodule" /&gt;
  &lt;/configSections&gt;
  &lt;!-- Redirect Rules --&gt;
  &lt;redirections type="Pluralsight.Website.redirections, redirectmodule"&gt;
    &lt;!-- Domain Redirects //--&gt;
    &lt;add targetUrl="captainloadtest\.com/Default\.aspx"
      destinationUrl="cptloadtest.com/" permanent="true" /&gt;
    &lt;add targetUrl="captainloadtest\.com"
      destinationUrl="cptloadtest.com" permanent="true" /&gt;

    &lt;!-- Add 'WWW' to the domain request //--&gt;
    &lt;add targetUrl="://cptloadtest\.com/Default\.aspx"
      destinationUrl="://www.$1.com/" permanent="true" /&gt;
    &lt;add targetUrl="://cptloadtest\.com"
      destinationUrl="://www.$1.com" permanent="true" /&gt;

    &lt;!-- ...More Redirects --&gt;
  &lt;/redirections&gt;
  &lt;system.web&gt;
    &lt;httpModules&gt;
      &lt;add name="RedirectModule"
        type="Pluralsight.Website.RedirectModule, redirectmodule" /&gt;
    &lt;/httpModules&gt;
  &lt;/system.web&gt;
&lt;/configuration&gt;</pre>
        <p>
The component is easy to use, and can redirect your site traffic to any URL you choose.
Neither code changes to the application nor configuration changes to IIS are needed.
By using this module to combine synonymous versions of your URLs, such as alternate
domains or subdomains, you will improve your page ranking through combining duplicate
search result entries. One more step towards your own search engine optimization goals.
</p>
        <h3>URL Rewrite
</h3>
        <ul>
          <li>
Part 1: <a href="http://www.cptloadtest.com/2008/11/06/URLRewritePart1HTTP302TemporarilyRelocated.aspx">HTTP
302, Temporarily Relocated</a></li>
          <li>
Part 2: <a href="http://www.cptloadtest.com/2008/11/11/URLRewritePart2HTTP301MovedPermanently.aspx">HTTP
301, Moved Permanently</a></li>
          <li>
Part 3: Improving SEO and the 'www' subdomain</li>
        </ul>
        <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:796ee61e-98c9-4ab1-8aef-6f3caa04ea6e" style="margin: 0px; padding: 0px; display: inline;">Technorati
Tags: <a href="http://technorati.com/tags/SEO" rel="tag">SEO</a>,<a href="http://technorati.com/tags/Search%20Engine%20Optimization" rel="tag">Search
Engine Optimization</a>,<a href="http://technorati.com/tags/Page%20Rank" rel="tag">Page
Rank</a>,<a href="http://technorati.com/tags/HTTP%20301" rel="tag">HTTP 301</a>,<a href="http://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="http://technorati.com/tags/Fritz%20Onion" rel="tag">Fritz
Onion</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=71ba8b42-6bcc-49e3-9f2f-48de47d8f275" />
      </body>
      <title>URL Rewrite, Part 3: Improving SEO and the 'www' subdomain</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,71ba8b42-6bcc-49e3-9f2f-48de47d8f275.aspx</guid>
      <link>http://www.cptloadtest.com/2008/12/04/URL-Rewrite-Part-3-Improving-SEO-And-The-Www-Subdomain.aspx</link>
      <pubDate>Thu, 04 Dec 2008 21:43:10 GMT</pubDate>
      <description>&lt;p&gt;
Did you know that &lt;em&gt;yourdomain.com&lt;/em&gt; and &lt;em&gt;www.yourdomain.com&lt;/em&gt; are actually
different sites? Are they both serving the same content? If so, it may be negatively
impacting your search engine rankings.
&lt;/p&gt;
&lt;h3&gt;Subdomains and the Synonymous 'WWW'
&lt;/h3&gt;
&lt;p&gt;
Sub-domains are the prefix to a domain (&lt;em&gt;http://subdomain.yourdomain.com&lt;/em&gt;),
and are treated by browsers, computers, domain name systems (DNS), search engines,
and the general internet as separate, individual web sites. Google's primary web presence, &lt;a href="http://www.google.com"&gt;http://www.google.com&lt;/a&gt;,
is very different than Google Mail, &lt;a href="http://mail.google.com"&gt;http://mail.google.com&lt;/a&gt;,
or Google Documents, &lt;a href="http://docs.google.com"&gt;http://docs.google.com&lt;/a&gt;,
all because of subdomains. However, what many do not realize is that &lt;em&gt;www&lt;/em&gt; is,
itself, a subdomain.
&lt;/p&gt;
&lt;p&gt;
A domain, on its own, requires no &lt;em&gt;www&lt;/em&gt; prefix; a subdomain-less &lt;em&gt;http://yourdomain.com&lt;/em&gt; should
be sufficient for serving up a web site. And since &lt;em&gt;www&lt;/em&gt; is a subdomain, dropping
the prefix could potentially return a different response. There are some sites that
will fail to return without the prefix, and some sites that fail with it, but the
most common practice is that the &lt;em&gt;www&lt;/em&gt; subdomain is synonymous for no subdomain
at all.
&lt;/p&gt;
&lt;h3&gt;The Synonymous WWW and SEO
&lt;/h3&gt;
&lt;p&gt;
The issue with having two synonymous URLs (&lt;em&gt;http://yourdomain.com&lt;/em&gt; and &lt;em&gt;http://www.yourdomain.com&lt;/em&gt;)
is that search engines may interpret them as separate sites, even if they are serving
the same content. The two addresses are technically independent and are potentially
serving unique content; to a cautious search engine, even if pages appear to contain
the same content, there may be something different under the covers. This means your
audience's search results returns two entries for the same content. Some users will
happen to click on &lt;em&gt;yourdomain.com&lt;/em&gt; while others navigate to &lt;em&gt;www.yourdomain.com&lt;/em&gt;,
splitting your traffic, your page hits, your search ranking between two sites, unnecessarily.
&lt;/p&gt;
&lt;p&gt;
HTTP Redirects will cure the issue. If you access &lt;a href="http://google.com"&gt;http://google.com&lt;/a&gt;,
your browser is instantly redirected to &lt;a href="http://www.google.com"&gt;http://www.google.com&lt;/a&gt;.
This is done through a HTTP 301 permanent redirect. Search Spiders recognize HTTP
response codes, and understand the 301 as a "use this other URL instead" command.
Many search engines, such as Google, will then update all page entries for the original
URI (&lt;em&gt;http://yourdomain.com&lt;/em&gt;) and replace it with the 301's destination URL
(&lt;em&gt;http://www.yourdomain.com&lt;/em&gt;). If there is already an entry for the destination
URL, the two entries will be merged together. The search entries for &lt;em&gt;yourdomain.com&lt;/em&gt; and &lt;em&gt;www.yourdomain.com&lt;/em&gt; will
now share traffic, share page hits, and share search ranking. Instead of having two
entries on the second and third pages of search results, combining these entries may
be just enough to place you on the first page of results.
&lt;/p&gt;
&lt;blockquote&gt;In addition to combining search entries for subdomains, you can also combine
root-level domains through HTTP 301. On this site, in addition to adding the &lt;em&gt;www&lt;/em&gt; prefix
if no subdomain is specified, &lt;a href="http://captainloadtest.com"&gt;captainloadtest.com&lt;/a&gt; will
HTTP 301 redirect to &lt;a href="http://www.cptloadtest.com"&gt;www.cptloadtest.com&lt;/a&gt;.&lt;/blockquote&gt; 
&lt;h3&gt;Combining the Synonyms
&lt;/h3&gt;
&lt;p&gt;
We need a way to implement an HTTP 301 redirect at the domain level for all requests
to a site; however, often we are using applications that may not grant us access to
the source, or we don't have the access into IIS through our host to set up redirects
for ourselves. &lt;a href="http://www.cptloadtest.com/2008/11/11/URLRewritePart2HTTP301MovedPermanently.aspx"&gt;URL
Rewrite, Part 2&lt;/a&gt; covers a great &lt;a href="http://www.pluralsight.com/community/blogs/fritz/archive/2004/07/21/1651.aspx"&gt;drop-in
redirect module&lt;/a&gt; by &lt;a href="http://www.pluralsight.com/community/blogs/fritz/"&gt;Fritz
Onion&lt;/a&gt; that uses a stand-alone assembly with a few additions in web.config to HTTP
301 redirect paths in your domain (it also supports HTTP 302 redirects). This module
is perfect for converting a WordPress blog post URL, such as &lt;a href="http://www.cptloadtest.com/?p=56"&gt;cptloadtest.com/?p=56&lt;/a&gt;,
to a DasBlog blog post URL like &lt;a href="http://www.cptloadtest.com/2006/05/31/VSNetMacroCollapseAll.aspx"&gt;cptloadtest.com/2006/05/31/VSNetMacroCollapseAll.aspx&lt;/a&gt;.
However, to redirect domains and subdomains, the module must go a step further and
redirect based on matches against the entire URL, such as directing http:// to https://
or captainloadtest.com to cptloadtest.com, which it does not support. It's time for
some modifications.
&lt;/p&gt;
&lt;pre class="csharp:nocontrols:linenumber[20]" name="code"&gt;private void OnBeginRequest(object src, EventArgs e) {
  HttpApplication app = src as HttpApplication;
  string reqUrl = app.Request.Url.AbsoluteUri;
  redirections redirs
    = (redirections) ConfigurationManager.GetSection("redirections");

  foreach (Add a in redirs.Adds) {
    Regex regex = new Regex(a.targetUrl, RegexOptions.IgnoreCase);
    if (regex.IsMatch(reqUrl)) {
      string targetUrl = regex.Replace(reqUrl, a.destinationUrl, 1);

      if (a.permanent) {
        app.Response.StatusCode = 301; // make a permanent redirect
        app.Response.AddHeader("Location", targetUrl);
        app.Response.End();
      }
      else
        app.Response.Redirect(targetUrl);

      break;
    }    
  }
}&lt;/pre&gt;
&lt;p&gt;
By converting &lt;em&gt;app.Request.RawURL&lt;/em&gt; to &lt;em&gt;app.Request.AbsoluteUri&lt;/em&gt;, the
regular expression will now match against the entire URL, rather than just the requested
path. There is one downside to this change: the value is the actual path processed,
not necessarily what was in the originally requested URL. To this effect, the value
of &lt;em&gt;AbsoluteUri&lt;/em&gt; for requesting &lt;a href="http://www.cptloadtest.com?p=56"&gt;http://www.cptloadtest.com?p=56&lt;/a&gt; is
actually &lt;a href="http://www.cptloadtest.com/default.aspx?p=56"&gt;http://www.cptloadtest.com/default.aspx?p=56&lt;/a&gt;;
by requesting the root directory, the default page is being processed, not the directory
itself, so &lt;em&gt;default.aspx&lt;/em&gt; is added to the URL. Keep this in mind when setting
up your redirection rules. Also, the original code converted the URL to lower case;
with my modifications, I chose to maintain the case of the URL, since sometimes case
matters, and instead ignore case in the regular expression match using &lt;em&gt;RegexOptions.IgnoreCase&lt;/em&gt;.
Finally, I made some other minor enhancements, like using the ConfigurationManager,
since ConfigurationSettings is now obsolete, and reusing the matching Regex instance
for replacements.
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;strong&gt;Download:&lt;/strong&gt; &lt;a href="http://www.cptloadtest.com/content/binary/RedirectModule.zip"&gt;RedirectModule.zip&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Includes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Source code for the drop-in Redirect Module 
&lt;/li&gt;
&lt;li&gt;
Sample web.config that uses the module 
&lt;/li&gt;
&lt;li&gt;
Compiled version of redirectmodule.dll&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The code is based on the original &lt;a href="http://www.pluralsight.com/community/blogs/fritz/archive/2004/07/21/1651.aspx"&gt;Redirect
Module&lt;/a&gt; by &lt;a href="http://www.pluralsight.com/community/blogs/fritz/default.aspx"&gt;Fritz
Onion&lt;/a&gt; and the &lt;a href="http://alt.pluralsight.com/wiki/default.aspx/Craig/XmlSerializerSectionHandler.html"&gt;Xml
Serializer Section Handler&lt;/a&gt; by &lt;a href="http://www.pluralsight.com/community/blogs/craig/default.aspx"&gt;Craig
Andera&lt;/a&gt;. As always, this code is provided with no warranties or guarantees. Use
at your own risk. Your mileage may vary. Thanks to Fritz Onion for the original work,
and allowing me extend his code further.
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
The usage is the same as Fritz Onion's original module. Drop the assembly into your
site's bin, and place a few lines into the web.config. The example below contains
the rules as they would apply to this site, 301 redirecting &lt;a href="http://www.captainloadtest.com"&gt;http://www.captainloadtest.com&lt;/a&gt; to &lt;a href="http://www.cptloadtest.com"&gt;http://www.cptloadtest.com&lt;/a&gt;,
and adding the &lt;em&gt;www&lt;/em&gt; subdomain to any domain requests that have no subdomain.
&lt;/p&gt;
&lt;pre class="xml:nocontrols:linenumber[20]" name="code"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;configSections&amp;gt;
    &amp;lt;section name="redirections"
      type="Pluralsight.Website.XmlSerializerSectionHandler, redirectmodule" /&amp;gt;
  &amp;lt;/configSections&amp;gt;
  &amp;lt;!-- Redirect Rules --&amp;gt;
  &amp;lt;redirections type="Pluralsight.Website.redirections, redirectmodule"&amp;gt;
    &amp;lt;!-- Domain Redirects //--&amp;gt;
    &amp;lt;add targetUrl="captainloadtest\.com/Default\.aspx"
      destinationUrl="cptloadtest.com/" permanent="true" /&amp;gt;
    &amp;lt;add targetUrl="captainloadtest\.com"
      destinationUrl="cptloadtest.com" permanent="true" /&amp;gt;

    &amp;lt;!-- Add 'WWW' to the domain request //--&amp;gt;
    &amp;lt;add targetUrl="://cptloadtest\.com/Default\.aspx"
      destinationUrl="://www.$1.com/" permanent="true" /&amp;gt;
    &amp;lt;add targetUrl="://cptloadtest\.com"
      destinationUrl="://www.$1.com" permanent="true" /&amp;gt;

    &amp;lt;!-- ...More Redirects --&amp;gt;
  &amp;lt;/redirections&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;httpModules&amp;gt;
      &amp;lt;add name="RedirectModule"
        type="Pluralsight.Website.RedirectModule, redirectmodule" /&amp;gt;
    &amp;lt;/httpModules&amp;gt;
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;p&gt;
The component is easy to use, and can redirect your site traffic to any URL you choose.
Neither code changes to the application nor configuration changes to IIS are needed.
By using this module to combine synonymous versions of your URLs, such as alternate
domains or subdomains, you will improve your page ranking through combining duplicate
search result entries. One more step towards your own search engine optimization goals.
&lt;/p&gt;
&lt;h3&gt;URL Rewrite
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
Part 1: &lt;a href="http://www.cptloadtest.com/2008/11/06/URLRewritePart1HTTP302TemporarilyRelocated.aspx"&gt;HTTP
302, Temporarily Relocated&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
Part 2: &lt;a href="http://www.cptloadtest.com/2008/11/11/URLRewritePart2HTTP301MovedPermanently.aspx"&gt;HTTP
301, Moved Permanently&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
Part 3: Improving SEO and the 'www' subdomain&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:796ee61e-98c9-4ab1-8aef-6f3caa04ea6e" style="margin: 0px; padding: 0px; display: inline;"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/SEO" rel="tag"&gt;SEO&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Search%20Engine%20Optimization" rel="tag"&gt;Search
Engine Optimization&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Page%20Rank" rel="tag"&gt;Page
Rank&lt;/a&gt;,&lt;a href="http://technorati.com/tags/HTTP%20301" rel="tag"&gt;HTTP 301&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Fritz%20Onion" rel="tag"&gt;Fritz
Onion&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=71ba8b42-6bcc-49e3-9f2f-48de47d8f275" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,71ba8b42-6bcc-49e3-9f2f-48de47d8f275.aspx</comments>
      <category>ASP.Net</category>
      <category>Blogging</category>
      <category>Programming</category>
      <category>SEO</category>
    </item>
    <item>
      <trackback:ping>http://www.cptloadtest.com/Trackback.aspx?guid=417c2df3-d32c-436c-8c5c-46e1fe4b2808</trackback:ping>
      <pingback:server>http://www.cptloadtest.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.cptloadtest.com/PermaLink,guid,417c2df3-d32c-436c-8c5c-46e1fe4b2808.aspx</pingback:target>
      <dc:creator>Jay Harris</dc:creator>
      <wfw:comment>http://www.cptloadtest.com/CommentView,guid,417c2df3-d32c-436c-8c5c-46e1fe4b2808.aspx</wfw:comment>
      <wfw:commentRss>http://www.cptloadtest.com/SyndicationService.asmx/GetEntryCommentsRss?guid=417c2df3-d32c-436c-8c5c-46e1fe4b2808</wfw:commentRss>
      <slash:comments>9</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://code.google.com/p/syntaxhighlighter/">Google Syntax Highlighter</a> is
a simple tool that allows bloggers to easily display code in a format that is familiar
end users. The tool renders the code in a very consumable fashion that includes colored
syntax highlighting, line highlighting, and line numbers.
</p>
        <pre class="csharp:nocontrols" name="code">/*
This is an example of how Google
Syntax Highlighter can highlight and display syntax
to you, the end user
*/
public void HelloWorld()
{
  // I have some comments
  Console.WriteLine("Hello, World!");
}</pre>
        <p>
It is purely a client-side tool, as all of the processing is done strictly within
the browser through JavaScript. There is no server-side processing. Since it is all
JavaScript, you don't need special Copy/Paste plugins and macros installed to your
favorite IDE or your blog authoring tool. (I am leery of random plugins and installing
them into the software that I use to feed my family.) To including code in your blog
post, copy your code from Visual Studio, Notepad, Flash, Firebug, or any tool that
displays text, and paste it in to your post. As of v1.5.1, Google Syntax Highlighter
supports C, C++, C#, CSS, Delphi, HTML, Java, JavaScript, PHP, Pascal, Python, Ruby,
SQL, VB, VB.NET, XML, XSLT, and all of this is just what comes out of the box.
</p>
        <h3>Setting Up Syntax Highlighter
</h3>
        <p>
To get Syntax Highlighter running on your blog, <a href="http://code.google.com/p/syntaxhighlighter/downloads/list">download</a> the
latest version of the RAR archive and extract the code. The archive contains a parent
folder, <em>dp.SyntaxHighlighter</em>, with three child folders:
</p>
        <blockquote>
          <pre>dp.SyntaxHighlighter
  \Scripts         //Production-ready (Compressed) scripts
  \Styles          //CSS
  \Uncompressed    //Human-readable (Uncompressed/Debug) scripts</pre>
        </blockquote>
        <p>
Once the archive is extracted, upload <em>dp.SyntaxHighlighter</em> to your blog.
Feel free to rename the folder if you like, though I did not. It is not necessary
to upload the <em>Uncompressed</em> folder and its files; they are best used for debugging
or for viewing the code, as the files in the <em>Scripts</em> folder have been compressed
to reduce bandwidth by having most of their whitespace removed.
</p>
        <p>
After you have uploaded the files, you will need to add script and style references
to your site's HTML. This is code is not for your posts, but rather for your blog
template. In DasBlog, I place this code in the &lt;HEAD&gt; block of my <em>homeTemplate.blogtemplate</em> file.
Remember to change the file paths to match the path to where you uploaded the code.
</p>
        <pre class="html:nocontrols:nogutter" name="code">&lt;link type="text/css" rel="stylesheet"
  href="dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css"&gt;&lt;/link&gt;
&lt;script language="javascript" src="dp.SyntaxHighlighter/Scripts/shCore.js"&gt;&lt;/script&gt;
&lt;script language="javascript" src="dp.SyntaxHighlighter/Scripts/shBrushCSharp.js"&gt;&lt;/script&gt;
&lt;script language="javascript" src="dp.SyntaxHighlighter/Scripts/shBrushXml.js"&gt;&lt;/script&gt;
&lt;script language="javascript"&gt;
window.onload = function () {
  dp.SyntaxHighlighter.ClipboardSwf = 'dp.SyntaxHighlighter/Scripts/clipboard.swf';
  dp.SyntaxHighlighter.HighlightAll('code');
}
&lt;/script&gt;</pre>
        <p>
To make the tool most efficient, including minimizing the code download by the client
browser, highlighting is only enabled for the languages that you specify. The highlighting
rules for each language is available through a file referred to as a Brush. The code
sample above enables only C# and XML/HTML by including the core file, <em>shCore.js</em>,
the C# brush, <em>shBrushCSharp.js</em> and the XML/HTML brush, <em>shBrushXml.js</em>.
A unique brush file is available for each of the supported languages, and only the
core file is required. These brushes are located in your <em>Scripts</em> directory
(the human-readable version is in the <em>Uncompressed</em> folder). Include only
the brushes that you like; if you forgot a language brush, the code will still display
on your page, but as unformatted text.
</p>
        <pre>&lt;!-- Unformatted HTML Code / No Brush --&gt;
&lt;p id="greeting"&gt;Hi, mom &amp; dad!&lt;/p&gt;</pre>
        <pre class="html:nogutter:nocontrols" name="code">&lt;!-- Formatted HTML Code --&gt;
&lt;p id="greeting"&gt;Hi, mom &amp; dad!&lt;/p&gt;</pre>
        <h3>Making Syntax Highlighter Go
</h3>
        <p>
Now that the application is deployed to the site, how does it get applied to a post?
Paste the code into the HTML view of your post, inside of a &lt;PRE&gt; tag. Create
a <em>name</em> attribute on your tag with a value of <em>code</em>, and a <em>class</em> attribute
set to the language and options you are using.
</p>
        <pre class="html:nocontrols:nogutter" name="code">&lt;pre name="code" class="c-sharp"&gt;
  public void HelloWorld()
  {
    Console.WriteLine("Hello, World!");
  }
&lt;/pre&gt;</pre>
        <p>
One catch is the code must be first made HTML-safe. All angle-brackets, <em>&lt;tag&gt;</em>,
must be converted to their HTML equivalent, <em>&amp;lt;tag&amp;gt;</em>, as well
as ampersands, <em>&amp;</em> to <em>&amp;amp;</em>. I also find it helpful if your
code-indentation uses two-spaces, rather than tabs.
</p>
        <pre class="html:nocontrols" name="code">&lt;!-- Pre-converted code --&gt;
&lt;p&gt;Hi, mom &amp; dad!&lt;/p&gt;</pre>
        <pre class="html:nocontrols" name="code">&lt;!-- Converted code --&gt;
&lt;pre name="code" class="html"&gt;
  &amp;lt;p&amp;gt;Hi, mom &amp;amp; dad!&amp;lt;/p&amp;gt;
&lt;/pre&gt;</pre>
        <p>
The <em>class</em> attribute is made up of both language and option aliases. These
aliases consist of one language followed by your desired options, all in a colon delimited
list.
</p>
        <p>
class="language[:option[:option[:option]]]"
</p>
        <p>
The value of language is any of Syntax Highlighter's defined language aliases, such
as <em>c#</em>, <em>csharp</em>, or <em>c-sharp</em> for C#, or <em>rb</em>, <em>ruby</em>, <em>rails</em>,
or <em>ror</em> for Ruby. See: <a href="http://code.google.com/p/syntaxhighlighter/wiki/Languages">full
list</a> of available languages.
</p>
        <p>
Options allow for such things as turning off the plain text / copy / about controls
(<em>nocontrols</em>), turning off the line number gutter (<em>nogutter</em>), or
specifying the number of the first line (<em>firstline[n]</em>). A JavaScript code
block with no controls header, and starting the line numbering at 34 would have a <em>class</em> attribute
value of <em>class="js:nocontrols:linenumber[34]"</em>. See: <a href="http://code.google.com/p/syntaxhighlighter/wiki/Configuration">full
list</a> of available options.
</p>
        <h3>Extending Syntax Highlighter
</h3>
        <p>
Because Google Syntax Highlighter is entirely in JavaScript, you have access to all
of the code. Edit it however you like to suit your needs. Additionally, brushes are
very easy to create, and include little more than a list of a highlighted language's
keywords in a string and an array of language aliases. Creating a brush for ActionScript
or QBasic would not take much time. Language brushes exist in the wild for <a href="http://nevstokes.com/includes/syntax/scripts/shBrushPerl.js">Perl</a>, <a href="http://pcnorb.blogspot.com/2008/10/shbrushbatch-for-google.html">DOS
Batch</a>, and <a href="http://blog.tech-cats.com/2007/10/syntax-highlighting-for-coldfusion.html">ColdFusion</a>.
</p>
        <p>
In a future post I plan on discussing Brush Creation in depth through creating a brush
for ActionScript.
</p>
        <h3>Comparing Syntax Highlighter to Others
</h3>
        <p>
I am a fan of this tool, though that should be obvious considering it is what I use
on this blog. I like how readable the code is, how extendable it is, and how easy
it is to use. I don't like its compatibility--or lack thereof--with RSS; since all
of the work is done in JavaScript, and RSS doesn't do JavaScript, there is no syntax
highlighting, numbers, or options within a feed, though the code formatting is still
maintained. Other tools, like the <em><a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/">CopySourceAsHtml</a></em> plugin
for Visual Studio or <em><a href="http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html">Insert
Code Snippet</a></em> for Windows Live Writer convert your code into formatted HTML,
where all of the syntax highlighting is applied through HTML attributes and embedded
CSS. Their methods are much easier than Syntax Highlighter, since there are no stylesheets
or JavaScript files to include in your HTML, and you don't have to worry about making
your code HTML-safe. Also, their method works in RSS feeds. However, there isn't the
same level of control. Through Syntax Highlighter's extendibility, I can theme my
code views, such as if I wanted them to look like my personal Visual Studio theme.
Through Syntax Highlighter, I can also make changes at a later time, and those changes
will immediately reflected in all past posts, whereas making modifications to the
HTML/embedded CSS pattern is much more difficult.
</p>
        <h3>Final Thoughts
</h3>
        <p>
I like CopySourceAsHtml in Visual Studio. I used it for years on this blog. But I
code in more languages than VB.Net or C#, and the plugin isn't available within the
Flash or LoadRunner IDE. I was also frustrated with pasting my code in, only to find
that it was too wide for my blog theme's margins, and would have to go back to Visual
Studio, change my line endings, and repeat the process. I'm sticking with Google Syntax
Highlighter. It works for all of my languages (as soon as I finish writing my ActionScript
brush), and when my line endings are too long, I simply change my HTML. And in my
HTML, my code still looks like code, rather than a mess of embedded style. I have
to sacrifice RSS formatting, but as a presentation developer that is very particular
about his HTML, I am glad for the customization and control.
</p>
        <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5e03f5f4-120c-4ce0-96ea-32867691f7e7" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati
Tags: <a href="http://technorati.com/tags/SyntaxHighlighter" rel="tag">SyntaxHighlighter</a>,<a href="http://technorati.com/tags/Syntax%20Highlighter" rel="tag">Syntax
Highlighter</a>,<a href="http://technorati.com/tags/Google%20Code" rel="tag">Google
Code</a></div>
        <img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=417c2df3-d32c-436c-8c5c-46e1fe4b2808" />
      </body>
      <title>Blog your code using Google Syntax Highlighter</title>
      <guid isPermaLink="false">http://www.cptloadtest.com/PermaLink,guid,417c2df3-d32c-436c-8c5c-46e1fe4b2808.aspx</guid>
      <link>http://www.cptloadtest.com/2008/11/24/Blog-Your-Code-Using-Google-Syntax-Highlighter.aspx</link>
      <pubDate>Mon, 24 Nov 2008 15:41:50 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://code.google.com/p/syntaxhighlighter/"&gt;Google Syntax Highlighter&lt;/a&gt; is
a simple tool that allows bloggers to easily display code in a format that is familiar
end users. The tool renders the code in a very consumable fashion that includes colored
syntax highlighting, line highlighting, and line numbers.
&lt;/p&gt;
&lt;pre class="csharp:nocontrols" name="code"&gt;/*
This is an example of how Google
Syntax Highlighter can highlight and display syntax
to you, the end user
*/
public void HelloWorld()
{
  // I have some comments
  Console.WriteLine("Hello, World!");
}&lt;/pre&gt;
&lt;p&gt;
It is purely a client-side tool, as all of the processing is done strictly within
the browser through JavaScript. There is no server-side processing. Since it is all
JavaScript, you don't need special Copy/Paste plugins and macros installed to your
favorite IDE or your blog authoring tool. (I am leery of random plugins and installing
them into the software that I use to feed my family.) To including code in your blog
post, copy your code from Visual Studio, Notepad, Flash, Firebug, or any tool that
displays text, and paste it in to your post. As of v1.5.1, Google Syntax Highlighter
supports C, C++, C#, CSS, Delphi, HTML, Java, JavaScript, PHP, Pascal, Python, Ruby,
SQL, VB, VB.NET, XML, XSLT, and all of this is just what comes out of the box.
&lt;/p&gt;
&lt;h3&gt;Setting Up Syntax Highlighter
&lt;/h3&gt;
&lt;p&gt;
To get Syntax Highlighter running on your blog, &lt;a href="http://code.google.com/p/syntaxhighlighter/downloads/list"&gt;download&lt;/a&gt; the
latest version of the RAR archive and extract the code. The archive contains a parent
folder, &lt;em&gt;dp.SyntaxHighlighter&lt;/em&gt;, with three child folders:
&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;dp.SyntaxHighlighter
  \Scripts         //Production-ready (Compressed) scripts
  \Styles          //CSS
  \Uncompressed    //Human-readable (Uncompressed/Debug) scripts&lt;/pre&gt;&lt;/blockquote&gt; 
&lt;p&gt;
Once the archive is extracted, upload &lt;em&gt;dp.SyntaxHighlighter&lt;/em&gt; to your blog.
Feel free to rename the folder if you like, though I did not. It is not necessary
to upload the &lt;em&gt;Uncompressed&lt;/em&gt; folder and its files; they are best used for debugging
or for viewing the code, as the files in the &lt;em&gt;Scripts&lt;/em&gt; folder have been compressed
to reduce bandwidth by having most of their whitespace removed.
&lt;/p&gt;
&lt;p&gt;
After you have uploaded the files, you will need to add script and style references
to your site's HTML. This is code is not for your posts, but rather for your blog
template. In DasBlog, I place this code in the &amp;lt;HEAD&amp;gt; block of my &lt;em&gt;homeTemplate.blogtemplate&lt;/em&gt; file.
Remember to change the file paths to match the path to where you uploaded the code.
&lt;/p&gt;
&lt;pre class="html:nocontrols:nogutter" name="code"&gt;&amp;lt;link type="text/css" rel="stylesheet"
  href="dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css"&amp;gt;&amp;lt;/link&amp;gt;
&amp;lt;script language="javascript" src="dp.SyntaxHighlighter/Scripts/shCore.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="dp.SyntaxHighlighter/Scripts/shBrushCSharp.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="dp.SyntaxHighlighter/Scripts/shBrushXml.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript"&amp;gt;
window.onload = function () {
  dp.SyntaxHighlighter.ClipboardSwf = 'dp.SyntaxHighlighter/Scripts/clipboard.swf';
  dp.SyntaxHighlighter.HighlightAll('code');
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;
To make the tool most efficient, including minimizing the code download by the client
browser, highlighting is only enabled for the languages that you specify. The highlighting
rules for each language is available through a file referred to as a Brush. The code
sample above enables only C# and XML/HTML by including the core file, &lt;em&gt;shCore.js&lt;/em&gt;,
the C# brush, &lt;em&gt;shBrushCSharp.js&lt;/em&gt; and the XML/HTML brush, &lt;em&gt;shBrushXml.js&lt;/em&gt;.
A unique brush file is available for each of the supported languages, and only the
core file is required. These brushes are located in your &lt;em&gt;Scripts&lt;/em&gt; directory
(the human-readable version is in the &lt;em&gt;Uncompressed&lt;/em&gt; folder). Include only
the brushes that you like; if you forgot a language brush, the code will still display
on your page, but as unformatted text.
&lt;/p&gt;
&lt;pre&gt;&amp;lt;!-- Unformatted HTML Code / No Brush --&amp;gt;
&amp;lt;p id="greeting"&amp;gt;Hi, mom &amp;amp; dad!&amp;lt;/p&amp;gt;&lt;/pre&gt;&lt;pre class="html:nogutter:nocontrols" name="code"&gt;&amp;lt;!-- Formatted HTML Code --&amp;gt;
&amp;lt;p id="greeting"&amp;gt;Hi, mom &amp;amp; dad!&amp;lt;/p&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Making Syntax Highlighter Go
&lt;/h3&gt;
&lt;p&gt;
Now that the application is deployed to the site, how does it get applied to a post?
Paste the code into the HTML view of your post, inside of a &amp;lt;PRE&amp;gt; tag. Create
a &lt;em&gt;name&lt;/em&gt; attribute on your tag with a value of &lt;em&gt;code&lt;/em&gt;, and a &lt;em&gt;class&lt;/em&gt; attribute
set to the language and options you are using.
&lt;/p&gt;
&lt;pre class="html:nocontrols:nogutter" name="code"&gt;&amp;lt;pre name="code" class="c-sharp"&amp;gt;
  public void HelloWorld()
  {
    Console.WriteLine("Hello, World!");
  }
&amp;lt;/pre&amp;gt;&lt;/pre&gt;
&lt;p&gt;
One catch is the code must be first made HTML-safe. All angle-brackets, &lt;em&gt;&amp;lt;tag&amp;gt;&lt;/em&gt;,
must be converted to their HTML equivalent, &lt;em&gt;&amp;amp;lt;tag&amp;amp;gt;&lt;/em&gt;, as well
as ampersands, &lt;em&gt;&amp;amp;&lt;/em&gt; to &lt;em&gt;&amp;amp;amp;&lt;/em&gt;. I also find it helpful if your
code-indentation uses two-spaces, rather than tabs.
&lt;/p&gt;
&lt;pre class="html:nocontrols" name="code"&gt;&amp;lt;!-- Pre-converted code --&amp;gt;
&amp;lt;p&amp;gt;Hi, mom &amp;amp; dad!&amp;lt;/p&amp;gt;&lt;/pre&gt;&lt;pre class="html:nocontrols" name="code"&gt;&amp;lt;!-- Converted code --&amp;gt;
&amp;lt;pre name="code" class="html"&amp;gt;
  &amp;amp;lt;p&amp;amp;gt;Hi, mom &amp;amp;amp; dad!&amp;amp;lt;/p&amp;amp;gt;
&amp;lt;/pre&amp;gt;&lt;/pre&gt;
&lt;p&gt;
The &lt;em&gt;class&lt;/em&gt; attribute is made up of both language and option aliases. These
aliases consist of one language followed by your desired options, all in a colon delimited
list.
&lt;/p&gt;
&lt;p&gt;
class="language[:option[:option[:option]]]"
&lt;/p&gt;
&lt;p&gt;
The value of language is any of Syntax Highlighter's defined language aliases, such
as &lt;em&gt;c#&lt;/em&gt;, &lt;em&gt;csharp&lt;/em&gt;, or &lt;em&gt;c-sharp&lt;/em&gt; for C#, or &lt;em&gt;rb&lt;/em&gt;, &lt;em&gt;ruby&lt;/em&gt;, &lt;em&gt;rails&lt;/em&gt;,
or &lt;em&gt;ror&lt;/em&gt; for Ruby. See: &lt;a href="http://code.google.com/p/syntaxhighlighter/wiki/Languages"&gt;full
list&lt;/a&gt; of available languages.
&lt;/p&gt;
&lt;p&gt;
Options allow for such things as turning off the plain text / copy / about controls
(&lt;em&gt;nocontrols&lt;/em&gt;), turning off the line number gutter (&lt;em&gt;nogutter&lt;/em&gt;), or
specifying the number of the first line (&lt;em&gt;firstline[n]&lt;/em&gt;). A JavaScript code
block with no controls header, and starting the line numbering at 34 would have a &lt;em&gt;class&lt;/em&gt; attribute
value of &lt;em&gt;class="js:nocontrols:linenumber[34]"&lt;/em&gt;. See: &lt;a href="http://code.google.com/p/syntaxhighlighter/wiki/Configuration"&gt;full
list&lt;/a&gt; of available options.
&lt;/p&gt;
&lt;h3&gt;Extending Syntax Highlighter
&lt;/h3&gt;
&lt;p&gt;
Because Google Syntax Highlighter is entirely in JavaScript, you have access to all
of the code. Edit it however you like to suit your needs. Additionally, brushes are
very easy to create, and include little more than a list of a highlighted language's
keywords in a string and an array of language aliases. Creating a brush for ActionScript
or QBasic would not take much time. Language brushes exist in the wild for &lt;a href="http://nevstokes.com/includes/syntax/scripts/shBrushPerl.js"&gt;Perl&lt;/a&gt;, &lt;a href="http://pcnorb.blogspot.com/2008/10/shbrushbatch-for-google.html"&gt;DOS
Batch&lt;/a&gt;, and &lt;a href="http://blog.tech-cats.com/2007/10/syntax-highlighting-for-coldfusion.html"&gt;ColdFusion&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
In a future post I plan on discussing Brush Creation in depth through creating a brush
for ActionScript.
&lt;/p&gt;
&lt;h3&gt;Comparing Syntax Highlighter to Others
&lt;/h3&gt;
&lt;p&gt;
I am a fan of this tool, though that should be obvious considering it is what I use
on this blog. I like how readable the code is, how extendable it is, and how easy
it is to use. I don't like its compatibility--or lack thereof--with RSS; since all
of the work is done in JavaScript, and RSS doesn't do JavaScript, there is no syntax
highlighting, numbers, or options within a feed, though the code formatting is still
maintained. Other tools, like the &lt;em&gt;&lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;CopySourceAsHtml&lt;/a&gt;&lt;/em&gt; plugin
for Visual Studio or &lt;em&gt;&lt;a href="http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html"&gt;Insert
Code Snippet&lt;/a&gt;&lt;/em&gt; for Windows Live Writer convert your code into formatted HTML,
where all of the syntax highlighting is applied through HTML attributes and embedded
CSS. Their methods are much easier than Syntax Highlighter, since there are no stylesheets
or JavaScript files to include in your HTML, and you don't have to worry about making
your code HTML-safe. Also, their method works in RSS feeds. However, there isn't the
same level of control. Through Syntax Highlighter's extendibility, I can theme my
code views, such as if I wanted them to look like my personal Visual Studio theme.
Through Syntax Highlighter, I can also make changes at a later time, and those changes
will immediately reflected in all past posts, whereas making modifications to the
HTML/embedded CSS pattern is much more difficult.
&lt;/p&gt;
&lt;h3&gt;Final Thoughts
&lt;/h3&gt;
&lt;p&gt;
I like CopySourceAsHtml in Visual Studio. I used it for years on this blog. But I
code in more languages than VB.Net or C#, and the plugin isn't available within the
Flash or LoadRunner IDE. I was also frustrated with pasting my code in, only to find
that it was too wide for my blog theme's margins, and would have to go back to Visual
Studio, change my line endings, and repeat the process. I'm sticking with Google Syntax
Highlighter. It works for all of my languages (as soon as I finish writing my ActionScript
brush), and when my line endings are too long, I simply change my HTML. And in my
HTML, my code still looks like code, rather than a mess of embedded style. I have
to sacrifice RSS formatting, but as a presentation developer that is very particular
about his HTML, I am glad for the customization and control.
&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5e03f5f4-120c-4ce0-96ea-32867691f7e7" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/SyntaxHighlighter" rel="tag"&gt;SyntaxHighlighter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Syntax%20Highlighter" rel="tag"&gt;Syntax
Highlighter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Google%20Code" rel="tag"&gt;Google
Code&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.cptloadtest.com/aggbug.ashx?id=417c2df3-d32c-436c-8c5c-46e1fe4b2808" /&gt;</description>
      <comments>http://www.cptloadtest.com/CommentView,guid,417c2df3-d32c-436c-8c5c-46e1fe4b2808.aspx</comments>
      <category>Blogging</category>
      <category>JavaScript</category>
      <category>Programming</category>
      <category>Reviews</category>
      <category>Tools</category>
    </item>
  </channel>
</rss>