Showing posts with label Blogger. Show all posts
Showing posts with label Blogger. Show all posts

2009-10-15

Blog Comment Spam

What a pain in the nether regions when spammers decide to use your blog as a vehicle for their crap advertisements. My blogs are moderated, so I see every comment before they are posted. I only twigged that my blog was being spammed when I saw the same comment twice for different postings on the same day (that spammer was enthusiastic). It seems (naïve, perhaps) that any comment with a URL, either in plain view or in an HTML <a> tag, is likely to be spam comment, and showed be examined closely.

Suggestion to Blogger team: include a option to mark a comment as spam, just like Gmail, and use the crowd to identify spam comments.

2009-09-03

Floating IFRAMEs in Blogger

In my other blog, I wanted to show images to one side of the text, like this:

XXXXXX +--------+
XXXXXX | iframe |
XXXXXX +--------+
XXXXXX
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX

The images, generated by Amazon, are within an iframe element. After some false starts, I found that the simplest solution was to wrap the iframe elements in a div element, and float the div:

<div style="float:right">
<iframe>
...
</iframe>
</div>
<p>
...
</p>

2009-06-14

Merging multiple blog feeds into Facebook Notes with Yahoo Pipes

I started a second blog, Vibogafi, for writing about media, and wanted to display updates from that and this blog using the Facebook Notes application. Notes only allows users to import one RSS feed, so I had to merge both my RSS feeds first.

One aggregation or mashup system that came to mind was Yahoo Pipes. If you have a Yahoo account, then you can create your personal pipes. I followed the video tutorial and got my pipe working the second time around. Some tips and minor gotchas:

  • When entering the Blogger feed URL in the Pipes Fetch Feed gadget, you cannot simply enter http://<myblog>.blogspot.com and expect the gadget to find the feed URL; instead, you have to enter the entire feed URL, which looks like http://<myblog>.blogspot.com/feeds/posts/default.
  • Check the Pipes Debugger output by selecting each gadget. If you do not get the expected output, try to fix the problem before proceeding.
  • If you just want to merge two or more feeds, just use one Fetch Feed gadget instead of multiple Fetch Feed and one Union gadget; the Fetch Feed gadget allows you to enter more than one URL.
  • To use your new Pipe in Facebook Notes, you have to use your pipe's RSS output, whose URL ends with &_render=rss, not just the pipe's basic address. (Upon hindsight, it is obvious, but I tripped over that problem, too.)

2009-06-07

Reformatting post dates in Blogger Dashboard

In the Blogger Dashboard, the posting date of your entries are in mm/dd/yy format and Google doesn't provide a way to localize it or choose a date format. Here's how you can use a Greasemonkey script to convert dates in Dashboard to dd/mm/yy format.

The dates in Dashboard have this structure:

<td class="date">
  <span>3/6/09</span>
</td>

The following script uses jQuery to iterate through all span nodes of td elements with a date class attribute, then applies the Javascript string replace() function to swap the first two numbers in the span node. To change the output string, just modify the second argument of the replace() function.

// ==UserScript==
// @name           blogger.com localize dashboard date
// @namespace      kamhungsoh.com
// @description    Convert date format from m/d/yy to d/m/yy.
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
// @include        http://www.blogger.com/posts.g*
// ==/UserScript==

$("td.date > span").each(function() {
  var s = $(this).text().replace(/(\d+)\/(\d+)/, '$2\/$1');
  $(this).text(s);
});

The first argument of the replace() function is a regular expression where \d is a meta-character for a digit, + matches one or more of the preceding character (e.g. 4 or 23) and the parentheses group the characters to be memorised. The forward slash has to be escaped, \/, to allow us to match it in the input string. In the second argument, the $2/$1 represents the second and first memorised strings.

2007-02-12

Blogger Layout FTP Unavailable

The new Google Blogger keeps advertising the new drag-and-drop Layout design feature and widgets in the start page, so I thought I'd try it. After staring at Blogger Layout help and not getting anywhere, I realised that something was missing. I found that Layout isn't available for blogs published using FTP. Bummer. Would've saved me half an hour if Blogger had written this limitation into their on-line help.

A bit later. Blogger provides a Custom Domain service. Basically, you use Google as the domain name server that will redirect all DNS queries to your Blogger-hosted blog. With this service, you can use the Layout feature.

2007-01-27

Blogger Labels

Started seriously using Blogger Labels today to organize my journal entries. Blogger Labels are managed in the Edit Posts. Its user interface is similar to Google Mail's (not a surprise since Google owns Blogger) where you mark your journal entries then select a label from a drop-down list to assign that label to the marked journal entries. Each label and their references to journal entries are stored as a file in your web site, so to add a label to your blog's page, just add an HTML a tag to your blog's template.

Minor annoyance: you have to use the Edit Posts page to assign labels to existing journal entries and the Edit Posts page seems to reset to showing the first 50 entries if the page is refreshed. If you have a lot of entries, it becomes a real pain because you keep losing track of what you have done. There doesn't seem to be a way to configure the number of entries to show in the Edit Posts page.

2006-11-19

New Blogger Interface

I migrated my blog to the new Blogger interface. Since I had a Google account, now I have one less username-password combination to remember. One nice new feature: labels. Now I don't have to put keywords in the title of each blog entry just for categorising blog entries. It's a Google-ish feature and works like labels in Google Mail.