<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>George Papayiannis</title>
	
	<link>http://www.sematopia.com</link>
	<description />
	<lastBuildDate>Sat, 01 May 2010 04:50:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/GeorgeAPapayiannis" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="georgeapapayiannis" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Koumbaro</title>
		<link>http://www.sematopia.com/2010/05/koumbaro/</link>
		<comments>http://www.sematopia.com/2010/05/koumbaro/#comments</comments>
		<pubDate>Sat, 01 May 2010 04:50:01 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=596</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/papayiannis/4567376610/" title="65703118 by George A Papayiannis, on Flickr"><img src="http://farm5.static.flickr.com/4015/4567376610_48a71deb8c_o.jpg" width="600" height="800" alt="65703118" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/05/koumbaro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where Tumblr Comes In</title>
		<link>http://www.sematopia.com/2010/05/where-tumblr-comes-in/</link>
		<comments>http://www.sematopia.com/2010/05/where-tumblr-comes-in/#comments</comments>
		<pubDate>Sat, 01 May 2010 04:45:13 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=594</guid>
		<description><![CDATA[This is where Tumblr comes in. It’s the future of social networking if your image of the future features intelligent discourse. I love reading other Tumblr users replies, because they’re thoughtful by virtue of the fact that if they’re not, they’ll bring the intellectual property value of their own blog down, and that’s a commodity [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>This is where Tumblr comes in. It’s the future of social networking if your image of the future features intelligent discourse. I love reading other Tumblr users replies, because they’re thoughtful by virtue of the fact that if they’re not, they’ll bring the intellectual property value of their own blog down, and that’s a commodity on Tumblr. </p></blockquote>
<p> &#8212; <a href="http://jhnmyr.tumblr.com/post/554610743/twitter-isnt-over-im-over-it">JM</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/05/where-tumblr-comes-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter: How To (Auto) Gain Followers &amp; Influence Others (No One)</title>
		<link>http://www.sematopia.com/2010/04/twitter-how-to-auto-gain-followers-influence-others-no-one/</link>
		<comments>http://www.sematopia.com/2010/04/twitter-how-to-auto-gain-followers-influence-others-no-one/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 21:35:08 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=565</guid>
		<description><![CDATA[Update: Don&#8217;t do this.  It&#8217;s seems obvious now, but for some reason I didn&#8217;t realize this would get you banned.  Indeed the Twitter account used in the experiment was banned.  Luckily we explained ourselves, promised to stop and Twitter re-instated the account :)
_________________________________________________________________
A couple months ago, I decided to spend an evening [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: Don&#8217;t do this.  It&#8217;s seems obvious now, but for some reason I didn&#8217;t realize this would get you banned.  Indeed the Twitter account used in the experiment was banned.  Luckily we explained ourselves, promised to stop and Twitter re-instated the account :)</p>
<p>_________________________________________________________________</p>
<p>A couple months ago, I decided to spend an evening to try and figure out how I could automate the finding &#038; following process on Twitter.  First off let me be clear, this wasn&#8217;t for my personal twitter account <a href="http://twitter.com/gapcm">@gapcm</a>.  God knows I don&#8217;t care about having lots of followers, nor do I care for all the self-promotion and spam that comes along with having lots of followers.  That said, there are cases were a person would want to grow their follower base, even at the expense of following a ton of people &#8211; that&#8217;s were my script comes into play!  First a little background..</p>
<p>About two years ago, my fiance and I started a site called <a href="http://thursdayfordinner.com">Thursday for Dinner</a>.  <a href="http://thursdayfordinner.com">Thursday for Dinner</a> is a video blog dedicated to preserving family recipes. Our mission, as the site says, is to capture our family&#8217;s most treasured recipes and make them available to everyone.  The Thursday for Dinner twitter account <a href="http://twitter.com/tfdtv">@tfdtv</a> would be used as the guinea pig.  Before I started this experiment, <a href="http://twitter.com/tfdtv">@tfdtv</a> had about 600 followers and was listed about 8 times.  After about 1.5 months of using my scripts <a href="http://twitter.com/tfdtv">@tfdtv</a> is up to 2160 followers and is listed 126 times.</p>
<p>The idea of the script is this: If you have API credits left and your followers count is greater than your friends count, search Twitter for a specific term (you can also randomly choose from an array of terms).  I always want to have more followers than friends (for this script), otherwise you&#8217;re looking a bit desperate.  For each user who tweeted the given term, check to see if their already in our database as recently added.  Assuming their not in the db, and that their followers to friends ratio is within a certain range, then follow them and add their user name to our database.  The ratio is calculated like this:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$ratio = (($followers_count - $friends_count) / $followers_count);</pre>
</div>
<p></code></div>
</div>
<p>It&#8217;s important to follow people within a specific ratio, cause if their follower to friends count is reasonably close, their more than likely going to follow you back.  More important than just the ratio, is the term you use to search Twitter.  The term you search needs to be relevant to your twitter stream/site content.  For Thursday for Dinner, I search Twitter for the term foodie.  It&#8217;s obvious that people who Tweet the word foodie, are going to like the premise of our site.  Just before the script finishes, it checks all users in the database that are older than 3 days.  If the given user is not following back, they are unfollowed.  Whether their following or not, their user name is removed from the database.</p>
<p>To use this script, your going to need to know PHP/MySQL/Apache/REST.  Your also going to need PEAR MDB2 and curl running.  If you don&#8217;t know what I&#8217;m talking about, save yourself the trouble.  First things first, you need to create a new MySQL database with the following table:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>CREATE TABLE IF NOT EXISTS `twitter_users` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(128) NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2259 ;</pre>
</div>
<p></code></div>
</div>
<p>I created a class called SessionControl to manage the whole MySQL process.  I won&#8217;t show that here, but you can download it in the zip below.  The main class is the twitter.class.php.  This is were the bulk of the work is done.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>&#60;?

require_once 'sessionControl.class.php';

class Twitter {
    //
    private $username = 'twitter_username';
    private $password = 'twitter_password';
    //
    public function __construct() {

    }
    //
    public function getUsername() {
        return $this->username;
    }
    //
    private function getCURL() {
        if (!$curld = curl_init()) {
            echo "Could not initialize cURL session&#60;br>";
            exit();
        }
        return $curld;
    }
    //
    public function friendshipDetails($u1,$u2) {
        $url = "http://twitter.com/friendships/show.json?source_screen_name=$u1&#038;target_screen_name=$u2";
        //echo $url;
        //exit;
        $curld = $this->getCURL();
        curl_setopt($curld, CURLOPT_GET, true);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_HEADER, false);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curld, CURLOPT_HTTPHEADER, array('Expect:'));
        $output = curl_exec($curld);
        $pile = json_decode($output,true);
        return $pile;

    }
    //
    public function follow($u) {
        $user = SessionControl::getInstance();
        //
        $url = "http://$this->username:$this->password@twitter.com/friendships/create/$u.json";
        $curld = $this->getCURL();
        curl_setopt($curld, CURLOPT_POST, true);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_HEADER, false);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curld, CURLOPT_HTTPHEADER, array('Expect:'));
        $output = curl_exec($curld);
        //$this->out($output);
        $pile = json_decode($output,true);
        //$this->out($pile);
        //
        $sql = "INSERT INTO twitter_users (id, name, date) VALUES (NULL, ".$user->quote($u,"text").", NOW())";
        $user->query($sql);
        //
        return $pile;

    }
    //
    public function isUserInDB($u) {
        $user = SessionControl::getInstance();
        $result = false;
        $sql = 'SELECT * FROM twitter_users WHERE name = '.$user->quote($u,"text");
        $sqlRes = $user->query($sql)->fetchAll();
        if (!empty($sqlRes)) {
            $result = true;
        }
        return $result;
    }
    //
    private function destroy($u) {
        $user = SessionControl::getInstance();
        //
        $url = "http://$this->username:$this->password@twitter.com/friendships/destroy/$u.json";
        $curld = $this->getCURL();
        curl_setopt($curld, CURLOPT_POST, true);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_HEADER, false);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curld, CURLOPT_HTTPHEADER, array('Expect:'));
        $output = curl_exec($curld);
        $pile = json_decode($output,true);
        //
        return $pile;
    }
    //
    private function out($v) {
        echo '&#60;pre>';
        print_r($v);
        echo '&#60;/pre>';
    }
    //
    public function unfollow($u = '', $days = 3) {
        $user = SessionControl::getInstance();
        if ($u == '' &#038;&#038; $days > 1) {
            $sql = "SELECT * FROM twitter_users WHERE date &#60; ".$user->quote($this->getSQLDate(time() - ($days * 24 * 60 * 60)),'text');
            $uf = $user->query($sql)->fetchAll();
            foreach ($uf as $u) {
                $details = $this->friendshipDetails($this->username,$u->name);
                //$this->out($details);
                //exit();
                if (isset($details['relationship']['target']['following'])) {
                    $key = $details['relationship']['target']['following'];
                } else {
                    $key = 0;
                }
                // not following, remove
                if ($key != 1) {
                    $this->destroy($u->name);
                    $this->out('Removed ' . $u->name);
                }
                //exit();
                // either way remove from db
                $sqlDel = "DELETE FROM twitter_users WHERE id = $u->id";
                $user->query($sqlDel);
            }
        }
    }
    //
    public function getSQLDate($t) {
        return date('Y-m-d H:i:s',$t);
    }
    //
    public function getUser($u) {
        $url = "http://twitter.com/users/show/$u.json";
        $curld = $this->getCURL();
        curl_setopt($curld, CURLOPT_GET, true);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_HEADER, false);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curld, CURLOPT_HTTPHEADER, array('Expect:'));
        $output = curl_exec($curld);
        $pile = json_decode($output,true);
        return $pile;
    }
    //
    public function getSearch($s) {
        $url = "http://search.twitter.com/search.json?q=$s";
        $curld = $this->getCURL();
        curl_setopt($curld, CURLOPT_GET, true);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_HEADER, false);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curld, CURLOPT_HTTPHEADER, array('Expect:'));
        $output = curl_exec($curld);
        $pile = json_decode($output,true);
        return $pile;
    }
    //
    public function getLimit() {
        $url = "http://twitter.com/account/rate_limit_status.json";
        $curld = $this->getCURL();
        curl_setopt($curld, CURLOPT_GET, true);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_HEADER, false);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curld, CURLOPT_HTTPHEADER, array('Expect:'));
        $output = curl_exec($curld);
        $pile = json_decode($output,true);
        return $pile;

    }
    //
    public function __sleep() {
        return array_keys(get_object_vars($this));
    }
    //
    public function __wakeup() {

    }
}

