Blogger to Serendipity importer script v2

I had occasion last night to revisit the Blogger to Serendipity importer script I wrote a few years ago, while helping someone move from Blogger to something that packs a bit more punch.

Serendipity has been carrying the script I wrote bundled as part of the importers available in its core package, thanks to Garvin Hicking (lead developer at the Serendipity project) who had done the dirty work of integrating my code into the project. Anyway, last night when I got about to importing the blog on Blogger into a fresh install of Serendipity, I found myself annoyed by the tediousness of the process required by the very importer I'd authored. Blogger didn't have any export feature back then nor did it provide API access. As a result, the (popular) method for exporting a blog from Blogger had involved setting a special template as the blog's layout and tweaking around a few other settings, after which the blog is published and the output parsed to extract what is needed.

Things have, of course, changed dramatically and for the good in the years since, as Google has continued to open up its services for developers via public APIs. Encouraged by the simplicity of the API, I ended up spending a little bit of time to rewrite the importer almost from scratch. The highly desirable "export blog" feature in the Blogger Data API allows obtaining an XML based dump of the entire blog, which can then be moulded however to fit ones needs.

Download

- Download s9y-bloggerimporter-v0.2.zip (3.3Kb)

Requirements

- PHP 5

Installation

- Extract the contents of the Zip file.
- Upload (or copy) the file "blogger.inc.php" to the folder "include/admin/importers" under the main Serendipity installation path. Make sure the old file is replaced with the new.

Usage

The new importer script can transfer posts (both published and drafts), comments (including comment moderation settings) and authors, without breaking sweat. The process for importing a blog is simple:
1. Login to Blogger/Google and login to Serendipity Administration Suite.
2. Navigate to "Import data" using the menu and select Blogger.com as the type of import.
3. Click the "Go to Google" link to jump to a special authorization request page that allows the importer to access the blogs. [Image 1]
4. Click the "Grant access" button and wait to be taken back to Serendipity. [Image 2]
5. Select the blog to import from the list. [Image 3]
6. Optionally, select the category for the imported posts, set desired trackback behavior, select a charset. [Image 3]
7. Click "Import now!". (see Image 3]
8. Posts (and its comments) are processed and import results displayed.


Image 1


Image 2


Image 3


Enjoy!

Update (17-Feb-2009): This has been adopted into the Serendipity code base and would be available bundled-in with future releases from the project.

Geo-mapped visualization of political party member distribution in Male'

Here is a quick mashup I cooked up today, displaying the geographic distribution of political party membership on the map of Male' on Google Maps. To view the distribution for a party, open the link for the visualization, select the name of the political party from the drop-down menu at the top right. The addresses of members of that party will then be flagged with a little red marker. You will be able to zoom in-out, pan and do all those other things typically seen in Google Maps. Click a red marker to see more details about that address, like the number of people belonging to the selected party that are registered under that address.

The party membership information used for this is a snapshot of the data (taken 7 February 2009) published on the Members of Political Parties web portal by the Elections Commission. There were a total of 4,447 people belonging to 2,711 addresses in Male' listed in the Elections Commission data. Each party had membership numbers (given in brackets) in Male' as follows: Adhaalathu Party (175), Dhivehi Qaumee Party (261), Dhivehi Rahjeyn Fageerukan Nahthaalumah Masahkaikuraa Party (650), Dhivehi Rayyithunge Party (243), Gaumee Ih'thihaadh (592), Islamic Democratic Party (89), Jumhooree Party (246), Maldivian Democratic Party (507), Maldivian National Congress (386), Maldivian Social Democratic Party (25), Peoples Party (476), Peoples' Alliance (422) and Social Liberal Party (375). The maximum number of persons listed on a single address for a party was 12 and the average was 1 person per address (per party).

The geo-location information for the addresses was derived from the excellent services at Male-map.com and EAtolls.com. A total of 1,928 addresses were successfully mapped using these services, leaving a difference of 783 addresses which were then discarded. It is worth noting that of these addresses left out, 478 were just Dhaftharu numbers.

Please note that I neither claim nor guarantee the correctness or the completeness of any of the information used. That said, I did my best to ensure data integrity throughout the whole process of generating the visualizations.

- Click here to view the visualization

Adhaalathu Party
Snapshot: Adhaalathu Party

Dhivehi Qaumee Party
Snapshot: Dhivehi Qaumee Party

Dhivehi Rahjeyn Fageerukan Nahthaalumah Masahkaikuraa Party
Snapshot: Dhivehi Rahjeyn Fageerukan
Nahthaalumah Masahkaikuraa Party

Dhivehi Rayyithunge Party
Snapshot: Dhivehi Rayyithunge Party

Gaumee Ih'thihaadh
Snapshot: Gaumee Ih'thihaadh

Islamic Democratic Party
Snapshot: Islamic Democratic Party

Jumhooree Party
Snapshot: Jumhooree Party

Maldivian Democratic Party
Snapshot: Maldivian Democratic Party

Maldivian National Congress
Snapshot: Maldivian National Congress

Maldivian Social Democratic Party
Snapshot: Maldivian Social Democratic Party

Peoples' Alliance
Snapshot: Peoples' Alliance

Peoples Party
Snapshot: Peoples Party

Social Liberal Party
Snapshot: Social Liberal Party

Thaana conversions class for PHP 5 - v0.4

