Monthly Archives: September 2009

Quick PHP Hack to Tidy up Trashed HTML

I just hacked together the following quick and dirty PHP-script to use the tidy-extension from the command line. Maybe somebody else needs something like this somewhere. Check the comment for details:

<?php

//
// (a) Save this as tidy.php
// (b) Call it from commandline like this: $ php tidy.php trashed.html > tidy.html
//     to tidy the file trashed.html to a new file tidy.html.
//

// Installation and configuration see http://php.net/tidy
$config = array('indent'=> true, 'output-xhtml' => true, 'wrap'=> 200);

$tidy = new tidy;
$tidy->parseString(file_get_contents($_SERVER['argv'][1]), $config, 'utf8');
$tidy->cleanRepair();

echo $tidy;

LSIS – LifeScience Channel Subscriptions

Since one of my coolest (private) projects www.lsis.cc somewhat lacks the expected amount of traffic, I would like to emphasize the core feature in this blobpost – just to make you aware of it or encourage you to tell your friends or have ideas to apply the concept to other areas.

In short LSIS – Life Science Information Service – on a daily basis crawls a list of essential news sources in the field of life sciences and indexes this content after applying a series of quality measures. You can traditionally serach from our search frontend OR save your searches once you are comfortable with the results. You can then give your ‘channel‘ an name and decide if you would like to get new articles matching your saved query pushed onto your email stack or subscribe to it via RSS-link and process it with all your other industry feeds in the feed reader of your choice. All this is completely for free and anonymous!

After seraching the current content you are provided a 'Save Search' button. It let's you save your individual, private and free channel.

After seraching the current content you are provided a 'Save Search' button. It let's you save your individual, private and free channel.

You can also browse a series of existing channels, which are preset saved searches of current life-science buzz-topics and subscribe to as many as you like via email or RSS.

Let’s say you are interested in

and whatever else you might want to monitor just save yourself a query and start being alerted on a daily basis – make your colleagues wonder what cool up-to-date industry guru you are.

Browse existing channels, find RSS feeds or subscripbe to get reports pushed via email.

Browse existing channels, find RSS feeds or subscribe to get reports pushed via email.

Install PEAR on OSX

Here is how you install PEAR on Mac OSX:

sudo mkdir /usr/local/temp;
sudo chmod -R 777 /usr/local/temp;
sudo mkdir /usr/local/share/pear;
sudo chmod -R 777 /usr/local/share/pear;
curl http://pear.php.net/go-pear | sudo php;

Set /usr/local as path prefix and install.

You should then be able to use pear, e.g.: pear help.

In order to install modules you also need a temp dir:

sudo mkdir /usr/local/temp;
sudo chmod 0777 /usr/local/temp/;

You can now install PHPUnit:

sudo pear channel-discover pear.phpunit.de;
sudo pear install phpunit/PHPUnit;

Have Fun!