?></pre>
</div>
<p></code></div>
</div>
<p>From here, the main control file called go.php runs everything.  This is were the steps are executed.  Here it is:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>&#60;?php

require_once 'twitter.class.php';

set_time_limit(-1);

$twitter = new Twitter();
$limit = $twitter->getLimit();

function getSearchTerm() {
    //$terms = array("twitter_search_term_1",);
    //$r = mt_rand(0,2);
    //return $terms[$r];
    return 'twitter_search_term';
}

if ($limit['remaining_hits'] > 0){
    $me = $twitter->getUser($twitter->getUsername());
    if (($me['followers_count']) > $me['friends_count']) {
        $sterm = getSearchTerm();
        dump('Hits Left: '.$limit['remaining_hits'].' -- Searching: ' . $sterm);
        $search = $twitter->getSearch($sterm);
        foreach ($search['results'] as $r) {
            $user = $r['from_user'];
            if (!$twitter->isUserInDB($user)) {
                $info = $twitter->getUser($user);
                $friends_count = $info['friends_count'];
                $followers_count = $info['followers_count'];
                if ($friends_count > 0 &#038;&#038; $followers_count > 0) {
                    $ratio = (($followers_count - $friends_count) / $followers_count);
                    if ($ratio &#60; 0.2 &#038;&#038; $ratio > -0.4) {
                        $twitter->follow($user);
                        dump($user . ' followed -> friends: ' . $friends_count . ' - Followers: ' . $followers_count);
                    }
                }
            } else {
                dump($user . ' in db');
            }
        }
    }
    //
    $twitter->unfollow();
} else {
    dump($limit);
}