Here is a major update to the Thaana Conversions class for PHP 5 that I have been maintaining. This new version adds two new functions convertLatinToAscii() and its counterpart convertAsciiToLatin(), which transliterates text to and from the latinized/romanized Thaana form. That means you can pass on text bits like "miadhakee reethi dhuvahekeve" and have it converted to "މިއަދަކީ ރީތި ދުވަހެކެވެ".

This feature would facilitate Thaana websites to add cool and interesting new features like, say, offering to display a news article in latinized Thaana if the user does not have the required fonts installed and/or cannot install the Thaana fonts!

Info

The Thaana Conversions class for PHP provides a number of useful functions for the conversion and transliteration of text between various Thaana representation formats.

Functions exposed

- convertUtf8ToUnicodeIntegers()
- convertUtf8ToAscii()
- convertUtf8ToEntities()
- convertEntitiesToUnicodeIntegers()
- convertEntitiesToUtf8
- convertEntitiesToAscii()
- convertUnicodeIntegersToUtf8()
- convertUnicodeIntegersToEntities()
- convertUnicodeIntegersToAscii()
- convertAsciiToUtf8()
- convertAsciiToEntities()
- convertAsciiToUnicodeIntegers()
- convertLatinToAscii()
- convertAsciiToLatin()

Requirements

PHP 5

License

This script is released under the Open Source MIT License, allowing its use in both personal and commercial applications as long as the copyright and license permission notice remains intact.

Usage

<?php
// Load the class
require 'thaana_conversions.obj.php';

// Initialize the Thaana object
$thaana = new Thaana_Conversions();

// Example: Converting latin to ascii
echo $thaana->convertLatinToAscii('miadhakee haadha reethi dhuvahekeve.');

// Example: Converting ascii to latin
echo $thaana->convertAsciiToLatin('miawdwkI hWdw rIti duvwhekeve.');
?>

Download

- Thaana_Conversions.zip (v0.4, 4.8KB)

Enjoy :-)

Thaana Transcoder 1.1

I received two feature requests in the email since I released the Thaana Transcoder late last month and both asked for the same thing; Unicode input text transcoding to Accent compatible ASCII output. It just so happened that the feature requested was something that I had actually programmed in, more or less, but left out in the public 1.0 release because I wasn't sure anyone would need it. So here is a new release with the said feature included and also bundles in a minor bug fix.

Info

Thaana Transcoder is a Windows-based tool that performs the often much needed conversion of Thaana text written in Accent, Faseyha Thaana, MS Word version 97 (and older) to and from the modern Unicode standard used by MS Word XP/2007 and OpenOffice.

Download

- Thaana Transcoder 1.1 Installer/Upgrade (185KB, MS Windows)
- Thaana Transcoder 1.1 Executable only (79.7KB, MS Windows)

ThaanaTranscoder screenshot

Thaana Transcoder 1.0

Thaana Transcoder is a Windows-based tool that performs the often much needed conversion of Thaana text written in Accent, Faseyha Thaana, MS Word version 97 (and older) to and from the modern Unicode standard used by MS Word XP/2007 and OpenOffice. This program hasn't been thoroughly tested and there is bound to be bugs and errors. If you do encounter such a bug or have a feature request, please drop me line.

Quite a few people have asked me for such a program over the years and I used to point people over to an online tool I had made available a few years ago but it is no longer alive. As ever, it wasn't until I had a real necessity for such a program a few days ago that I got around to writing a brand new version.

Download

- Thaana Transcoder 1.0 Installer (184KB, MS Windows)
- Thaana Transcoder 1.0 Executable only (78.8KB, MS Windows)

Enjoy :-)

Javascript Thaana Keyboard version 4.2

Here's a minor update to my Javascript Thaana Keyboard library. This release, version 4.2, amounts to a single bugfix addressing an error in key translation for some keys when operating under the "Phonetic-HH" keyboard mode. Everything else remains as per the earlier v4 series releases.

Thanks goes to Nattu for bringing the bug to my attention.

Changelog:

+ Fixed handling of keys when in Phonetic-HH keyboard mode

Usage:

Usage remains same as before. Please refer to my detailed post on the 4.0 release.

Demo:

Check out the demonstration and testing page here.

Download:

- full source version (5.51 KB)
- packed version (2.46 KB) [recommended]

Update (13-Apr-2009): This version is now superseded by release v4.2.1.

Athuliyun: Thaana Handwriting Recognition demo

I dug up this old project from my backup disks today and worked a little magic to bring it back to life. This was and still is among my favourite experiments. Named "Athuliyun", I developed this software shortly after I bought my first PDA around 2005, with the goal of getting Thaana handwriting recognition on the platform. I didn't have much experience with software development for Windows CE (a.k.a Windows Mobile) and so it ended up being a Windows application. The project got binned when my interests moved to Optical Character Recognition for document scanning...

Athuliyun supports, as it stands now, the Thaana characters but not the filis (diacritics). This ofcourse severely limits its practical use but I reckon adding support for fili would be a relatively trivial task. I will be releasing this publicly, hopefully later this month, after adding that functionality and also retraining the recognition neural networks used in the software for improved performance.

Anyway, below is a short screencast of the application where you can see me scribble Thaana letters quite clumsily using the touchpad on my laptop - let's call it a software/technology preview ;-)



[An alternative lower-quality version can be found on Youtube]