<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechKnack &#187; blogs</title>
	<atom:link href="http://techknack.net/category/blogs/feed/" rel="self" type="application/rss+xml" />
	<link>http://techknack.net</link>
	<description>The rantings of a techie</description>
	<lastBuildDate>Thu, 24 Dec 2009 19:53:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Templating: Variable Date</title>
		<link>http://techknack.net/php-templating-variable-date/</link>
		<comments>http://techknack.net/php-templating-variable-date/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 01:38:55 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=282</guid>
		<description><![CDATA[In building a template system, you may want some way to inject date info using a timestamp (perhaps generated through mktime() ) and date().  But you don&#8217;t want the format to be dependent on the template parser, but rather specified through the variable in the template itself.

$template = preg_replace(
    &#34;#\%date(\:\s*(.*?))?\%#ei&#34;,
  [...]]]></description>
			<content:encoded><![CDATA[<p>In building a template system, you may want some way to inject date info using a timestamp (perhaps generated through mktime() ) and date().  But you don&#8217;t want the format to be dependent on the template parser, but rather specified through the variable in the template itself.</p>
<pre class="brush: php;">
$template = preg_replace(
    &quot;#\%date(\:\s*(.*?))?\%#ei&quot;,
    &quot;date(('\\2'!=\&quot;\&quot;?'\\2':\$date_format), \$timestamp)&quot;,
    $template
);
</pre>
<p>This falls on the &#8220;advanced&#8221; side of intermediate, I would think, so here&#8217;s an explanation:</p>
<p>This is a standard preg_replace($pattern, $replacement, $source_string).  What we want to do is replace the variable %date% in $template with a date string generated from $timestamp.  But %date% is too limiting; within the template, we&#8217;d like to write something like %date: F j, Y% to get a date like &#8220;March 12, 2009,&#8221; or any other format.</p>
<p>The regular expression is like so: <strong>#\%date(\:\s*(.*?))?\%#ei</strong>.  The &#8220;hashes&#8221; (#) here act as delimiters for the regex; the <em>e</em> and <em>i</em> after the second hash turn on &#8220;eval&#8217;d replacement&#8221; and &#8220;case-insensitivty&#8221;, respectively (<a href="http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php">learn more about PCRE regex modifiers at php.net</a>).  So the regex to deal with is <strong>\%date(\:\s*(.*?))?\%</strong>.  The <strong>\%</strong> are the markers for our template variables; <strong>date</strong> is the name of the variable to look for.  <strong>(\:\s*(.*?))?</strong> matches zero or one instances of our &#8220;variable modifier&#8221;: a colon, followed by any amount of whitespace (including none), followed by any number of any characters (where the extra <strong>?</strong> makes the <strong>.*</strong> &#8220;non-greedy&#8221;; it&#8217;ll stop &#8220;eating&#8221; characters when it reaches the next percent sign).  For preg_replace, this will place our date() format in &#8220;\\2&#8243; if it is present; if it is not present, &#8220;\\2&#8243; will not be set.</p>
<p>The replacement is as follows: <strong>&#8220;date((&#8217;\\2&#8242;!=\&#8221;\&#8221;?&#8217;\\2&#8242;:\$date_format), \$timestamp)&#8221;</strong>.  preg_replace will insert the matched date format from the regex into every occurrence of &#8220;\\2&#8243; in the replacement string, and then run eval() on the resulting string to get the replacement value (all thanks to the <em>e</em> modifier in the regex).  Assuming our regex matched &#8220;F j, Y&#8221; as the match, we&#8217;ll get <strong>&#8220;date((&#8217;F j, Y&#8217;!=\&#8221;\&#8221;?&#8217;F j, Y&#8217;:\$date_format), \$timestamp)&#8221;</strong>.  The <strong>(&#8217;F j, Y&#8217;!=\&#8221;\&#8221;?&#8217;F j, Y&#8217;:\$date_format)</strong> part chooses the date format; if the match is not set (ie, an empty string), use whatever is in the variable $date_format; else, if the date format was matched, use it.  This allows us to use %date% in the template, to default to a server-side specified format.</p>
<p>And there it is.  You can now put &#8220;%date: F j, Y%&#8221; in your template, and it will be expanded to &#8220;March 12, 2009&#8243; (depending on the actual date, of course <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).  That is, if your templating system works in the first place&#8230;</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=282&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/php-templating-variable-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Layout</title>
		<link>http://techknack.net/new-layout/</link>
		<comments>http://techknack.net/new-layout/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 06:04:40 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=180</guid>
		<description><![CDATA[I know, I updated the site design less than a year ago.  I decided I could do better than a fixed-width design built for 800 by 600 resolution displays.
The new layout, also my first WordPress theme (yay), is a bit more flexible.  By default, it is full-browser-width, with reasonable space allotted to the [...]]]></description>
			<content:encoded><![CDATA[<p>I know, I updated the site design <a href="http://techknack.net/time-for-a-redesign/">less than a year ago</a>.  I decided I could do better than a fixed-width design built for 800 by 600 resolution displays.</p>
<p>The new layout, also my first WordPress theme (yay), is a bit more flexible.  By default, it is full-browser-width, with reasonable space allotted to the right sidebar and the main content areas.  For modern browsers that support max-width CSS, the design will stop &#8220;growing&#8221; at 1,000 pixels, just short of full-width on a 1024&#215;768 resolution.  The content and sidebar columns have, in addition to their own (possibly redundant) max-widths, reasonable min-widths.  This is to prevent the content from being squashed beyond recognition should someone with an abnormally small browser come along.  In this case, the sidebar will drop below the content area when the point-of-no-more-shrinkage is reached.</p>
<p>There&#8217;s a whopping 6.3KB worth of images to load per page.  Unfortunately, they&#8217;re almost all translucent gradients, so IE6 users will receive *html hacks in the CSS to clear most of them, to avoid unsightly grey blocks that would otherwise obscure text.  The color scheme was heavily based on <i>Cool Grays Lavender</i> by julievonderropp on <a href="http://kuler.adobe.com/">Kuler</a>.</p>
<p>In addition to the right-hand sidebar, I put two separate &#8220;widget areas&#8221; in the footer, one above the other.  The bottom section is primarily for displaying the archives links &#8212; there are a lot of them (one for each month the site&#8217;s been up), and they don&#8217;t fit very nicely in vertical sidebars.  The top section is simply another sidebar, designed to fit up to three widgets.</p>
<p>A decent amount of work went into the comments section, along with some help and ideas from a comments template posted at <a href="http://www.christianmontoya.com/2006/10/15/full-featured-commentsphp-template-for-wordpress/">ChristianMontoya.com</a>.  Even/odd comments are striped for easy differentiation.  The post&#8217;s author&#8217;s name is retrieved via an extra database query, and comments made by that author are given an additional class name, used to attach another gradient image to the background.  Also, comments and pingbacks are listed separately, comments first, along with their respective counts.  This change is extended to the front and search pages, where another extra query is executed for each post to obtain the number of actual comments for that post.  A small amount of extra overhead, but it might be worth it for the extra accuracy.  Unfortunately, I haven&#8217;t yet thought of a succinct way of displaying the total number of responses (comments plus pingbacks).</p>
<p>Concerning the actual theme construction, at the outset, I really had no clue about making WordPress themes, other than that it involved PHP, HTML, CSS, and some MySQL.  The design itself started as an HTML file on my local harddrive, just an idea I started tweaking around.  Fortunately, in my research I ran across a <a href="http://www.wpdesigner.com/2007/02/19/so-you-want-to-create-wordpress-themes-huh/">full-fledged WordPress theme tutorial</a> on WPDesigner.com; it&#8217;s really a great tutorial for beginners to the whole WordPress skinning idea.  For what the tutorial lacked, the <a href="http://codex.wordpress.org/">WordPress Codex</a> was a great reference, along with a couple of google searches for some unclear topics.  I did have to consult <a href="http://php.net/">PHP.net</a> a couple of times, but that&#8217;s normal for any PHP project.  Overall, though, it wasn&#8217;t too difficult, just a matter of putting the right pieces in the right places <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>So, there you have it.  My first post in almost a month (sorry <img src='http://techknack.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ) is a self-centered look-at-me post.  Criticisms, comments, and congratulations on the design are welcome.  As are lectures about what coding, design, or WordPress standards I may have broken <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .  In other words, I look forward to your feedback.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=180&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/new-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Down and Dirty Un-spam WordPress Comments</title>
		<link>http://techknack.net/down-and-dirty-un-spam-wordpress-comments/</link>
		<comments>http://techknack.net/down-and-dirty-un-spam-wordpress-comments/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 19:21:38 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=175</guid>
		<description><![CDATA[One thing I&#8217;ve learned in running my own blog is that spam-bots really, really like open forms.  I&#8217;m sure experienced bloggers will smile (and say &#8220;that&#8217;s all?&#8221;) when I say that I get probably no less than 5 spam comments per day.  With WordPress, it&#8217;s simple to be rid of spam &#8212; just [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I&#8217;ve learned in running my own blog is that spam-bots really, <i>really</i> like open forms.  I&#8217;m sure experienced bloggers will smile (and say &#8220;that&#8217;s all?&#8221;) when I say that I get probably no less than 5 spam comments per day.  With WordPress, it&#8217;s simple to be rid of spam &#8212; just click the comment&#8217;s &#8220;spam&#8221; link in the moderation section.  Unfortunately, with so many spam and so few real comments, the spam link becomes second nature to click.  And today I accidentally spammed a legit comment.  Oops.</p>
<p>There doesn&#8217;t seem to be much info on Google regarding un-spamming comments, so I thought I&#8217;d look into the database to see what I could do.  Comments are held in the MySQL table &#8220;[wp-prefix]comments&#8221; (the default is &#8220;wp_comments&#8221;).  One of the columns in that table is &#8220;comment_approved&#8221;.  Unmoderated comments have a 0 in this column.  Approved comments have a 1.  And marked-as-spam comments have &#8220;spam&#8221;.  To un-spam a comment, use your MySQL client (be it phpMyAdmin or the MySQL command line program) to edit the comment_approved field back to 0 (or 1) in the appropriate comment&#8217;s row.  Unfortunately, &#8220;delete&#8221; really means &#8220;delete&#8221; &#8212; a deleted comment is removed from the database altogether, so you&#8217;ll have to scrounge legit comments back together from the emails that WP sends.</p>
<p>I really don&#8217;t see why the WP devs didn&#8217;t build an un-spam function into the WP admin.  It seems like an obvious addition, given the structure of the database.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=175&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/down-and-dirty-un-spam-wordpress-comments/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Message to the Readers: School&#8217;s Started</title>
		<link>http://techknack.net/message-to-the-readers-schools-started/</link>
		<comments>http://techknack.net/message-to-the-readers-schools-started/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 18:54:56 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=172</guid>
		<description><![CDATA[As of approximately two weeks ago, the Fall &#8216;08 school semester has officially started.  This semester, I&#8217;m taking 18 credit hours over 6 classes.  To give you an idea of how busy that is, this school considers 12 credit hours to be &#8220;full time&#8221;, and I normally take around 15 credit hours.  [...]]]></description>
			<content:encoded><![CDATA[<p>As of approximately two weeks ago, the Fall &#8216;08 school semester has officially started.  This semester, I&#8217;m taking 18 credit hours over 6 classes.  To give you an idea of how busy that is, this school considers 12 credit hours to be &#8220;full time&#8221;, and I normally take around 15 credit hours.  As such, my posting schedule for the next few months will be sparse at best.  Most likely, I will only post shorter articles as I come across ideas.</p>
<p>If any of you have a question you think I could answer (that other readers would be interested in, of course <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), by all means, <a href="http://techknack.net/about/">shoot me an email</a>.  Tips on possible subjects would be appreciated, too.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=172&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/message-to-the-readers-schools-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving from Blogger to Wordpress</title>
		<link>http://techknack.net/moving-from-blogger-to-wordpress/</link>
		<comments>http://techknack.net/moving-from-blogger-to-wordpress/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 15:37:35 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=153</guid>
		<description><![CDATA[Recently, I&#8217;ve reached the point, like probably many bloggers have, where I&#8217;ve outgrown Blogger.
Don&#8217;t get me wrong, Blogger was great to use as I began my blogging journey.  A freely-hosted blog is probably the best way to test the waters, so you don&#8217;t spend $10 on a domain and who knows how much on [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve reached the point, like probably many bloggers have, where I&#8217;ve outgrown Blogger.</p>
<p>Don&#8217;t get me wrong, Blogger was great to use as I began my blogging journey.  A freely-hosted blog is probably the best way to test the waters, so you don&#8217;t spend $10 on a domain and who knows how much on hosting for a blog that&#8217;ll be dead in a few months.  It&#8217;s just that hacking functionality into Blogger, when that functionality can easily be gained through a WordPress plugin, gets old after a while.  And besides, I had to do something with my new server <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>The main problem with moving is that free services like Blogger give you very, very little control over the server.  The best way to maintain whatever incoming links and &#8220;Google juice&#8221; you&#8217;ve built up, assuming you&#8217;re moving to a new domain, is to set up a 301 Permanent Redirect to the new blog.  And, well, Blogger doesn&#8217;t like that idea <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>The next best thing, though nowhere near as desirable, is to setup various client-side redirects, and hope that at least one of them works.  This, of course, pretty much leaves behind whatever link juice you may have, but it&#8217;s better than users coming to a seemingly dead blog without some way to find the regularly-updated version.</p>
<p>Here&#8217;s what I did: throughout the course of using blogspot, I&#8217;ve been using &#8220;post pages&#8221;, which is essentially a permalink.  You can setup self-hosted WordPress to use the .htaccess file to redirect users from the old URL version (with year, month, and trailing .html) to the new version used by WordPress.  For details, see <a href='http://www.blogbloke.com/migrating-redirecting-blogger-wordpress-htaccess-apache-best-method/'>BlogBloke.com&#8217;s article</a> (currently under construction, see the <a href='http://64.233.167.104/search?q=cache:www.blogbloke.com/migrating-redirecting-blogger-wordpress-htaccess-apache-best-method/'>google cached version</a>).  To test if your implementation works (after importing all your Blogger posts), pull up an article on the blogspot blog, replace the blog.blogspot.com in the url with your WordPress blog&#8217;s base address, and hit enter. You should be redirected to that same article on your WP blog.</p>
<p>As for performing the actual redirect, there are several ways to go, including javascript, meta redirects, and plain links within your pages.  I set up a simple javascript redirect that goes in the head of the blog template.  This takes the current URL, replaces the blogspot part with the new blog&#8217;s URL, and sends the user there.  Instant client-side redirect, provided the user has javascript enabled.</p>
<pre class="brush: jscript;">
&lt;script type='text/javascript'&gt;
// &lt; ![CDATA[

document.location.href=document.location.href.replace(/oldblog.blogspot.com/, &quot;newblog.com&quot;);

// ]]&gt;
&lt;/script&gt;
</pre>
<p>I put this directly under the title tags, so it would be executed as soon as possible.  Then, it occurred to me to move the Google Analytics tracker code above that, so that I would still receive stats from that site.<br />
Note: The CDATA tags are from the fact that New Blogger templates use XML.  Occasionally, I would get issues with using my javascript without CDATA tags surrounding the code.  These may or may not be necessary.
</p>
<p>In addition to the javascript redirect, I put a Text widget above the main blog content, alerting users to the new location, in case they&#8217;ve disabled javascript.<br />
<a href='http://techknack.net/wp-content/uploads/screenshot1.png'><img src="http://techknack.net/wp-content/uploads/screenshot1.png" alt="" title="screenshot1" width="500" height="117" class="aligncenter size-full wp-image-154" /></a><br />
I wouldn&#8217;t recommend using a <a href='http://www.libertyinteractivemarketing.com/blog/successfully-forwarding-blogger-to-wordpress/'>meta tag redirect</a>, unless you can somehow incorporate the current article&#8217;s URL into it.  You don&#8217;t want to auto-redirect the user from the article they want to read to the homepage of your new blog, even if you give them a 6-second warning.  It&#8217;s just downright inconsiderate.  If you can&#8217;t &#8220;seamlessly&#8221; redirect them, tell them how they can get to the new place, and leave it at that.</p>
<p>Once you&#8217;ve got the web-based redirects working, you need to take care of your RSS readers.  If you used Blogger (which, since you&#8217;re reading this, I assume you have), check out their RSS redirect service.  If you&#8217;re using FeedBurner, it&#8217;s almost as simple.  FeedBurner has acquired a FeedBurner WordPress plugin called <a href='http://www.google.com/support/feedburner/bin/answer.py?answer=78483&#038;topic=13252'>FeedSmith</a>.  Simply install the plugin, re-burn your FeedBurner feed (&#8221;Edit feed details&#8221; from your feed&#8217;s dashboard, and enter your WordPress feed, which should be at http://blog.com/feed/), and enter your FeedBurner URL in the appropriate field in WordPress&#8217;s Settings &rarr; FeedBurner page.  Your existing readers shouldn&#8217;t notice any change (they may receive duplicate entries of your recent articles), and any future subscribers will be redirected to your FeedBurner feed.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=153&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/moving-from-blogger-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Blogger Scheduled Publishing</title>
		<link>http://techknack.net/blogger-scheduled-publishing/</link>
		<comments>http://techknack.net/blogger-scheduled-publishing/#comments</comments>
		<pubDate>Wed, 07 May 2008 21:03:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/blogger-scheduled-publishing/</guid>
		<description><![CDATA[Seems I&#8217;m a little late  
Finally!  Blogger now officially supports Scheduled Publishing!  Simply create a new post, click the &#8220;Post Options&#8221; dropdown (next to the Labels field), set &#8220;Post date and time:&#8221; to a future date, and publish.  The post will then be filed as &#8220;Scheduled&#8221;.
To view your scheduled posts, go [...]]]></description>
			<content:encoded><![CDATA[<p><i><a href='http://digg.com/search?s=blogger+scheduled&#038;submit=Search&#038;section=all&#038;type=both&#038;area=all&#038;sort=new'>Seems I&#8217;m a little late</a> <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </i></p>
<p>Finally!  <a href='http://buzz.blogger.com/2008/05/blogger-now-schedules-future-dated.html'>Blogger now officially supports Scheduled Publishing</a>!  Simply create a new post, click the &#8220;Post Options&#8221; dropdown (next to the Labels field), set &#8220;Post date and time:&#8221; to a future date, and publish.  The post will then be filed as &#8220;Scheduled&#8221;.</p>
<p>To view your scheduled posts, go to the &#8220;Posting&#8221; tab, select &#8220;Edit Posts&#8221;, and choose to show either &#8220;All&#8221; or &#8220;Scheduled&#8221; posts.</p>
<p>&#8216;Bout time <img src='http://techknack.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<img src="http://techknack.net/?ak_action=api_record_view&id=126&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/blogger-scheduled-publishing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration tips?</title>
		<link>http://techknack.net/migration-tips/</link>
		<comments>http://techknack.net/migration-tips/#comments</comments>
		<pubDate>Mon, 05 May 2008 22:26:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/migration-tips/</guid>
		<description><![CDATA[For a while now, I&#8217;ve been considering migrating this blog from Blogger to WordPress.  I&#8217;ve never actually used WordPress before, but I&#8217;ve heard lots of ranting and raving about this WordPress plugin and that WordPress plugin.  I love FireFox and its extension capabilities, and the idea of using plugins for stuff on my [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now, I&#8217;ve been considering migrating this blog from Blogger to WordPress.  I&#8217;ve never actually used WordPress before, but I&#8217;ve heard lots of ranting and raving about this WordPress plugin and that WordPress plugin.  I love FireFox and its extension capabilities, and the idea of using plugins for stuff on my blog is very appealing.  Even better, WordPress has a <a href='http://wordpress.com/blog/2007/02/06/new-blogger-importer/'>New Blogger import tool</a>, which claims to make the transition rather easy.</p>
<p>The main holdback I have is forwarding existing traffic.  I already use <a href='http://feedburner.com/'>Feedburner</a>, so forwarding my RSS should be a snap.  But what about Google traffic?  What about all those blogspot-centric URLs I&#8217;ve scattered about the net?  They will inevitably link straight here, but is there a way to automatically forward incoming links to the new location?  And what about the ever-important (sarcasm) technorati ranking?  Granted, I&#8217;m <a href='http://technorati.com/blogs/techknack.blogspot.com'>only rank 17</a> right now, but I&#8217;d rather not lose what little &#8220;credibility&#8221; I have.</p>
<p>Does anyone have any tips for a truly seamless Blogger-to-WordPress transition?  Or at least some tips on maintaining my current traffic?</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=125&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/migration-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blue Spring Blogger template</title>
		<link>http://techknack.net/blue-spring-blogger-template/</link>
		<comments>http://techknack.net/blue-spring-blogger-template/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 00:32:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/blue-spring-blogger-template/</guid>
		<description><![CDATA[
Over my spring break, I decided to spruce up my blog a bit (read: redesign).  Unfortunately, I am design-challenged and too cheap to pay someone to create a new design for me.  So I started perusing the designs available at OSWD, and found a nice template called Blue Spring.
 After finding, downloading, and [...]]]></description>
			<content:encoded><![CDATA[<div class="download"><a href="http://www.box.net/shared/ng7wm4by88"><img src='http://img.villagephotos.com/p/2005-1/928148/dlex.gif' alt='Download template files' /></a></div>
<p>Over my spring break, I decided to spruce up my blog a bit (read: redesign).  Unfortunately, I am design-challenged and too cheap to pay someone to create a new design for me.  So I started perusing the designs available at <a href='http://oswd.org'><acronym title='Open Source Web Design'>OSWD</acronym></a>, and found a nice template called <a href='http://www.oswd.org/design/preview/id/3649'>Blue Spring</a>.</p>
<p><a href="http://bp2.blogger.com/_6C7jhrvrP14/R9nKBW1ySJI/AAAAAAAAAEQ/AkmF3GQZxDk/s1600-h/screenshot3.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/R9nKBW1ySJI/AAAAAAAAAEQ/AkmF3GQZxDk/s320/screenshot3.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5177391371298949266" /></a> After finding, downloading, and familiarizing myself with the template&#8217;s HTML and CSS, I set about hacking it into Blogger XML submission.  It was mostly an effort of looking at my existing template, as well as the generated HTML, and revamping the CSS to support the structure produced by the Blogger widgets (mainly the Blog and Header widgets).</p>
<p>After combining HTML and CSS into one XML file and making sure the CSS supported all the widgets one might want in the sidebar, I set about &#8220;making it customizable&#8221;.  Not everyone likes to muck about in the CSS code &#8212; some (most?) prefer to use Blogger&#8217;s &#8220;Fonts and Colors&#8221; tab to do what they can.  Supporting this was a simple matter of pulling out all the major colors and fonts into skin variables.  After that, I made sure that all the widget sections had the proper settings.</p>
<p>Now, a &#8220;how to&#8221; on usage.  In the original template, there were designated spots above and below the header for links, namely &#8220;navigation&#8221; and &#8220;other&#8221;.  I have left these as two empty sections, with a limit of one widget each.  They are optimized for the &#8220;Link List&#8221; widget, but, as you can see by the search bar I&#8217;ve placed at the top, you may be able to fit other widgets in them.  Beware when putting something other than a LinkList widget in the bottom slot, though &#8212; it can seriously mess up your layout (and can usually be fixed by removing the widget).</p>
<p><a href="http://bp2.blogger.com/_6C7jhrvrP14/R9nTsW1ySKI/AAAAAAAAAEY/R16OGZMS0M4/s1600-h/screenshot2.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/R9nTsW1ySKI/AAAAAAAAAEY/R16OGZMS0M4/s320/screenshot2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5177402005637974178" /></a> The &#8220;Page Elements&#8221; layout is slightly a mess; as I have no clue how to modify the XML file to fix this &#8212; without melting the layout &#8212; you&#8217;ll just have to deal with it <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   The &#8220;edit&#8221; link for the top LinkList section is hidden by the logo.  To get around this, move the widget to the lower slot (or a slot on the sidebar), edit it, then move it back.</p>
<p>Before uploading the template to your blog, be sure to upload the images to a hosting service, and replace all images used in the template with the appropriate URLs.  Searching the XML file for &#8220;images/&#8221; will show you the images to be replaced.  If you have a favicon for your blog, find the following section:</p>
<pre class="brush: xml;">
  &lt;!-- link href='#favicon-url-here' rel='shortcut icon' type='image/gif'/&gt;
  &lt;link href='#favicon-url-here' rel='icon' type='image/gif'/ --&gt;
</pre>
<p>Uncomment it, and replace &#8220;#favicon-url-here&#8221; with the URL of your favicon.  If you want a small RSS icon to the right of the bottom LinkList section, find this section:</p>
<pre class="brush: xml;">
        &lt;!-- span id='feedlink'&gt;
          &lt;a href='#your-rss-feed-here'&gt;
            &lt;img alt='Subscribe' src='images/rss.gif' /&gt;
          &lt;/a&gt;
        &lt;/span --&gt;
</pre>
<p>Uncomment it, and replace &#8220;#your-rss-feed-here&#8221; with the URL of the feed you want visitors to subscribe to.
</p>
<p>As the devil is in the details, you will, more likely than not, come across issues if you try to add custom or third-party code to the sidebar (or any other part of the template, for that matter).  The CSS has been tweaked to make most of the official Blogger widgets look good; anything unofficial is just that, unofficial.  Please keep in mind that I am not your personal HelpDesk, nor will I likely have time to help everyone &#8220;fix&#8221; their blog.  There are Blogger help forums, as well as HTML/CSS help forums, that will be more than happy to help you, if you ask.</p>
<p>For you web standardistas out there, I don&#8217;t know if the Blogger engine puts out standards-compliant code or not, but almost any Bloger blog you try to validate will turn out hundreds of errors <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  as such, I didn&#8217;t quite worry about making the template standards-compliant.  If it is, it&#8217;s completely on accident <img src='http://techknack.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />   The theme does NOT render properly on IE6-.  Seems to work fine on IE7, IE8 is unknown.</p>
<p>As always, with anything remotely related to technology, BACKUP!!!  Go to your blog&#8217;s layout, select the &#8220;Edit HTML&#8221; tab, and click the &#8220;Download Full Template&#8221; link.  Save the XML file to your computer, so you have a backup to restore from if you prefer your old template.</p>
<p>The template&#8217;s footer (and some comments in the CSS) credits the designer, <a href='http://www.dcarter.co.uk/'>DCarter</a>, and the one who converted it into a template (Templater?), <a href='http://techknack.blogspot.com/'>me</a>.  If you do use this template, please leave this info intact.</p>
<p><strong>[ 5/11/08 ] Update</strong>: Turns out the first version would break when text size was increased, if you had menu items.  Fixed by adding overflow:hidden; to the first #main-wrapper declaration.  <del>Still doesn&#8217;t work in IE6.</del>  Also added overflow:hidden; to the #sidebar declaration, and the layout now <em>mostly</em> works in IE6 (there are still a few quirks, but it&#8217;s usable).  The sidebar is strangely displaced in IE5.01 and slightly off in IE5.5 and IE4.01 according to <a href='http://browsershots.org'>browsershots.org</a>, but the template now supports &#8220;all major browsers on all major operating systems&#8221;.</p>
<p>Additional links:<br />
<a href='http://www.box.net/shared/ng7wm4by88'>Download the Blogger template</a><br />
<a href='http://www.oswd.org/files/designs/3649/blue_spring/'>OSWD: Blue Spring template</a><br />
<a href='http://www.headsetoptions.org/2007/03/24/wordpress-theme-blue-spring-released/'>Blue Spring WordPress template</a><br />
<a href='http://oswd.org'>Open Source Web Design</a><br />
<a href='http://eternicode.deviantart.com/art/Aurora-Banner-79894765'>The header image I use</a></p>
<p>This template featured at <a href='http://the-blogger-templates.blogspot.com/2008/03/blue-spring-blogger-template.html'>The Blogger Templates</a></p>
<img src="http://techknack.net/?ak_action=api_record_view&id=107&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/blue-spring-blogger-template/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Super-target your AdSense ads</title>
		<link>http://techknack.net/super-target-your-adsense-ads/</link>
		<comments>http://techknack.net/super-target-your-adsense-ads/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 20:14:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/super-target-your-adsense-ads/</guid>
		<description><![CDATA[While perusing the AdSense Optimization Tips, I came across a section on Blogtimizing, optimizing ad placement on a blog.  That article, however, linked to the more interesting concept of section targeting &#8211; the idea of super-targeting your ads to a specific section of content, rather than all content on the page (which, on a [...]]]></description>
			<content:encoded><![CDATA[<p>While perusing the <a href='https://www.google.com/adsense/support/bin/static.py?page=tips.html&#038;sourceid=aso&#038;subid=ww-ww-et-asui&#038;medium=link'>AdSense Optimization Tips</a>, I came across a section on <a href='https://www.google.com/adsense/support/bin/answer.py?answer=43869'>Blogtimizing</a>, optimizing ad placement on a blog.  That article, however, linked to the more interesting concept of <a href='https://www.google.com/adsense/support/bin/answer.py?answer=23168'>section targeting</a> &#8211; the idea of super-targeting your ads to a specific section of content, rather than all content on the page (which, on a blog, includes navigation links, blog title, sidebar content, and all sorts of non-topic-specific junk).  From the section targeting page:</p>
<blockquote>
<p>Section targeting allows you to suggest sections of your text and HTML content that you&#8217;d like us to emphasize&#8230;when matching ads to your site&#8217;s content. By providing us with your suggestions, you can assist us in improving your ad targeting. We recommend that only those familiar with HTML attempt to implement section targeting.</p>
<p>To implement section targeting, you&#8217;ll need to add a set of special HTML comment tags to your code. These tags will mark the beginning and end of whichever section(s) you&#8217;d like to emphasize&#8230;for ad targeting.</p>
<p>The HTML tags to emphasize a page section take the following format:<br />
&lt;!&#8211; google_ad_section_start &#8211;&gt;</p>
<p>&lt;!&#8211; google_ad_section_end &#8211;&gt;</p>
</blockquote>
<p>So, essentially, to super-target your ads, just wrap the relevant content in these special HTML comment tags.  For Blogger blogs using the XML templates, however, it&#8217;s a bit trickier.  More likely than not, you&#8217;ll want to target your ads to the content of your blog posts.  To do so, it would appear obvious to wrap the &lt;data:post.body/&gt; Blogger tag with the appropriate comment tags, like so:</p>
<pre class="brush: xml;">
&lt;!-- google_ad_section_start --&gt;
    &lt;p&gt;&lt;data:post.body/&gt;&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</pre>
<p>The problem is, Blogger&#8217;s template engine strips out all HTML comments contained within &lt;b:includable&gt; tags.  Fortunately, Blogger themselves have a solution to this issue: &lt;data:adStart/&gt; and &lt;data:adEnd/&gt;:</p>
<pre class="brush: xml;">
&lt;data:adStart/&gt;
    &lt;p&gt;&lt;data:post.body/&gt;&lt;/p&gt;
&lt;data:adEnd/&gt;
</pre>
<p>These tags will be expanded by Blogger into the desired HTML comments, allowing you to super-target your AdSense ads.
</p>
<p>Beware of being too specific in your targeting, however.  Google has put in measures against &#8220;keyword spamming&#8221; your ads:</p>
<blockquote><p>Include a significant amount of content within the section targeting tags; including insufficient content may result in less relevant ads or PSAs. Please also be sure only to emphasize significant sections of your site&#8217;s relevant content, since it&#8217;s against our program policies to the ad targeting to result in ads that are not relevant to the content of your pages.</p>
</blockquote>
<p>That means no exclusively targeting your post titles or post tags.</p>
<p>Also of use are the &#8220;ignore tags&#8221; that go hand-in-hand with the targeting tags:</p>
<blockquote><p>You can also designate sections you&#8217;d like to have ignored by adding a (weight=ignore) to the starting tag:</p>
<p>&lt;!&#8211; google_ad_section_start(weight=ignore) &#8211;&gt;</p>
</blockquote>
<p>This is good for topic-irrelevant content that appears on pages, specifically the content-ridden sidebar(s) that almost every Blogger blog has.  Simply wrap the sidebar div in these tags to de-emphasize its content.</p>
<p>The way I set up my ads was to enable per-post ads (blog layout -&gt; page elements -&gt; click &#8220;edit&#8221; on the &#8220;Blog Posts&#8221; element -&gt; check &#8220;Show ads between posts&#8221;), then move (only!) the &lt;data:adCode/&gt; line to the desired position within my post template, after the fashion of an article on <a href='http://woork.blogspot.com/2007/11/place-google-adsense-below-posts-title.html'>Woork</a>.  I then removed all Blogger-added adStart and adEnd tags, and placed my own around my &lt;data:post.body/&gt; line, as specified above.  I&#8217;ve found it works rather well on the individual posts&#8217; pages, though it seems to get a little confused on the front page.  This is understandable, since there are multiple targeted content sections to process on the homepage, all with different content.</p>
<p>After specifying the targeted sections, I wrapped my sidebar content in the ignore tags.  In my template HTML (no need to &#8220;expand widget templates&#8221;), I searched for the sidebar section:</p>
<pre class="brush: xml;">
&lt;b:section class='sidebar' id='sidebar' preferred='no'&gt;
...all the various widgets...
&lt;/b:section&gt;
</pre>
<p>And wrapped the entire section in the ignore tags:</p>
<pre class="brush: xml;">
&lt;!-- google_ad_section_start(weight=ignore) --&gt;
&lt;b:section class='sidebar' id='sidebar' preferred='no'&gt;
...all the various widgets...
&lt;/b:section&gt;
&lt;!-- google_ad_section_end(weight=ignore) --&gt;
</pre>
<p>And, voila, ads that are more relevant to my content!  Enjoy!</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=106&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/super-target-your-adsense-ads/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The JS behind &quot;Most Popular Posts&quot;</title>
		<link>http://techknack.net/the-js-behind-most-popular-posts/</link>
		<comments>http://techknack.net/the-js-behind-most-popular-posts/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 18:16:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/the-js-behind-most-popular-posts/</guid>
		<description><![CDATA[Original article: Most Popular Posts list for blogger
In my last article &#8220;Most Popular Posts list for blogger,&#8221; I presented my version of Chris Riley&#8217;s Analytics API workaround.  I also promised to go through the JavaScript for those who were interested  
The JS
Without further ado, the code:

&#60;div id=&#34;popularposts&#34;&#62;&#60;noscript&#62;Please enable javascript to view the most [...]]]></description>
			<content:encoded><![CDATA[<p>Original article: <a href="http://techknack.blogspot.com/2008/01/most-popular-posts-list-for-blogger.html">Most Popular Posts list for blogger</a></p>
<p>In my last article &#8220;Most Popular Posts list for blogger,&#8221; I presented my version of <a href="http://cgriley.com/">Chris Riley&#8217;s</a> <a href="http://blogoscoped.com/forum/120951.html">Analytics API workaround</a>.  I also promised to go through the JavaScript for those who were interested <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>The JS</h3>
<p>Without further ado, the code:</p>
<pre class="brush: jscript;">
&lt;div id=&quot;popularposts&quot;&gt;&lt;noscript&gt;Please enable javascript to view the most popular posts list.&gt;/noscript&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
function topcontentCallback(obj) {
    try {
        var url,title,output;
        output='&lt;ul&gt;';
        for (i=0; i &lt; obj.count; i++) {
            url = obj.value.items[i].url;
            try {
                title = obj.value.items[i].name[0].content;
                title = title.replace('&lt;title&gt;', '');
                title = title.replace('&lt;/title&gt;', '');
                title = title.replace('Tech Knack: ', '');
            }
            // if we didn't get the title (bad Pipe!), give a pseudo-
            //   title from the URL
            catch (e) {
                title = url.substring(
                             url.lastIndexOf(&quot;/&quot;)+1,
                             url.lastIndexOf(&quot;.html&quot;)
                         ).replace(/\-/g, &quot; &quot;);
            }
            //remove the &lt;title&gt; tags the pipe leaves in.
            output+= '&lt;li&gt;&lt;a href=&quot;'+url+
                     '&quot; title=&quot;'+title+'&quot;&gt;'+title+'&lt;/a&gt;&lt;/li&gt;';
        }
        output += '&lt;/ul&gt;';
        document.getElementById(&quot;popularposts&quot;).innerHTML = output;
    }
    catch (e) {
        var error = &quot;Error fetching data: &quot;+e;
        if (e.toString().indexOf('i')!=-1) error += &quot;&lt;br /&gt;i: &quot;+i;
        document.getElementById(&quot;popularposts&quot;).innerHTML=error;
    }
}
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pipes.yahoo.com/pipes/pipe.run?_id=bi6F5qPK3BGfvuxf1vC6Jw&amp;_render=json&amp;_callback=topcontentCallback&quot; type=&quot;text/javascript&quot;&gt; &lt;/script&gt;
</pre>
</p>
<h3>The Div</h3>
<p>
<pre class="brush: xml;">&lt;div id=&quot;popularposts&quot;&gt;&lt;noscript&gt;Please enable javascript to view the most popular posts list.&lt;/noscript&gt;&lt;/div&gt;</pre>
<p>
The div with id &#8220;popularposts&#8221; is the div whose content will be replaced with our list.  It initially contains some noscript text for those without JS.</p>
<h3>The Function</h3>
<p>
<pre class="brush: jscript;">function topcontentCallback(obj) {</pre>
<p>
The topcontentCallback function is the function used to handle the JSON output by the Yahoo! Pipe.  &#8220;obj&#8221; is the JSON string passed in by the Pipe.</p>
<p>
<pre class="brush: jscript;">
    try {
        ......
    }
    catch (e) {
        var error = &quot;Error fetching data: &quot;+e;
        if (e.toString().indexOf('i')!=-1) error += &quot;&lt;br /&gt;i: &quot;+i;
        document.getElementById(&quot;popularposts&quot;).innerHTML=error;
    }
</pre>
<p>
We enclose the main processing code in a try block.  Firefox2 and IE6 (and presumably 7 and 8 ) support try blocks in JS.  This way, if there is a problem processing the data (a referrenced node is missing, etc) the user gets a nice little error message rather than a JS error thrown by the browser.  In te case of an error, the previously mentioned div&#8217;s content is set to &#8220;Error: &lt;error message&gt;&#8221;.  Not useful to visitors, per se, but good for debugging your script.  The &#8220;if (e.toString().indexOf(&#8217;i')!=-1)&#8221; part simply appends i&#8217;s value (from within the try block) to the error message.  Again, good for debugging.</p>
<p>
<pre class="brush: jscript;">
        var url,title,output;
        output='&lt;ul&gt;';
</pre>
<p>Declare some variables, initialize the output variable (we use an unordered list for display).</p>
<p>
<pre class="brush: jscript;">
        for (i=0; i &lt; obj.count; i++) {
            url = obj.value.items[i].url;
</pre>
<p>We loop over the items given by the Pipe.  First we pull the url of the popular page.</p>
<p>
<pre class="brush: jscript;">
            try {
                title = obj.value.items[i].name[0].content;
                title = title.replace('&lt;title&gt;', '');
                title = title.replace('&lt;/title&gt;', '');
                title = title.replace('Tech Knack: ', '');
            }
            // if we didn't get the title (bad Pipe!), give a pseudo-
            //   title from the URL
            // if we didn't get the title (bad Pipe!), give a pseudo-
            //   title from the URL
            catch (e) {
                title = url.substring(
                             url.lastIndexOf(&quot;/&quot;)+1,
                             url.lastIndexOf(&quot;.html&quot;)
                         ).replace(/\-/g, &quot; &quot;);
            }
            //remove the &lt;title&gt; tags the pipe leaves in.
</pre>
<p>Here we try to pull the page&#8217;s title, as pulled by the Pipe.  I&#8217;ve noticed that, occasionally, the Pipe will have trouble getting the page&#8217;s title, and so leaves the title blank, which doesn&#8217;t play well with our script.  Within the try block, I get the content of the title; I then try to replace (remove) the title tags and the site&#8217;s title.  If there is no title text from the Pipe, this will throw an error.  In the catch block, we use the page&#8217;s url to &#8220;guess&#8221; the title, removing the &#8220;.html&#8221; at the end using url.substring(), and replacing the intermittent dashes which replace punctuation and spaces with .replace().  These two commands are strung together to be url.substring().replace().  The result: if the article titled &#8220;CSS trick &#8211; two background images&#8221; doesn&#8217;t have a title attribute in our JSON, the title is given as &#8220;css trick two background images&#8221;.  For this reason, you should enable &#8220;post pages&#8221; in your template&#8217;s preferences.</p>
<p>
<pre class="brush: jscript;">
            output+= '&lt;li&gt;&lt;a href=&quot;'+url+
             '&quot; title=&quot;'+title+'&quot;&gt;'+title+'&lt;/a&gt;&lt;/li&gt;';
</pre>
<p>Here we append to our ul an li containing a link to the popular page.</p>
<p>
<pre class="brush: jscript;">
        }
        output += '&lt;/ul&gt;';
        document.getElementById(&quot;popularposts&quot;).innerHTML = output;
</pre>
<p>After the for loop, we add the final &lt;/ul&gt; and replace the div&#8217;s contents.</p>
<p>All this is just a function; without calling it, it is no good.</p>
<p>
<pre class="brush: xml;">
&lt;script src=&quot;http://pipes.yahoo.com/pipes/pipe.run?_id=bi6F5qPK3BGfvuxf1vC6Jw&amp;_render=json&amp;_callback=topcontentCallback&quot; type=&quot;text/javascript&quot;&gt; &lt;/script&gt;
</pre>
<p>This imports the JSON created by the Pipe, telling it to render in JSON format (&#038;_render=json) and to call our function to handle the JSON (&#038;_callback=topcontentCallback).  If you copy and paste the src to a browser window, you&#8217;ll see that the content is simply a function call with the JSON as the parameter:</p>
<pre class="brush: jscript;">
topcontentCallback({&quot;count&quot;:7,&quot;value&quot;:{&quot;title&quot;:&quot;TechKnack&quot;.......}});
</pre></p>
<img src="http://techknack.net/?ak_action=api_record_view&id=95&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/the-js-behind-most-popular-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