function dump($r) {
    echo '&#60;pre>';
    print_r($r);
    echo '&#60;/pre>';
}
?></pre>
</div>
<p></code></div>
</div>
<p><strong>Key points</strong></p>
<ul>
<li>Twitter has a limit on the number of API calls you can execute based on a user name and IP address.  So don&#8217;t run this a) too often and b) on your personal computer.  You&#8217;ll need to run this on a separate box with a separate IP address.</li>
<li>You&#8217;ll need to automate this with a cron job.  I run it every 10 minutes.  If your hosting company doesn&#8217;t allow for cron jobs, you can use <a href="http://www.webbasedcron.com">WebBasedCron</a>, which I made 4-5 years ago.</li>
<li>The code is released under GPL.  Use at your own risk.  You can download the <a href="http://sematopia.com/upload/twitter-follow.rar">files here</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/04/twitter-how-to-auto-gain-followers-influence-others-no-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Comment on the Yen</title>
		<link>http://www.sematopia.com/2010/03/a-comment-on-the-yen/</link>
		<comments>http://www.sematopia.com/2010/03/a-comment-on-the-yen/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 14:55:48 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2010/03/a-comment-on-the-yen/</guid>
		<description><![CDATA[&#34;At this point, it is worth noting a small bit of history. We began our career trading foreign exchange back in the 70&#39;s for what was then NCNB in Charlotte, N. Carolina, and we can recall well trading the Yen/dollar at 165 and higher. Indeed, we can recall not too long before that when the [...]]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>&quot;At this point, it is worth noting a small bit of history. We began our career trading foreign exchange back in the 70&#39;s for what was then NCNB in Charlotte, N. Carolina, and we can recall well trading the Yen/dollar at 165 and higher. Indeed, we can recall not too long before that when the Yen/dollar rate had been centred upon 225. Thus, with that past history it is not difficult for us to envision the Yen/dollar rate moving readily to &quot;Par&quot; when it may well be quite difficult for others to even imagine that possible. It is to our advantage then to recall that history, and it is further to our advantage to understand that something truly tectonic in nature is taking place in the Yen/dollar and Yen/Non-US dollar relationships. Henceforth we shall try our best not to be concerned about 25 and 50 &quot;pips&quot; in the Yen/dollar relationship, for we envision hundreds upon hundreds of &quot;pips&quot; as the trade unfolds… multiples of &quot;big figures&quot; passing by over the course of the next several months and years.&quot; &#8211; D. Gartman (Mar 31/2010)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/03/a-comment-on-the-yen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mrs Watanabe Likes….</title>
		<link>http://www.sematopia.com/2010/03/mrs-watanabe-likes/</link>
		<comments>http://www.sematopia.com/2010/03/mrs-watanabe-likes/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 23:53:22 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2010/03/mrs-watanabe-likes/</guid>
		<description><![CDATA[&#34;Of particular interest, Mrs Watanabe likes Brazilian bonds. Holdings of Brazil fixed income instruments stood at JPY1.34 trillion in February, nearly a third more than last February. Consider that a Brazilian real money market pays her 6% a year, 55 times more than she can get if she takes advantage of the government’s relaxation of [...]]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>&quot;Of particular interest, Mrs Watanabe likes Brazilian bonds. Holdings of Brazil fixed income instruments stood at JPY1.34 trillion in February, nearly a third more than last February. Consider that a Brazilian real money market pays her 6% a year, 55 times more than she can get if she takes advantage of the government’s relaxation of the deposit limit. Some reports also suggest keen interest in Chinese equities, but Japanese investors have a clear preference for bonds over equity, according to Ministry of Finance capital account data.&quot; &#8211; <a href="http://www.marctomarket.com/2010/03/ode-to-mrs-watanabe.html">Marc Chandler</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/03/mrs-watanabe-likes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Think About It This Way</title>
		<link>http://www.sematopia.com/2010/03/think-about-it-this-way/</link>
		<comments>http://www.sematopia.com/2010/03/think-about-it-this-way/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 23:14:25 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2010/03/think-about-it-this-way/</guid>
		<description><![CDATA[&#8220;&#8216;Tony, think about it this way. If your worst enemy drops sugar in your coffee, what&#8217;s going to happen to you? Nothing. But what if your best friend drops strychnine in your coffee? You&#8217;re dead. You have to stand guard at the door of your mind.&#8217; He was saying that the selection of [my friends [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;&#8216;Tony, think about it this way. If your worst enemy drops sugar in your coffee, what&#8217;s going to happen to you? Nothing. But what if your best friend drops strychnine in your coffee? You&#8217;re dead. You have to stand guard at the door of your mind.&#8217; He was saying that the selection of [my friends and advisors] will matter more than anything else, and that you can&#8217;t take anybody&#8217;s approach as sacrosanct.&#8221; &#8211; Tony Robbins</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/03/think-about-it-this-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If I Could Go Back..</title>
		<link>http://www.sematopia.com/2010/03/if-i-could-go-back/</link>
		<comments>http://www.sematopia.com/2010/03/if-i-could-go-back/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 18:33:00 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2010/03/if-i-could-go-back/</guid>
		<description><![CDATA[..and change one thing in my life, I would have lived with my sister in University.
]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>..and change one thing in my life, I would have lived with my sister in University.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/03/if-i-could-go-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Removing All Non-Printable (Special Characters) From String</title>
		<link>http://www.sematopia.com/2010/02/php-removing-all-non-printable-special-characters-from-string/</link>
		<comments>http://www.sematopia.com/2010/02/php-removing-all-non-printable-special-characters-from-string/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 21:24:30 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=557</guid>
		<description><![CDATA[I was actually trying to find a way to do this in JavaScript, but eventually gave up.  I basically want to remove all non-printable special characters from a string.  So for a string like this:

Code:


$str = 'Characters like© and ® are not all®wed.';



I would want &#8216;Characters like and are not allwed.&#8217;.  The [...]]]></description>
			<content:encoded><![CDATA[<p>I was actually trying to find a way to do this in JavaScript, but eventually gave up.  I basically want to remove all non-printable special characters from a string.  So for a string like this:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$str = 'Characters like© and ® are not all®wed.';</pre>
</div>
<p></code></div>
</div>
<p>I would want &#8216;Characters like and are not allwed.&#8217;.  The following matches anything in the ASCII range of 0-31 &#038; 128-255 and removes it.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$str = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $str); </pre>
</div>
<p></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/02/php-removing-all-non-printable-special-characters-from-string/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Buy Kardovite in Canada</title>
		<link>http://www.sematopia.com/2010/02/buy-kardovite-in-canada/</link>
		<comments>http://www.sematopia.com/2010/02/buy-kardovite-in-canada/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 19:36:08 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[hpn]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=550</guid>
		<description><![CDATA[
High Park Nutrition recently added a fantastic new brand in Kardovite.  Kardovite is a brand we&#8217;ve been using personally for a very long time, and we&#8217;re glad to finally have them available on hpn.TO.
Kardovite has seven different ingredients, which is not in any other similar preparation. The only formulation of its kind that is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hpn.to/Kardovite-Capsules-180-capsules/e/894166/000055"><img src="http://static.hpn.to/Kardovite-Capsules-180-capsules-603-250.jpg" alt="Kardovite" /></a></p>
<p>High Park Nutrition recently added a fantastic new brand in <a href="http://hpn.to/Kardovite/s/8932">Kardovite</a>.  Kardovite is a brand we&#8217;ve been using personally for a very long time, and we&#8217;re glad to finally have them available on <a href="http://hpn.to">hpn.TO</a>.</p>
<blockquote><p><a href="http://hpn.to/Kardovite/s/8932">Kardovite</a> has seven different ingredients, which is not in any other similar preparation. The only formulation of its kind that is available in 3 different forms, regular, odourless and capsules. Sam Ibrahim a European educated Pharmacists/herbalist developed <a href="http://hpn.to/Kardovite/s/8932">Kardovite</a>. At Nutrition Plus we strongly believe that we manufacture the best quality product available. All of our standardized herbs are sourced from only the best growers in the world.</p>
<p>For thousands of years, people have been using the products of the natural world to help them stay healthy. For example, North American Indians chewed willow branches for headache. That&#8217;s because willow contains salicin, which is a precursor to the active ingredient in Aspirin. Like Aspirin, many drugs are derived from nature products usually from plants by chemically altering, purifying and concentrating them.</p>
<p>By understanding and regularly using the medicines nature has given us, we can help our body to maintain its health in addition to managing health concerns as they arise. Herbal and supplement products are nature&#8217;s medicines. For example, St.John&#8217;s Wort contains a natural antidepressant; Echinacea helps to boost your immune system by counteracting an enzyme that weakens your cells and lets viruses in. There is more to making quality natural health products than harvesting plants, crushing them, and putting the resulting powder into capsules. We are committed to producing Kardovite products of only the finest quality. Every batch of <a href="http://hpn.to/Kardovite/s/8932">Kardovite</a> product is quality tested by independent labs so that they can offer guaranteed potency and purity</p></blockquote>
<p>.</p>
<p>To see all <a href="http://hpn.to/Kardovite/s/8932">Kardovite products</a> at hpn.TO <a href="http://hpn.to/Kardovite/s/8932">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/02/buy-kardovite-in-canada/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Comment on Greece from June ‘93</title>
		<link>http://www.sematopia.com/2010/02/a-comment-on-greece-from-june-93/</link>
		<comments>http://www.sematopia.com/2010/02/a-comment-on-greece-from-june-93/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 22:38:18 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>
		<category><![CDATA[Greece]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2010/02/a-comment-on-greece-from-june-93/</guid>
		<description><![CDATA[&#8220;If all of the Greek islands were merged with the mainland, it would be about the size of Alabama; there are 10 million Greeks &#8211; and perhaps another 4 million living throughout the world, who still think of themselves as Greek. They are, thanks to their history, magnificent patriots and nationalists &#8211; and abominable citizens, [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;If all of the Greek islands were merged with the mainland, it would be about the size of Alabama; there are 10 million Greeks &#8211; and perhaps another 4 million living throughout the world, who still think of themselves as Greek. They are, thanks to their history, magnificent patriots and nationalists &#8211; and abominable citizens, who deeply mistrust every government they’ve ever had. Essentially they are fierce individualists, who mistrust so much whatever government happens to be in power as the very idea of government. The have almost no sense of civic responsibility &#8211; Pericles complained about this at length &#8211; and History has never given them much of a chance to work out a stable system of government.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2010/02/a-comment-on-greece-from-june-93/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
