Eight hours ago, I got an idea to use Google AJAX Search API to search for related posts. Now I have published, the first release.
I installed it within Blog Gadget with the following code:
<div class='post-footer'> <b:if cond='data:blog.pageType == "item"'> <div style='float:right;width:312px'> <h4>Possibly Related Posts</h4> <div id='gas-results'></div> </div> </b:if> <div class='post-footer-line post-footer-line-1'><span class='post-author vcard'>
Between first line and last line are the code I added. I make sure the code won’t show up multiple time. I have the rest of code at footer:
<script> window.brps_gas = { limit: 10, add_sites: [ 'blogarbage.blogspot.com', 'fedoratux.blogspot.com', 'getctrlback.blogspot.com', 'makeyjl.blogspot.com', 'thebthing.blogspot.com' ], remove_string_regexp: new RegExp('^(YJL --verbose|Blogarbage|Tux Wears Fedora|Get Ctrl Back|make YJL|The B Thing): '), exclude_url_regexp: /(.*archive\.html|blog\.yjl\.im\/$|(blogarbage|fedoratux|getctrlback|makeyjl|thebthing)\.blogspot\.com\/$)/ }; </script> <script src="http://brps.appspot.com/gas.js"></script>
I included five other blogs, which I am no longer posting on. Note: I don’t have jQuery inclusion in above code because it’s already in my template.
You can simply throw that three lines of code into a HTML/JavaScript gadget and pull it to a place you like. It should work.
On more thing, as you may know Blogger pages do not have labels, but you can use tag_selector option and manually install labels into your pages. You can get the related posts for pages as well.
1 Updates
- 2010-09-11: Updated configuration for the updated gas.js.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.