<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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"
	>

<channel>
	<title>rickadams.org</title>
	<atom:link href="http://rickadams.org/weblog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://rickadams.org/weblog</link>
	<description>Cheerfully wasting bandwidth since 1995</description>
	<pubDate>Mon, 23 Nov 2009 00:57:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Display Shoutcast Listeners by Country</title>
		<link>http://rickadams.org/weblog/?p=17</link>
		<comments>http://rickadams.org/weblog/?p=17#comments</comments>
		<pubDate>Mon, 23 Nov 2009 00:57:21 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Shoutcast]]></category>

		<category><![CDATA[Workshop]]></category>

		<guid isPermaLink="false">http://rickadams.org/weblog/?p=17</guid>
		<description><![CDATA[In an earlier post I showed how to display listeners to your Shoutcast audio streaming server by country, like this:
There are currently 12 out of 36 listeners from:
USA (3), Taiwan, Chile (2), Peru (2), France, Germany, Brazil,
Japan
But the program was a bit simplistic.  If the listener&#8217;s hostname ended in &#8220;.de&#8221; they were assumed to [...]]]></description>
			<content:encoded><![CDATA[<p>In an earlier post I showed how to display listeners to your Shoutcast audio streaming server by country, like this:</p>
<div class="codesnip-container" ><strong>There are currently 12 out of 36 listeners from:</strong><br />
USA (3), Taiwan, Chile (2), Peru (2), France, Germany, Brazil,<br />
Japan</div>
<p>But the program was a bit simplistic.  If the listener&#8217;s hostname ended in &#8220;.de&#8221; they were assumed to be in Germany, &#8220;.jp&#8221; meant Japan, and so on.  &#8220;.com&#8221; and &#8220;.edu&#8221; and &#8220;.org&#8221; were assumed to be in the United States, which was a pretty silly assumption, I do admit.</p>
<p>To really do things right, I&#8217;d have to look up each listener&#8217;s IP address in a huge database of IP ranges mapped to country, and I had no idea how to do that&#8230; until now.</p>
<p>These scripts use PHP, and assume you&#8217;re using a MySQL database.  If you&#8217;re fairly technical, maybe you can pull it off too.  A link to all the files mentioned in this article is <a href="http://rickadams.org/downloads/listeners.zip">here</a>.</p>
<p>First, define some configuration parameters in a file named config.php:</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">&lt;?php</span><br />
&nbsp; &nbsp; <span class="re0">$dbhost</span> <span class="sy0">=</span> <span class="st0">&quot;localhost&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$dbport</span> <span class="sy0">=</span> <span class="st0">&quot;3306&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$dbuser</span> <span class="sy0">=</span> <span class="st0">&quot;root&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$dbpassword</span> <span class="sy0">=</span> <span class="st0">&quot;your_sekrit_password&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$dbname</span> <span class="sy0">=</span> <span class="st0">&quot;radio_db_name&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$dbtable</span> <span class="sy0">=</span> <span class="st0">&quot;IP&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$shoutcasthost</span> <span class="sy0">=</span> <span class="st0">&quot;your.shoutcast.server.com:1234&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$shoutcastuser</span> <span class="sy0">=</span> <span class="st0">&quot;admin&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$shoutcastpassword</span> <span class="sy0">=</span> <span class="st0">&quot;your_shoutcast_password&quot;</span><span class="sy0">;</span><br />
<span class="sy1">?&gt;</span></div>
</div>
<p>Make sure the table name isn&#8217;t the same as any existing table you might have already.  And don&#8217;t put &#8220;http://&#8221; anywhere in the parameters.</p>
<p>To create a new table in your database to hold the IP-to-country mapping data, here&#8217;s create.php:</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">&lt;?php</span><br />
<span class="kw1">require</span><span class="br0">&#40;</span><span class="st0">&quot;config.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$db</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a><span class="br0">&#40;</span><span class="re0">$dbhost</span><span class="sy0">,</span> <span class="re0">$dbuser</span><span class="sy0">,</span> <span class="re0">$dbpassword</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a><span class="br0">&#40;</span><span class="re0">$dbname</span><span class="sy0">,</span> <span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;CREATE TABLE `<span class="es4">$dbtable</span>` (<br />
&nbsp; `id` int(11) NOT NULL auto_increment,<br />
&nbsp; `startip` bigint(20) unsigned NOT NULL,<br />
&nbsp; `endip` bigint(20) unsigned NOT NULL,<br />
&nbsp; `country` varchar(5) NOT NULL,<br />
&nbsp; PRIMARY KEY &nbsp;(`id`),<br />
&nbsp; KEY `from` (`startip`,`endip`)<br />
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;&quot;</span><span class="sy0">;</span><br />
<span class="kw1">echo</span> <span class="re0">$query</span> <span class="sy0">.</span> <span class="st0">&quot;&lt;br&gt;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span><br />
<span class="re0">$result</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query</span><span class="sy0">,</span> <span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/mysql_close"><span class="kw3">mysql_close</span></a><span class="br0">&#40;</span><span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="sy1">?&gt;</span></div>
</div>
<p>Run that once.  It&#8217;ll display the SQL used to create the table.  If you don&#8217;t see a boatload of error messages, rejoice.</p>
<p>Then it&#8217;s time to populate your new table with LOTS AND LOTS of data!  Fortunately there is a wonderful group of volunteers at <a href="http://software77.net">http://software77.net</a> that have done all the work and provide this data as a public service.  I am in awe.  Create and run a file named update.php:</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">&lt;?php</span><br />
<span class="kw1">require</span><span class="br0">&#40;</span><span class="st0">&quot;config.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$db</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a><span class="br0">&#40;</span><span class="re0">$dbhost</span><span class="sy0">,</span> <span class="re0">$dbuser</span><span class="sy0">,</span> <span class="re0">$dbpassword</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a><span class="br0">&#40;</span><span class="re0">$dbname</span><span class="sy0">,</span> <span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;DELETE FROM <span class="es4">$dbtable</span>;&quot;</span><span class="sy0">;</span><br />
<span class="kw1">echo</span> <span class="re0">$query</span> <span class="sy0">.</span> <span class="st0">&quot;&lt;br&gt;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span><br />
<span class="re0">$result</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query</span><span class="sy0">,</span> <span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$fp</span> <span class="sy0">=</span> <a href="http://www.php.net/fopen"><span class="kw3">fopen</span></a><span class="br0">&#40;</span><span class="st0">&quot;compress.zlib://http://software77.net/geo-ip?DL=1&quot;</span><span class="sy0">,</span> <span class="st0">&quot;r&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw1">while</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/feof"><span class="kw3">feof</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$row</span> <span class="sy0">=</span> <a href="http://www.php.net/fgets"><span class="kw3">fgets</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> 4096<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>left<span class="br0">&#40;</span><span class="re0">$row</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">&#41;</span> <span class="sy0">!=</span> <span class="st_h">&#8216;#&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$data</span> <span class="sy0">=</span> <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st0">&quot;<span class="es1">\&quot;</span>&quot;</span><span class="sy0">,</span> <span class="re0">$row</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#91;</span><span class="nu0">9</span><span class="br0">&#93;</span> <span class="sy0">!=</span> <span class="st_h">&#8221;</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$data</span><span class="br0">&#91;</span><span class="nu0">9</span><span class="br0">&#93;</span> <span class="sy0">!=</span> <span class="st_h">&#8216;US&#8217;</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$data</span><span class="br0">&#91;</span><span class="nu0">9</span><span class="br0">&#93;</span> <span class="sy0">!=</span> <span class="st_h">&#8216;ZZ&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;INSERT INTO <span class="es4">$dbtable</span> (startip, endip, country) VALUES (&#8217;<span class="es4">$data[1]</span>&#8216;, &#8216;<span class="es4">$data[3]</span>&#8216;, &#8216;<span class="es4">$data[9]</span>&#8216;);&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">echo</span> <span class="re0">$query</span> <span class="sy0">.</span> <span class="st0">&quot;&lt;br&gt;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$result</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query</span><span class="sy0">,</span> <span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$num</span><span class="sy0">++;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<a href="http://www.php.net/mysql_close"><span class="kw3">mysql_close</span></a><span class="br0">&#40;</span><span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/fclose"><span class="kw3">fclose</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw1">echo</span> <span class="st0">&quot;<span class="es4">$num</span> records<span class="es1">\n</span>&quot;</span><span class="sy0">;</span><br />
<span class="kw2">function</span> left<span class="br0">&#40;</span><span class="re0">$string</span><span class="sy0">,</span> <span class="re0">$count</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$string</span><span class="sy0">,</span> 0<span class="sy0">,</span> <span class="re0">$count</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="sy1">?&gt;</span></div>
</div>
<p>Once you get that script debugged, you only need to run it maybe once every few months to update the table with the latest data.  It should display all the SQL statements used to update the data, and once again cross your fingers hoping for no error messages.</p>
<p>If you update too often, you&#8217;ll get banned from using the database, so only update the data once a day, at max.  Please see http://software77.net/faq.html for details.  This is more than reasonable.</p>
<p>And now comes the script to actually connect to your Shoutcast server, look up all your listeners, and list them out.  First, make sure your Shoutcast server is configured to display listener addresses as IP addresses, not domain names.  Then, try out listeners.php:</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">&lt;?php</span></p>
<p><a href="http://www.php.net/error_reporting"><span class="kw3">error_reporting</span></a><span class="br0">&#40;</span>0<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">&quot;Content-Type: text/html&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="re0">$countries</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a> <span class="br0">&#40;</span><br />
<span class="st0">&quot;ac&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Ascension Island&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ad&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Andorra&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ae&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;United Arab Emirates&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;af&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Afghanistan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ag&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Antigua and Barbuda&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ai&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Anguilla&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;al&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Albania&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;am&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Armenia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;an&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Netherlands Antilles&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ao&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Angola&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;aq&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Antarctica&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ar&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Argentina&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;as&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;American Samoa&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;at&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Austria&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;au&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Australia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;aw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Aruba&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ax&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Åland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;az&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Azerbaijan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ba&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bosnia and Herzegovina&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bb&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Barbados&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bd&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bangladesh&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;be&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Belgium&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bf&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Burkina Faso&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bulgaria&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bh&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bahrain&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bi&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Burundi&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bj&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Benin&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bermuda&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Brunei Darussalam&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bo&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bolivia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;br&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Brazil&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bs&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bahamas&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Bhutan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Botswana&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;by&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Belarus&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;bz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Belize&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ca&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Canada&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cd&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Democratic Republic of the Congo&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cf&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Central African Republic&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Republic of the Congo&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ch&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Switzerland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ci&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Côte d&#8217;Ivoire&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ck&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cook Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cl&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Chile&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cameroon&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;People&#8217;s Republic of China&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;co&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Colombia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Costa Rica&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cuba&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cv&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cape Verde&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cx&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Christmas Island&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cy&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cyprus&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;cz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Czech Republic&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;de&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Germany&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;dj&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Djibouti&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;dk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Denmark&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;dm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Dominica&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;do&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Dominican Republic&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;dz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Algeria&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ec&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Ecuador&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ee&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Estonia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;eg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Egypt&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;er&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Eritrea&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;es&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Spain&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;et&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Ethiopia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;fi&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Finland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;fj&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Fiji&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;fk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Falkland Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;fo&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Faroe Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;fr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;France&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ga&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Gabon&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gb&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;United Kingdom&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gd&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Grenada&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ge&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Georgia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gf&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;French Guiana&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guernsey&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gh&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Ghana&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gi&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Gibraltar&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gl&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Greenland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;The Gambia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guinea&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gp&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guadeloupe&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gq&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Equatorial Guinea&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Greece&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guatemala&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guam&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guinea-Bissau&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;gy&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Guyana&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;hk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Hong Kong&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;hn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Honduras&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;hr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Croatia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ht&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Haiti&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;hu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Hungary&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;id&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Indonesia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ie&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Ireland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;il&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Israel&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;im&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Isle of Man&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;in&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Indi&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;iq&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Iraq&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ir&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Iran&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;is&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Iceland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;it&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Italy&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;je&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Jersey&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;jm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Jamaica&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;jo&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Jordan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;jp&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Japan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ke&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Kenya&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;kg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Kyrgyzstan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;kh&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cambodia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ki&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Kiribati&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;km&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Comoros&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;kr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;South Korea&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;kw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Kuwait&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ky&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Cayman Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;kz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Kazakhstan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;la&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Laos&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lb&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Lebanon&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lc&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Saint Lucia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;li&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Liechtenstein&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Sri Lanka&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Liberia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ls&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Lesotho&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Lithuania&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Luxembourg&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;lv&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Latvia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ly&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Libya&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ma&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Morocco&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mc&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Monaco&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;md&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Moldova&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Madagascar&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mh&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Marshall Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Republic of Macedonia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ml&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mali&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Myanmar&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mongolia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mp&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Northern Mariana Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mq&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Martinique&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mauritania&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ms&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Montserrat&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Malta&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mauritius&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mv&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Maldives&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Malawi&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mx&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mexico&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;my&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Malaysia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;mz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mozambique&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;na&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Namibia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;nc&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;New Caledonia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ne&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Niger&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;nf&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Norfolk Island&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ng&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Nigeria&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ni&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Nicaragua&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;nl&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Netherlands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;no&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Norway&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;np&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Nepal&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;nr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Nauru&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;nz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;New Zealand&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;om&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Oman&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pa&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Panama&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pe&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Peru&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pf&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;French Polynesia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Papua New Guinea&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ph&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Philippines&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Pakistan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pl&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Poland&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Pitcairn Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Puerto Rico&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Portugal&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;pw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Palau&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;py&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Paraguay&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;qa&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Qatar&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;re&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Réunion&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ro&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Romania&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ru&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Russia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;rw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Rwanda&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sa&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Saudi Arabia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sb&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Solomon Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sc&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Seychelles&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sd&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Sudan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;se&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Sweden&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Singapore&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sh&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Saint Helena&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;si&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Slovenia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Slovakia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sl&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Sierra Leone&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;San Marino&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Senegal&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;so&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Somalia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Suriname&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;st&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;São Tomé and Príncipe&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;su&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;former Soviet Union&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sv&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;El Salvador&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sy&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Syria&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;sz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Swazilan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;td&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Chad&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Togo&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;th&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Thailand&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tj&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Tajikistan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tl&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;East Timor&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Turkmenistan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Tunisia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;to&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Tonga&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tp&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;East Timor&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tr&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Turkey&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Trinidad and Tobago&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Taiwan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;tz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Tanzania&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ua&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Ukraine&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ug&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Uganda&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;uk&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;United Kingdom&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;um&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;United States Minor Outlying Island&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;uy&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Uruguay&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;uz&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Uzbekistan&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;va&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Vatican City State&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;vc&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Saint Vincent and the Grenadines&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ve&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Venezuela&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;vg&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;British Virgin Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;vi&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;U.S. Virgin Islands&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;vn&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Vietnam&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;vu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Vanuatu&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;wf&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Wallis and Futuna&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ws&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Samoa&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;ye&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Yemen&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;yt&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Mayotte&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;yu&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Yugoslavia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;za&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;South Africa&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;zm&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Zambia&quot;</span><span class="sy0">,</span><br />
<span class="st0">&quot;zw&quot;</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;Zimbabwe&quot;</span><br />
<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw1">require</span><span class="br0">&#40;</span><span class="st0">&quot;config.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="re0">$db</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a><span class="br0">&#40;</span><span class="re0">$dbhost</span><span class="sy0">,</span> <span class="re0">$dbuser</span><span class="sy0">,</span> <span class="re0">$dbpassword</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a><span class="br0">&#40;</span><span class="re0">$dbname</span><span class="sy0">,</span> <span class="re0">$db</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="re0">$conn</span> <span class="sy0">=</span> <span class="kw2">new</span> COM<span class="br0">&#40;</span><span class="st0">&quot;ADODB.Connection&quot;</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="st0">&quot;Cannot start ADO&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$conn</span><span class="sy0">-&gt;</span><span class="me1">Open</span><span class="br0">&#40;</span><span class="st0">&quot;DRIVER={MySQL ODBC 3.51 Driver}; SERVER=<span class="es4">$dbhost</span>; PORT=<span class="es4">$dbport</span>; DATABASE=<span class="es4">$dbname</span>; USER=<span class="es4">$dbuser</span>; PASSWORD=<span class="es4">$dbpassword</span>; OPTION=3;&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="re0">$mysession</span> <span class="sy0">=</span> <a href="http://www.php.net/curl_init"><span class="kw3">curl_init</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_URL<span class="sy0">,</span> <span class="st0">&quot;http://<span class="es4">$shoutcasthost</span>/admin.cgi?mode=viewxml&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_HEADER<span class="sy0">,</span> <span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_RETURNTRANSFER<span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_POST<span class="sy0">,</span> <span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_HTTPAUTH<span class="sy0">,</span> CURLAUTH_BASIC<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_USERPWD<span class="sy0">,</span> <span class="st0">&quot;<span class="es4">$shoutcastuser</span>:<span class="es4">$shoutcastpassword</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_FOLLOWLOCATION<span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_setopt"><span class="kw3">curl_setopt</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="sy0">,</span> CURLOPT_USERAGENT<span class="sy0">,</span> <span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">&#8216;HTTP_USER_AGENT&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$xml</span> <span class="sy0">=</span> <a href="http://www.php.net/curl_exec"><span class="kw3">curl_exec</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/curl_close"><span class="kw3">curl_close</span></a><span class="br0">&#40;</span><span class="re0">$mysession</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="re0">$result</span> <span class="sy0">=</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span><br />
<span class="re0">$listeners</span> <span class="sy0">=</span> <span class="st0">&quot;0&quot;</span><span class="sy0">;</span><br />
<span class="re0">$maxlisteners</span> <span class="sy0">=</span> <span class="st0">&quot;0&quot;</span><span class="sy0">;</span></p>
<p><span class="re0">$xml_parser</span> <span class="sy0">=</span> <a href="http://www.php.net/xml_parser_create"><span class="kw3">xml_parser_create</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/xml_set_element_handler"><span class="kw3">xml_set_element_handler</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="sy0">,</span> <span class="st0">&quot;startElement&quot;</span><span class="sy0">,</span> <span class="st0">&quot;endElement&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/xml_set_character_data_handler"><span class="kw3">xml_set_character_data_handler</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="sy0">,</span> <span class="st0">&quot;characterData&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/xml_parse"><span class="kw3">xml_parse</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="sy0">,</span> <span class="re0">$xml</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/xml_parser_free"><span class="kw3">xml_parser_free</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="re0">$usa</span> <span class="sy0">=</span> <span class="re0">$listeners</span><span class="sy0">;</span></p>
<p><span class="re0">$temp</span> <span class="sy0">=</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span><br />
<span class="re0">$count</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
<span class="re0">$suppress</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
<span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$country</span> <span class="kw1">as</span> <span class="re0">$key</span><span class="sy0">=&gt;</span><span class="re0">$val</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="re0">$country</span> <span class="sy0">=</span> <span class="re0">$countries</span><span class="br0">&#91;</span><span class="re0">$key</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><span class="re0">$country</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> 0<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$count</span><span class="sy0">++;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$suppress</span> <span class="sy0">==</span> 0<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$temp</span> <span class="sy0">.=</span> <span class="st0">&quot;,&amp;nbsp;&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$suppress</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$val</span> <span class="sy0">&lt;&gt;</span> 1<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$temp</span> <span class="sy0">.=</span> <span class="st0">&quot;<span class="es4">$country</span>&amp;nbsp;(<span class="es4">$val</span>)&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$temp</span> <span class="sy0">.=</span> <span class="st0">&quot;<span class="es4">$country</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$usa</span> <span class="sy0">-=</span> <span class="re0">$val</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$count</span> <span class="sy0">&gt;</span> 5<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$temp</span> <span class="sy0">.=</span> <span class="st0">&quot;,&lt;br&gt;&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$count</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$suppress</span> <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$temp</span><span class="sy0">,</span> <span class="sy0">-</span><span class="nu0">1</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;;&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="re0">$temp</span> <span class="sy0">=</span> <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$temp</span><span class="sy0">,</span> 0<span class="sy0">,</span> <span class="sy0">-</span>7<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$temp</span><span class="sy0">,</span> <span class="sy0">-</span><span class="nu0">1</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">&quot;&gt;&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="re0">$temp</span> <span class="sy0">=</span> <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$temp</span><span class="sy0">,</span> 0<span class="sy0">,</span> <span class="sy0">-</span>5<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="re0">$result</span> <span class="sy0">=</span> <span class="st0">&quot;&lt;b&gt;There are currently <span class="es4">$listeners</span> out of <span class="es4">$maxlisteners</span> listeners from:&lt;/b&gt;&lt;br&gt;&lt;font size=1&gt;USA (<span class="es4">$usa</span>)<span class="es4">$temp</span>&lt;/font&gt;&quot;</span><span class="sy0">;</span></p>
<p><span class="kw1">echo</span> <a href="http://www.php.net/trim"><span class="kw3">trim</span></a><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw2">function</span> iplookup<span class="br0">&#40;</span><span class="re0">$ipdata</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">global</span> <span class="re0">$conn</span><span class="sy0">;</span><br />
&nbsp; <span class="kw2">global</span> <span class="re0">$dbtable</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$parts</span> <span class="sy0">=</span> <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st0">&quot;.&quot;</span><span class="sy0">,</span> <span class="re0">$ipdata</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$value</span> <span class="sy0">=</span> <span class="re0">$parts</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$value</span> <span class="sy0">=</span> <span class="re0">$value</span> <span class="sy0">*</span> 256 <span class="sy0">+</span> <span class="re0">$parts</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$value</span> <span class="sy0">=</span> <span class="re0">$value</span> <span class="sy0">*</span> 256 <span class="sy0">+</span> <span class="re0">$parts</span><span class="br0">&#91;</span>2<span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$value</span> <span class="sy0">=</span> <span class="re0">$value</span> <span class="sy0">*</span> 256 <span class="sy0">+</span> <span class="re0">$parts</span><span class="br0">&#91;</span>3<span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$sql</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT country FROM <span class="es4">$dbtable</span> WHERE startip &lt;= <span class="es4">$value</span> AND endip &gt;= <span class="es4">$value</span>;&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//echo $sql . &quot;\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$rs</span> <span class="sy0">=</span> <span class="re0">$conn</span><span class="sy0">-&gt;</span><span class="me1">Execute</span><span class="br0">&#40;</span><span class="re0">$sql</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$rs</span><span class="sy0">-&gt;</span><span class="me1">EOF</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="re0">$rv</span> <span class="sy0">=</span> <span class="re0">$rs</span><span class="sy0">-&gt;</span><span class="me1">Fields</span><span class="br0">&#40;</span><span class="st0">&quot;country&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="sy0">@</span><span class="re0">$country</span> <span class="sy0">=</span> <span class="re0">$rv</span><span class="sy0">-&gt;</span><span class="me1">value</span><span class="sy0">;</span><br />
&nbsp; <span class="re0">$country</span> <span class="sy0">=</span> <a href="http://www.php.net/strtolower"><span class="kw3">strtolower</span></a><span class="br0">&#40;</span><span class="re0">$country</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="co1">//echo &quot;country &quot; . $country . &quot;\n&quot;;</span><br />
&nbsp; <span class="re0">$rs</span><span class="sy0">-&gt;</span><span class="me1">Close</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$country</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">function</span> startElement<span class="br0">&#40;</span><span class="re0">$parser</span><span class="sy0">,</span> <span class="re0">$name</span><span class="sy0">,</span> <span class="re0">$attrs</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$curTag</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="re0">$curTag</span> <span class="sy0">.=</span> <span class="st0">&quot;^<span class="es4">$name</span>&quot;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">function</span> endElement<span class="br0">&#40;</span><span class="re0">$parser</span><span class="sy0">,</span> <span class="re0">$name</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$curTag</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="re0">$caret_pos</span> <span class="sy0">=</span> <a href="http://www.php.net/strrpos"><span class="kw3">strrpos</span></a><span class="br0">&#40;</span><span class="re0">$curTag</span><span class="sy0">,</span> <span class="st_h">&#8216;^&#8217;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="re0">$curTag</span> <span class="sy0">=</span> <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$curTag</span><span class="sy0">,</span> 0<span class="sy0">,</span> <span class="re0">$caret_pos</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">function</span> characterData<span class="br0">&#40;</span><span class="re0">$parser</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$curTag</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$country</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$listeners</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$maxlisteners</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="kw2">global</span> <span class="re0">$songs</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$curTag</span> <span class="sy0">==</span> <span class="st0">&quot;^SHOUTCASTSERVER^LISTENERS^LISTENER^HOSTNAME&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$i</span> <span class="sy0">=</span> iplookup<span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$country</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="sy0">++;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$curTag</span> <span class="sy0">==</span> <span class="st0">&quot;^SHOUTCASTSERVER^CURRENTLISTENERS&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$listeners</span> <span class="sy0">=</span> <span class="re0">$data</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$curTag</span> <span class="sy0">==</span> <span class="st0">&quot;^SHOUTCASTSERVER^MAXLISTENERS&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$maxlisteners</span> <span class="sy0">=</span> <span class="re0">$data</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="sy1">?&gt;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=17</wfw:commentRss>
		</item>
		<item>
		<title>Whacking Spambots With Extreme Prejudice</title>
		<link>http://rickadams.org/weblog/?p=12</link>
		<comments>http://rickadams.org/weblog/?p=12#comments</comments>
		<pubDate>Sat, 29 Nov 2008 01:15:57 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Workshop]]></category>

		<guid isPermaLink="false">http://rickadams.org/weblog/?p=12</guid>
		<description><![CDATA[A while back, I noticed a few spambots liked to make the rounds of all the FTP servers in our area, mindlessly trying to connect as ADMINISTRATOR with a few dozen passwords.  I&#8217;d just chuckle and murmur, &#8220;Good luck with that,&#8221; seeing as the FTP server at work doesn&#8217;t even HAVE an account for administrator.  [...]]]></description>
			<content:encoded><![CDATA[<p>A while back, I noticed a few spambots liked to make the rounds of all the FTP servers in our area, mindlessly trying to connect as ADMINISTRATOR with a few dozen passwords.  I&#8217;d just chuckle and murmur, &#8220;Good luck with that,&#8221; seeing as the FTP server at work doesn&#8217;t even HAVE an account for administrator.  (Well, yeah, it&#8217;s got an administrator account, but not named &#8220;Administrator,&#8221; and with a sufficiently byzantine password that a dictionary attack isn&#8217;t going to help.)</p>
<p>After a while, the bot would give up and go back to rattling the doorknobs down the street.  I use a homebrew FTP server I coded myself using an ActiveX control to provide FTP, SFTP and FTPS functionality, and I impishly added a &#8220;hack counter&#8221; to keep a running total of how many such attempts had been made.</p>
<p>About a month ago the FTP server started mysteriously falling over dead on a daily basis, so I took a peek into the logs, and found some crazy Chinese botnet was crawling all over it, trying more sophisticated attacks, some of which were running afoul of some weaknesses in my code.</p>
<p>That didn&#8217;t take long to fix, but a look at the logs informed me that my strategy of benign indifference wasn&#8217;t going to cut it anymore.  They weren&#8217;t just trying the administrator account, they were trying all kinds of fairly reasonable-sounding usernames, too.</p>
<p>Well, that&#8217;s no good.  That actually had a slight chance of working.  And there were the devil&#8217;s own lot of them too, thousands a day trying to break in.  So I decided I had to get more proactive.</p>
<p>I added some code to ban the IP of anyone who failed login more than ten times, with an instant ban for anyone trying to log in as WEBADMIN, ADMINISTRATOR, or ROOT.</p>
<p>So now I look in the logs and see things like this:</p>
<pre>11/28/08 10:45:22 &gt;&gt; 22 ROOT 113.11.200.17 Disconnected
11/28/08 10:45:21 &gt;&gt; *** 113.11.200.17 BANNED ***
11/28/08 10:45:22 &gt;&gt; *** 113.11.200.17 BLOCKED ***
</pre>
<p>That &#8220;BLOCKED&#8221; is them getting bounced on their next attempt to connect.  I found that merely preventing authentication from succeeding wasn&#8217;t good enough&#8230; the bots just stubbornly keep plugging away hoping to hit paydirt&#8230; because what is time to a bot?</p>
<p>So when they&#8217;re banned, there&#8217;s code in the CONNECT event to bounce them right away.  They go to connect after their ban and all they get is a boot to the head.</p>
<p>Now I get maybe two or three attempts a day, and they usually get banned right away.  The FTP server stays up, and I learned a valuable lesson.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>Using jQuery/AJAX/PHP to Display Data From a Shoutcast Server</title>
		<link>http://rickadams.org/weblog/?p=9</link>
		<comments>http://rickadams.org/weblog/?p=9#comments</comments>
		<pubDate>Wed, 20 Aug 2008 02:02:42 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Workshop]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[JQuery]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://rickadams.org/test/?p=9</guid>
		<description><![CDATA[I&#8217;ve been experimenting with the jQuery Javascript library, and was looking for a little project to try it out on.  So I made a test page at http://yggdrasilradio.net/demo/ that polls my Shoutcast server data every 15 seconds using a PHP script, parses the XML that comes back, and displays it in a table using AJAX [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with the <a title="jQuery" href="http://jquery.com" target="_blank">jQuery</a> Javascript library, and was looking for a little project to try it out on.  So I made a test page at <a href="http://yggdrasilradio.net/demo/" target="_blank">http://yggdrasilradio.net/demo/</a> that polls my Shoutcast server data every 15 seconds using a PHP script, parses the XML that comes back, and displays it in a table using AJAX to update the page.</p>
<p>The book I&#8217;m reading to learn from is <a href="http://www.amazon.com/Learning-jQuery-Interaction-Development-JavaScript/dp/1847192505/" target="_blank">Learning jQuery</a>, and it&#8217;s pretty good, although the way the book describes AJAX (&#8221;Make your website buzzword-compliant!&#8221;), while amusing, gives me the feeling the author really isn&#8217;t taking this particular subject all that seriously.</p>
<p>If you have a Shoutcast server and want to play with the code yourself, have at it:  <a href="http://yggdrasilradio.net/download/demo.zip">demo.zip</a>.  Unzip that and put the &#8220;demo&#8221; folder just off your webroot on a webserver, with all the files in it.  There&#8217;s a couple of parameters at the beginning of playing.php you&#8217;ll need to edit for your Shoutcast server.</p>
<p>Start out by loading playing.php from your webserver into your browser.  If you see a bunch of song titles, you&#8217;ll know all is well.  If your webserver doesn&#8217;t support PHP or the PHP Curl library used to access the Shoutcast XML data, then you&#8217;ll be out of luck.   Take a look at the source of the returned page to see what it really looks like, since your webbrowser will mush it all together.</p>
<p>Then load up the main page at http://yourserver.com/demo.  You should see a pretty display of your listeners, the currently playing song, and the five previously played songs.  I might make this into a nice plugin for Wordpress one of these days.</p>
<p>Let the page sit there for awhile, and you&#8217;ll notice that it updates itself automatically as new songs play, listeners join or leave the audio stream, etc.  That&#8217;s what AJAX is doing for you.  The PHP script even attempts to figure out where all your listeners are coming from, though it&#8217;s a bit simple-minded: it thinks anyone from a .com, .mil, .net or .org domain is from the USA.</p>
<p>Since each copy of the page that&#8217;s running anywhere in the world will hit the Shoutcast server for data every 15 seconds, this technique might not be good for Shoutcast streams with 300 listeners, but it works okay for my station.  You can find the full non-jQuery version of my streaming radio station at <a href="http://yggdrasilratio.net" target="_blank">http://yggdrasilratio.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Stupid DNS Tricks</title>
		<link>http://rickadams.org/weblog/?p=10</link>
		<comments>http://rickadams.org/weblog/?p=10#comments</comments>
		<pubDate>Sun, 05 Nov 2006 20:26:00 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://rickadams.org/test/?p=10</guid>
		<description><![CDATA[As a bit of election-year skullduggery, some clown registered what you might expect to be website names for DFL candidate for MN Attorney General Lori Swanson, &#8220;loriswanson.com&#8221; and &#8220;loriswanson.org,&#8221; and redirected them to http://www.johnsonforag.org/, the website of her Republican opponent.
An obvious dirty trick, said the Swanson campaign, demanding that the Johnson campaign immediately &#8220;block&#8221; those [...]]]></description>
			<content:encoded><![CDATA[<p>As a bit of election-year skullduggery, some clown registered what you might expect to be website names for DFL candidate for MN Attorney General Lori Swanson, &#8220;loriswanson.com&#8221; and &#8220;loriswanson.org,&#8221; and redirected them to http://www.johnsonforag.org/, the website of her Republican opponent.</p>
<p>An obvious dirty trick, said the Swanson campaign, demanding that the Johnson campaign immediately &#8220;block&#8221; those sites. The Johnson campaign immediately responded that since they don&#8217;t own or have any control over those website names, that would be impossible.</p>
<p>Ah, but that would be child&#8217;s play, countered numerous tech-savvy observers, including the proprietor of <a href=http://johnsonventenza.blogspot.com/>this blog</a>, who said, &#8220;I don&#8217;t know why they couldn&#8217;t contact their ISP, Hosting Matters, and have them block all HTTP requests coming from the loriswanson sites.&#8221;</p>
<p>But it turns out it&#8217;s not that simple.  When you are on site A and click on a link to site B, you don&#8217;t zoom through a tunnel from site A to site B&#8230; your computer disconnects from site A, and then your computer connects to site B.</p>
<p>If you follow a link, though, there IS one thing in your connection to site B that marks it as being &#8220;from&#8221; site A&#8230; a field in the request called HTTP_REFERER.  However, in the case of a server redirect, which is the method being used to redirect the traffic for this little trick, this field does not appear.  There is NOTHING in the request to distinguish it from a normal visit to the webserver by someone who legitimately wanted to visit the Johnson website.</p>
<p>I, too, thought it would be the work of a moment to block traffic from the bogus Lori Swanson sites, and confidently coded up a PHP script to do it, thinking to give it to the tech people at the Johnson campaign.  Then I went to test it.  After an hour of cursing and various experiments, I concluded it was impossible.</p>
<p>What is there in the request that would do the trick?  REMOTE_ADDR?  No, that&#8217;s the IP number of the computer coming to the Johnson website, either because they went to the correct website or one of the bogus ones.</p>
<p>If the prankster had simply pointed the DNS name to the Johnson website, you could filter on the HTTP_HOST field in the HTTP request.  Alas, they didn&#8217;t do it that way&#8230; they actually bought web hosting, pointed the names there, and put up a page that does a redirect to the target website.</p>
<p>I have to remind myself that &#8220;Any sufficiently advanced stupidity is indistinguishable from malice&#8221; (my own conflation of Hanlon&#8217;s Razor and Clarke&#8217;s Law), but it does seem interesting that someone spent extra money to implement this trick in a way that would be impossible to block.</p>
<p>It&#8217;s also interesting that the blog referenced above alleges that one of the bogus Lori Swanson sites earlier linked to a DFL website instead of the Johnson campaign, as it does now.  No, it doesn&#8217;t prove anything one way or the other, but it is intriguing.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>Help!  I Want to Escape From Global Escapes!</title>
		<link>http://rickadams.org/weblog/?p=3</link>
		<comments>http://rickadams.org/weblog/?p=3#comments</comments>
		<pubDate>Sun, 28 May 2006 18:09:49 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[lame]]></category>

		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://test.yggdrasilradio.net/?p=3</guid>
		<description><![CDATA[About four months ago, we started getting telemarketing calls from a &#8220;Terrell,&#8221; who didn&#8217;t seem to understand that we were on the Do Not Call list, and wouldn&#8217;t take &#8220;no&#8221; for an answer.
At first he told us he was calling for my son Tim, alleging he had entered a contest online. Terrell was pleased to [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;">About four months ago, we started getting telemarketing calls from a &#8220;Terrell,&#8221; who didn&#8217;t seem to understand that we were on the Do Not Call list, and wouldn&#8217;t take &#8220;no&#8221; for an answer.</span></p>
<p><span style="color: #000000;">At first he told us he was calling for my son Tim, alleging he had entered a contest online. Terrell was pleased to tell us that our son had won a Cadillac Escalade.</span></p>
<p><span style="color: #000000;">Well, Tim talked to the guy for awhile and figured it was a scam (for one thing, he couldn&#8217;t remember entering any such contest), so he told him he wasn&#8217;t interested. But still the calls continued.</span></p>
<p><span style="color: #000000;">Terrell seemed quite insistent. No matter how we tried to get it across to him that we wanted him to go away, he would call back.</span></p>
<p><span style="color: #000000;">And when I say &#8220;call back,&#8221; I mean that if you told him to stop calling and hung up the phone, he would call right back, repeatedly, each time getting madder and madder.</span></p>
<p><span style="color: #000000;">Eventually he would angrily demand that he be allowed to leave a message on the answering machine, after which he would go away for a few weeks, and then the cycle would be repeated.</span></p>
<p><span style="color: #000000;">I talked to the guy, and it sounded totally bogus to me. He would only identify himself as being from &#8220;The Awards and Claim Center,&#8221; and insisted that Tim had won one of five prizes, ranging from an Escalade to a flatscreen TV. All that was required was for Tim to attend an &#8220;awards ceremony.&#8221; This was not a telemarketing call, he said, and had nothing to do with timeshares.</span></p>
<p><span style="color: #000000;">This all sounded pretty dodgy. Telemarketers are supposed to identify what company they work for, and &#8220;The Awards and Claims Center&#8221; doesn&#8217;t cut it, among other things.</span></p>
<p><span style="color: #000000;">Eventually he gave up on Tim, and then turned his attention to me and my wife, saying that the prize had transferred to us. (Oh, lucky us!) And so the calls continued, for months. Nothing we could do would get this guy to stop calling.</span></p>
<p><span style="color: #000000;">One day he got my wife on the phone, insisting that she and I come to this &#8220;awards ceremony,&#8221; and in a weak moment she tentatively agreed, but added that I would have to approve it. Well, when she told me about it, I hit the roof. She had even given him my email address so they could send directions to the &#8220;award ceremony.&#8221;</span></p>
<p><span style="color: #000000;">She then called the guy&#8217;s voice mail and left a message saying we were cancelling.</span></p>
<p><span style="color: #000000;">At that point he got my daughter over the phone and demanded that she give him my wife&#8217;s cellphone number. When she resisted, he badgered her, saying &#8220;This is very important time-sensitive information, young lady!&#8221; She gave in and gave him the number.</span></p>
<p><span style="color: #000000;">So now we had him calling the home phone number and my wife&#8217;s cellphone. If she hung up on him, he would call back, again, and again, and again. The guy scared her to death, and she vowed she just wouldn&#8217;t answer her cell if it was him on the caller ID.</span></p>
<p><span style="color: #000000;">But then we got a break. They emailed me information on the upcoming meeting, which identified the company involved as &#8220;Global Escapes.&#8221; This is an outfit that tries to sell a website service for finding timeshare and other vacation opportunities, with a branch in nearby Eden Prairie.</span></p>
<p><span style="color: #000000;">Shortly after that, my wife and I had just driven home, and she was getting out of the car when the cellphone rang. Without thinking, she flipped her phone open, thinking it was our son Joel. Then&#8230; &#8220;Oh my God, it&#8217;s HIM!&#8221; she screamed, and flipped the phone closed, hanging up.</span></p>
<p><span style="color: #000000;">Immediately, the cellphone rang again, and I took it from her. &#8220;Terrell&#8221; began his spiel once again, and I cut in with &#8220;STOP CALLING US. STOP CALLING US.&#8221; I then hung up.</span></p>
<p><span style="color: #000000;">The cellphone rang again, and so I turned it off. This enabled him to leave a message on voice mail, which smugly ended with &#8220;&#8230;and have a GREAT day!&#8221;</span></p>
<p><span style="color: #000000;">That was the day I filed a complaint with the Minnesota Attorney General&#8217;s office.</span></p>
<p><span style="color: #000000;">He called a few more times, but eventually he stopped calling, and of course you can guess why. It turns out the AG&#8217;s office called up the CEO of Global Escapes, they had a friendly little chat, and Global Escapes agreed to stop calling me.</span></p>
<p><span style="color: #000000;">Global Escapes wrote a nice little letter, saying that oh, yes, they comply with all Do Not Call lists, they do not do telemarketing directly but contract it out, we have no idea how this happened, etc, etc.</span></p>
<p><span style="color: #000000;">Is the service Global Escapes is selling worthwhile? I am unqualified to have an opinion on that. However, I can tell you from experience that their telemarketing practices suck.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
		<item>
		<title>The NSA is Spying on You!  And the ALA is Spying on Me!</title>
		<link>http://rickadams.org/weblog/?p=11</link>
		<comments>http://rickadams.org/weblog/?p=11#comments</comments>
		<pubDate>Thu, 29 Dec 2005 20:29:35 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rickadams.org/weblog/?p=11</guid>
		<description><![CDATA[Spy Agency Removes Illegal Tracking Files
The National Security Agency&#8217;s Internet site has been placing files on visitors&#8217; computers that can track their Web surfing activity despite strict federal rules banning most files of that type. &#8212; Associated Press
Those naughty scamps over at the NSA!  What crazy hackery are they up to now?  Spyware? [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Spy Agency Removes Illegal Tracking Files</strong></p>
<p><em>The National Security Agency&#8217;s Internet site has been placing files on visitors&#8217; computers that can track their Web surfing activity despite strict federal rules banning most files of that type. &#8212; Associated Press</em></p>
<p>Those naughty scamps over at the NSA!  What crazy hackery are they up to now?  Spyware?  A virus developed by some master hacker?  A rogue ActiveX control?</p>
<p>No, just &#8220;cookies.&#8221;</p>
<p>&#8220;Cookie&#8221; files are small text files, usually used to store user preferences for specific websites.  If your browser is set to allow it, they can be stored on your computer by a specific website&#8230; and read by that website&#8230; and that&#8217;s it.</p>
<p>Cookies set by one website can&#8217;t be read by any other website.  They&#8217;re data files, not programs.  Once you go away from the website that set them there, all they can do is just sit there.</p>
<p>In other words, there&#8217;s no way to &#8220;track web surfing&#8221; via cookies.  This is complete nonsense.  A website can track which pages you visit ON THAT SITE, but that information is available from the server logs without the use of cookies.</p>
<p>And of course, this is the NSA we&#8217;re talking about.  If they have an interest in tracking your web surfing habits, they&#8217;re perfectly capable of intercepting and analyzing the Internet backbone traffic for that information.  I guarantee you cookies won&#8217;t be involved.</p>
<p>What the NSA&#8217;s exact capabilities are, what they&#8217;re doing, and what they should be allowed to do certainly are reasonable subjects for debate.  But this is ludicrous.</p>
<p><img src="/cookies.jpg" alt="" hspace="7" align="left" /><br />
Take a look at the cookies left behind by the NSA&#8217;s website on the computer of <a href="http://scoutprime.blogspot.com/2005/12/i-got-nsa-cookies.html"> one concerned blogger.</a></p>
<p>The specific cookies he found were CFID, CFGLOBALS and CFTOKEN.  These happen to be typical cookies set to store session information by the <a href="http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_17919">Cold Fusion website hosting software</a>.</p>
<p>Note that similar cookies from other websites are listed along with the NSA&#8217;s cookies, but since they aren&#8217;t from the NSA, he&#8217;s not worried about those.</p>
<p>On my computer, the exact same CFID and CFTOKEN cookies were set by the website for <a href="http://www.ala.org">The American Library Association</a>, which I doubt is a hotbed of covert intelligence activity.</p>
<p>But wait!  Weren&#8217;t there &#8220;strict federal rules&#8221; against such things?</p>
<p>Well, yes and no.  There&#8217;s policies in place prohibiting government websites from setting cookies, most probably simply to avoid the appearance of impropriety.  But non-governmental websites you visit can set as many cookies as they want.  And it&#8217;s most certainly not &#8220;illegal.&#8221;</p>
<p>This website sometimes sets a session cookie even though I don&#8217;t do anything with it.  It&#8217;s HARD not to set a cookie; most software sets one by default. But sleep well&#8230; I mean you no harm.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>Foreign Magazines Sure Are Interesting!</title>
		<link>http://rickadams.org/weblog/?p=7</link>
		<comments>http://rickadams.org/weblog/?p=7#comments</comments>
		<pubDate>Mon, 23 May 2005 02:20:24 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rickadams.org/test/?p=7</guid>
		<description><![CDATA[You sure do get a different perspective when you read foreign magazines!

Oh, you don&#8217;t read Japanese?  Here, maybe this will be better.

That&#8217;s&#8230; uh&#8230; wow.  Just&#8230; wow.
Note: the second graphic is just the first one, photoshopped, with my translation of various interesting parts.  Oh, and yes, the &#8220;scare quotes&#8221; really are in the [...]]]></description>
			<content:encoded><![CDATA[<p>You sure do get a different perspective when you read foreign magazines!</p>
<p><img src="/newsweek1.jpg" alt="" /></p>
<p>Oh, you don&#8217;t read Japanese?  Here, maybe this will be better.</p>
<p><img src="/newsweek2.jpg" alt="" /></p>
<p>That&#8217;s&#8230; uh&#8230; wow.  Just&#8230; wow.</p>
<p>Note: the second graphic is just the first one, photoshopped, with my translation of various interesting parts.  Oh, and yes, the &#8220;scare quotes&#8221; really are in the original.</p>
<p>Originally found at <a href="http://ridingsun.blogspot.com/2005/05/newsweek-america-is-dead.html">Riding Sun</a>.</p>
<p>Hm, you know, I&#8217;m kinda thinking these guys figure none of us can read Japanese.</p>
<p>This turns out not to be the case.  This is fascinating reading, I must admit.  Here&#8217;s an overview of the cover story:</p>
<table border="0" cellpadding="6">
<tbody>
<tr>
<td bgcolor="#eeeeee"><span style="font-family: verdana; font-size: xx-small;"><br />
<a href="http://www.nwj.ne.jp/public/toppage/20050202/toppage.html">http://www.nwj.ne.jp/public/toppage/20050202/toppage.html</a> </span><span style="font-family: verdana; font-size: xx-small;">The day America died</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Although Bush calls for an &#8220;expansion of freedom,&#8221; the world is not yearning after the &#8220;country of freedom,&#8221; the United States, any longer. New evidence of a decline of the United States in every sphere has been confirmed.</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">From the editorial staff</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">&#8220;Since Newsweek is an American magazine, why would it tell us of problems with Bush?&#8221; we are occasionally asked in an ironic tone. However, we do not take sides, but only analyze the meaning of events from various viewpoints. Perhaps this has led to misunderstandings.</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">What have Americans lost due to the Bush administration in the last four years, and what will the world lose in the next four years? Verified facts, not opinions from any viewpoint, are laid forth in the special report in this issue. </span></td>
</tr>
</tbody>
</table>
<p>And here&#8217;s a more detailed breakdown of what&#8217;s covered:</p>
<table border="0" cellpadding="6">
<tbody>
<tr>
<td bgcolor="#eeeeee"><span style="font-family: verdana; font-size: xx-small;"> </span><span style="font-family: verdana; font-size: xx-small;"><a href="http://www.nwj.ne.jp/public/toppage/20050202/editorsnote.html">http://www.nwj.ne.jp/public/toppage/20050202/editorsnote.html</a></span></p>
<p><span style="font-family: verdana; font-size: xx-small;">The Day America Died</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Although Bush calls for an &#8220;expansion of freedom,&#8221; the world is not yearning after the &#8220;country of freedom,&#8221; the United States, any longer. New evidence of a decline of the United States in every sphere has been confirmed.</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">America / The ideals of the second term, and the world&#8217;s reality</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">In his second inaugural address, President Bush held forth a vision of expansion of freedom. But from the current disorder in Iraq, it is plain that concrete proposals are more important than ideals. Whether or not Bush can make a contribution to history turns on this point.</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Viewpoint / America&#8217;s dreams fall into ruin</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">The era in which every corner of the globe yearned for the freedom and equality of America has ended. The brightness of the American dream has faded, while the influence of anti-American sentiment, and the EU, has grown. We examine the cause of this decline in politics, the economy, and foreign policy.</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Telecommunication / The IP revolution will eliminate telephone lines</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">In the 130 years since Graham Bell&#8217;s invention, &#8220;one telephone call, one circuit&#8221; has been the accepted norm, but now a huge paradigm shift has occurred. It is only a matter of time before IP telephony, transmitting and receiving voice data via a network, becomes a global standard.</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Popular series:</span></p>
<ul> <span style="font-family: verdana; font-size: xx-small;"></p>
<li>Speak business English and improve your English mail composition skills immediately!</li>
<li> A foreigner in Tokyo violates a taboo! The scathing column, &#8220;Tokyo Eye!&#8221;</li>
<p></span></ul>
</td>
</tr>
</tbody>
</table>
<p>Well, although they may all hate us, it&#8217;s gratifying they still want to be able to talk to us.  Fascinating.</p>
<p><strong>Update: Even more!</strong></p>
<table border="0" cellpadding="6">
<tbody>
<tr>
<td bgcolor="#eeeeee"><span style="font-family: verdana; font-size: xx-small;"> </span><span style="font-family: verdana; font-size: xx-small;"><a href="http://www.nwj.ne.jp/public/toppage/20050202/twcontents.html">http://www.nwj.ne.jp/public/toppage/20050202/twcontents.html</a></span></p>
<p><span style="font-family: verdana; font-size: xx-small;">America</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">The ideals of the second term and the world&#8217;s reality.</span></p>
<p>Though expansion of freedom is the goal, the reality does not follow.</p>
<p><span style="font-family: verdana; font-size: xx-small;">Foreign Affairs</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Where is Rice&#8217;s diplomacy taking us? Her true intentions not seen.</span></p>
<p>As expected, the next Secretary of State is a neocon?</p>
<p><span style="font-family: verdana; font-size: xx-small;">Viewpoint</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">When America&#8217;s dreams fall into ruin.</span></p>
<p>With America in decline, to call it a &#8220;great country&#8221; is an illusion.</p>
<p><span style="font-family: verdana; font-size: xx-small;">Iraq</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">Free elections without freedom.</span></p>
<p>To bring about elections, U.S. military forces tighten their stranglehold.</td>
</tr>
</tbody>
</table>
<p><strong>Update: From the page where you can order back copies:</strong></p>
<table border="0" cellpadding="6">
<tbody>
<tr>
<td bgcolor="#eeeeee"><span style="font-family: verdana; font-size: xx-small;"> </span><span style="font-family: verdana; font-size: xx-small;"><a href="http://www.fujisan.co.jp/Product/5766/b/53550"></a>http://www.fujisan.co.jp/Product/5766/b/53550/</span></p>
<p><span style="font-family: verdana; font-size: xx-small;">URGENT/EMERGENCY REPORT!</span></p>
<p>The Bush inauguration is the death anniversary of the &#8220;ideal of freedom.&#8221;</td>
</tr>
</tbody>
</table>
<p>Oh yes, here it comes!  I&#8217;m now reading on various forums that &#8220;Newsweek doesn&#8217;t even have a Japanese edition,&#8221; and the image of the Japanese cover is completely made-up.<br />
Here&#8217;s a link to the made-up <a href="http://www.nwj.ne.jp/public/backnumbers/bnmenu/20050525/index-34.html">cover image</a> on the actual web site of the Japanese edition Newsweek doesn&#8217;t publish.  PUHLEEZE.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>My Favorite Manga</title>
		<link>http://rickadams.org/weblog/?p=8</link>
		<comments>http://rickadams.org/weblog/?p=8#comments</comments>
		<pubDate>Sun, 28 Dec 2003 02:35:01 +0000</pubDate>
		<dc:creator>rickadams</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rickadams.org/test/?p=8</guid>
		<description><![CDATA[
Yokohama Kadaishi Kikou
Quiet, atmospheric, philosophical story of Earth&#8217;s twilight days, and the humans and robots that remain.  The end will come, not with a bang or a whimper, but with solemn, graceful dancing, as the lights of the abandoned cities flicker under the surface of the rising ocean.

How do you write a series about [...]]]></description>
			<content:encoded><![CDATA[<p><img align=left src=/thumbnails/ykk.jpg><br clear=all></p>
<h3>Yokohama Kadaishi Kikou</h3>
<p>Quiet, atmospheric, philosophical story of Earth&#8217;s twilight days, and the humans and robots that remain.  The end will come, not with a bang or a whimper, but with solemn, graceful dancing, as the lights of the abandoned cities flicker under the surface of the rising ocean.</p>
<p>
How do you write a series about the End of the World that is cheery, rich with images of heart-rending beauty, and bright with hope? I can&#8217;t explain it. Just enjoy.<br />
<br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/midori.jpg><br clear=all></p>
<h3>Midori no Hibi</h3>
<p>Midori had this crush on local tough-guy-with-a-heart-of-gold Seiji, you see, but didn&#8217;t have the courage to confess to him.  So one day they both wake up to discover that she&#8217;s been chibified and magically attached to his right arm.</p>
<p>Awkward but heartwarming hilarity ensues.  Nuttiest premise EVER, but I love it.</p>
<p><br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/loveeva.jpg><br clear=all></p>
<h3>Evangelion Girlfriend of Steel</h3>
<p>Set in the cheery &#8220;alternate universe&#8221; that Shinji briefly visited before the Omedetou Hammer fell on episodes 25 and 26, this version of the Evangelion story (alternately nicknamed &#8220;Eva Lite,&#8221; or &#8220;Love Eva&#8221;) tends to exchange a bit of angst for school hijinx in later chapters, but I still enjoy it.</p>
<p><br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/azumanga.jpg><br clear=all></p>
<h3>Azumanga Daioh</h3>
<p>Chiyo ownz j00.  Azumanga is wacky, charming, and has a huge, rabidly<br />
devoted fanbase.<br />
<br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/gsg.jpg><br clear=all></p>
<h3>Gunslinger Girl</h3>
<p>This manga (and the well-done corresponding anime currently airing) has Bad End written all over it, but it&#8217;s still good.  Chise meets Kirika as orphaned girls are turned into lethal android assassins, amid political intrigue, girltalk, and oodles of pretty explosions and gunfire.</p>
<p><br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/amg.jpg><br clear=all></p>
<h3>Ah, My Goddess</h3>
<p>An oldie but a goodie.  Watch the character design slowly evolve from eyebrow Belldandy to Soccer Mom Belldandy, as the the cast of characters expands.
<p>As an added bonus, this is one of the rare &#8220;harem&#8221; stories where the male romantic lead is neither a lech, a wimp, or an idiot.</p>
<p>
&#8220;Switch&#8230; ON!&#8221;</p>
<p><br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/lilim.jpg><br clear=all></p>
<h3>Lilim&#8217;s Kiss</h3>
<p>She&#8217;s a cute demon who lives off human energy obtained by kissing, and after draining the batteries of an entire class, one guy in particular decides to give his classmates a break by becoming her sole source of energy.  It&#8217;s a tough job but someone&#8217;s gotta do it, right?</p>
<p>I like Lilim&#8217;s personality, the art is really clean and well-done, and they manage to make the story way more interesting than that description might lead you to expect.</p>
<p><br clear=all></p>
<p><img hspace=5 vspace=5 align=left src=/thumbnails/fancia.jpg><br clear=all></p>
<h3>Kitty Kitty Fancia</h3>
<p>My guilty pleasure&#8230; a sweet-enough-to-make-your-teeth-rot tale of a cute kitty girl, the human boy she adores, and all her cute little animal friends.  Did I mention it was cute?  I&#8217;m helpless before the power of cute.  </p>
<p>Ph34r the 7,000 gigaDonbos of industrial-strength cuteness. Diabetics need not apply.</p>
]]></content:encoded>
			<wfw:commentRss>http://rickadams.org/weblog/?feed=rss2&amp;p=8</wfw:commentRss>
		</item>
	</channel>
</rss>
