<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Barattalo</title>
	<atom:link href="http://www.barattalo.it/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barattalo.it</link>
	<description>code snippets, classes and other stuff for developers</description>
	<lastBuildDate>Mon, 01 Mar 2010 21:30:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP curl bot to update Facebook status</title>
		<link>http://www.barattalo.it/2010/03/01/php-curl-bot-to-update-facebook-status/</link>
		<comments>http://www.barattalo.it/2010/03/01/php-curl-bot-to-update-facebook-status/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:30:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Spiders & webbots]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Spider]]></category>
		<category><![CDATA[webbots]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=480</guid>
		<description><![CDATA[




I&#8217;ve found this great mini bot from Alste blog, and I&#8217;ve decided to add it to the mini bot class. This bot uses curl to connect to facebook mobile (m.facebook.com) and perform the login. Then it saves the cookies received from mobile facebook and go to the facebook mobile homepage where it sets the status [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2010/01/06/test-if-a-remote-url-exists-with-php-and-curl/' rel='bookmark' title='Permanent Link: Test if a remote url exists with PHP and CURL'>Test if a remote url exists with PHP and CURL</a></li>
<li><a href='http://www.barattalo.it/2010/03/01/php-to-get-twitter-infos-and-avatar/' rel='bookmark' title='Permanent Link: PHP to get twitter infos and avatar'>PHP to get twitter infos and avatar</a></li>
<li><a href='http://www.barattalo.it/2010/01/16/php-web-page-to-text-function/' rel='bookmark' title='Permanent Link: PHP Web page to text function'>PHP Web page to text function</a></li>
<li><a href='http://www.barattalo.it/2009/12/29/tiny-url-encode-and-decode-with-php/' rel='bookmark' title='Permanent Link: Tiny url encode and decode with PHP'>Tiny url encode and decode with PHP</a></li>
<li><a href='http://www.barattalo.it/2010/01/17/posting-to-facebook-from-website-with-facebook-connect/' rel='bookmark' title='Permanent Link: Posting to Facebook from website with Facebook Connect'>Posting to Facebook from website with Facebook Connect</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/03/01/php-curl-bot-to-update-facebook-status/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP to get twitter infos and avatar</title>
		<link>http://www.barattalo.it/2010/03/01/php-to-get-twitter-infos-and-avatar/</link>
		<comments>http://www.barattalo.it/2010/03/01/php-to-get-twitter-infos-and-avatar/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:23:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Spiders & webbots]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[Preg_match_all]]></category>
		<category><![CDATA[Spider]]></category>
		<category><![CDATA[spiders]]></category>
		<category><![CDATA[webbot]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=478</guid>
		<description><![CDATA[




I&#8217;ve just updated the Mini Bot Php Class with an improved version of the twitterInfo function, here is the code of the new function, I&#8217;ve added the avatar image url:

/* this function is part of the Mini Bot Class */

	//
	// get twitter infos from nickname
	// and get avatar url
	public function twitterInfo($nick) {
		$user_agent = &#34;Mozilla/4.0 (compatible; [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2010/01/12/bot-that-retrieves-url-meta-data-info/' rel='bookmark' title='Permanent Link: Bot that retrieves url meta data and other infos'>Bot that retrieves url meta data and other infos</a></li>
<li><a href='http://www.barattalo.it/2010/01/16/php-web-page-to-text-function/' rel='bookmark' title='Permanent Link: PHP Web page to text function'>PHP Web page to text function</a></li>
<li><a href='http://www.barattalo.it/2009/12/24/php-meteo-bot-for-google/' rel='bookmark' title='Permanent Link: PHP bot to grab meteo information from Google'>PHP bot to grab meteo information from Google</a></li>
<li><a href='http://www.barattalo.it/2010/03/01/php-curl-bot-to-update-facebook-status/' rel='bookmark' title='Permanent Link: PHP curl bot to update Facebook status'>PHP curl bot to update Facebook status</a></li>
<li><a href='http://www.barattalo.it/2009/12/29/tiny-url-encode-and-decode-with-php/' rel='bookmark' title='Permanent Link: Tiny url encode and decode with PHP'>Tiny url encode and decode with PHP</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/03/01/php-to-get-twitter-infos-and-avatar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ping pingomatic.com services with PHP</title>
		<link>http://www.barattalo.it/2010/02/24/ping-pingomatic-com-services-with-php/</link>
		<comments>http://www.barattalo.it/2010/02/24/ping-pingomatic-com-services-with-php/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 22:28:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Spiders & webbots]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[ping-o-matic]]></category>
		<category><![CDATA[pingomatic]]></category>
		<category><![CDATA[spiders]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml-rpc]]></category>
		<category><![CDATA[xmlrpc]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=473</guid>
		<description><![CDATA[Ping-o-matic is a service that calls (ping) server engines and popular services to notify them that you have new contents on your site. This will help you to get your pages indexed on that servers and so it should increase your traffic.
I don&#8217;t know if this system works, but it&#8217;s implemented also in any wordpress [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2010/02/15/mixing-bots-to-gain-new-services/' rel='bookmark' title='Permanent Link: Mixing bots to gain new services'>Mixing bots to gain new services</a></li>
<li><a href='http://www.barattalo.it/2009/12/27/validate-email-with-smtp/' rel='bookmark' title='Permanent Link: Validate email with smtp'>Validate email with smtp</a></li>
<li><a href='http://www.barattalo.it/2010/01/12/bot-that-retrieves-url-meta-data-info/' rel='bookmark' title='Permanent Link: Bot that retrieves url meta data and other infos'>Bot that retrieves url meta data and other infos</a></li>
<li><a href='http://www.barattalo.it/2010/01/06/test-if-a-remote-url-exists-with-php-and-curl/' rel='bookmark' title='Permanent Link: Test if a remote url exists with PHP and CURL'>Test if a remote url exists with PHP and CURL</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/24/ping-pingomatic-com-services-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading mp3 informations with php (id3 tags)</title>
		<link>http://www.barattalo.it/2010/02/22/reading-mp3-informations-with-php-id3-tags/</link>
		<comments>http://www.barattalo.it/2010/02/22/reading-mp3-informations-with-php-id3-tags/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 23:39:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[bin2hex]]></category>
		<category><![CDATA[hexdec]]></category>
		<category><![CDATA[id3]]></category>
		<category><![CDATA[id3 tag]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=469</guid>
		<description><![CDATA[Inside mp3 files there are often some usefull informations stored. Those data are called &#8220;id3 tags&#8221; and deal with Author name, Title and Album name.
There are also some other informations sometimes: such as the length of the track, or the track number of the album, and more&#8230;
Well, all of these infos are packed inside the [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2010/02/03/fix-html-tags-close-tags-repair-bad-quotes-and-more/' rel='bookmark' title='Permanent Link: Fix html tags, close tags, repair bad quotes and more'>Fix html tags, close tags, repair bad quotes and more</a></li>
<li><a href='http://www.barattalo.it/2009/12/21/php-session-class-with-crypted-cookies/' rel='bookmark' title='Permanent Link: PHP Session class with crypted cookies.'>PHP Session class with crypted cookies.</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/22/reading-mp3-informations-with-php-id3-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to capture enter key pressed in a form (JavaScript)</title>
		<link>http://www.barattalo.it/2010/02/16/how-to-capture-enter-key-pressed-in-a-form-javascript/</link>
		<comments>http://www.barattalo.it/2010/02/16/how-to-capture-enter-key-pressed-in-a-form-javascript/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 11:08:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Html]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[events handller]]></category>
		<category><![CDATA[keypress]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[login form]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=465</guid>
		<description><![CDATA[Suppose you have a login form and you want to send the form when user press enter on his keyboard and not only by clicking on the submit button.
This can be achieved capturing a specific event when the user is typing. We have to capture the keypress event and listen to trigger an action when [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2009/11/17/set-write-here-on-input/' rel='bookmark' title='Permanent Link: Set &#8220;write here&#8221; on input type text?'>Set &#8220;write here&#8221; on input type text?</a></li>
<li><a href='http://www.barattalo.it/2009/11/18/click-links-with-javascript/' rel='bookmark' title='Permanent Link: Click links with JavaScript'>Click links with JavaScript</a></li>
<li><a href='http://www.barattalo.it/2009/11/13/how-do-i-get-the-value-from-a-combo-in-javascript/' rel='bookmark' title='Permanent Link: How do I get the value from a combo in Javascript?'>How do I get the value from a combo in Javascript?</a></li>
<li><a href='http://www.barattalo.it/2009/11/10/onkeyup-fix-alphanumerical-chars/' rel='bookmark' title='Permanent Link: OnKeyUp Fix Alphanumerical Chars'>OnKeyUp Fix Alphanumerical Chars</a></li>
<li><a href='http://www.barattalo.it/2009/11/17/how-do-i-print-the-elements-of-an-object-in-javascript/' rel='bookmark' title='Permanent Link: How do I print the elements of an object in Javascript?'>How do I print the elements of an object in Javascript?</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/16/how-to-capture-enter-key-pressed-in-a-form-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mixing bots to gain new services</title>
		<link>http://www.barattalo.it/2010/02/15/mixing-bots-to-gain-new-services/</link>
		<comments>http://www.barattalo.it/2010/02/15/mixing-bots-to-gain-new-services/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 11:39:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Spiders & webbots]]></category>
		<category><![CDATA[bots]]></category>
		<category><![CDATA[geoip]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[meteo]]></category>
		<category><![CDATA[Mini Bots Class]]></category>
		<category><![CDATA[spiders]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=458</guid>
		<description><![CDATA[Spiders and bots let you take services from other web sites, this could be very cool, but also this could become a problem (you are using stuff made from other people, is it correct? they know what you&#8217;re doing, are there any bandwidth problems you can cause? are your bots ok with copyright?).
Well let&#8217;s go [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2009/12/24/php-meteo-bot-for-google/' rel='bookmark' title='Permanent Link: PHP bot to grab meteo information from Google'>PHP bot to grab meteo information from Google</a></li>
<li><a href='http://www.barattalo.it/2010/01/20/new-version-of-mini-bots-php-class-v-1-4/' rel='bookmark' title='Permanent Link: New version of Mini Bots PHP Class (v.1.4)'>New version of Mini Bots PHP Class (v.1.4)</a></li>
<li><a href='http://www.barattalo.it/2010/02/24/ping-pingomatic-com-services-with-php/' rel='bookmark' title='Permanent Link: Ping pingomatic.com services with PHP'>Ping pingomatic.com services with PHP</a></li>
<li><a href='http://www.barattalo.it/2010/01/12/bot-that-retrieves-url-meta-data-info/' rel='bookmark' title='Permanent Link: Bot that retrieves url meta data and other infos'>Bot that retrieves url meta data and other infos</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/15/mixing-bots-to-gain-new-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP function to fix collation on database fields of MySQL</title>
		<link>http://www.barattalo.it/2010/02/11/php-function-to-fix-collation-on-database-fields-of-mysql/</link>
		<comments>http://www.barattalo.it/2010/02/11/php-function-to-fix-collation-on-database-fields-of-mysql/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 09:50:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[char set]]></category>
		<category><![CDATA[charcter set]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[Utf8]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=455</guid>
		<description><![CDATA[This PHP function search for tables in the active db, match table&#8217;s name with the regular expression passed as first parameters and if it matches alter the table to convert charcter set and collation.
This can be usefull when you have a db that you&#8217;ve created fast, without thinking, and than you discover: &#8220;Ouch! I&#8217;ve setted [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2010/01/29/10-php-usefull-functions-for-mysqli-improved-stuff/' rel='bookmark' title='Permanent Link: 10 PHP usefull functions for MySQLi stuff (mysql improved)'>10 PHP usefull functions for MySQLi stuff (mysql improved)</a></li>
<li><a href='http://www.barattalo.it/2009/11/09/stop-utf8-problems-with-italian-characters/' rel='bookmark' title='Permanent Link: Stop UTF8 problems with special characters'>Stop UTF8 problems with special characters</a></li>
<li><a href='http://www.barattalo.it/2010/01/25/10-php-usefull-functions-for-mysql-stuff/' rel='bookmark' title='Permanent Link: 10 PHP usefull functions for MySQL stuff'>10 PHP usefull functions for MySQL stuff</a></li>
<li><a href='http://www.barattalo.it/2010/01/19/php-to-get-enum-set-values-from-mysql-field/' rel='bookmark' title='Permanent Link: PHP to get enum/set values from mysql field'>PHP to get enum/set values from mysql field</a></li>
<li><a href='http://www.barattalo.it/2010/01/21/mysql-add-counter-in-a-query/' rel='bookmark' title='Permanent Link: MYSQL add counter in a query'>MYSQL add counter in a query</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/11/php-function-to-fix-collation-on-database-fields-of-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP how to calculate age from date of birth</title>
		<link>http://www.barattalo.it/2010/02/10/php-how-to-calculate-age-from-date-of-birth/</link>
		<comments>http://www.barattalo.it/2010/02/10/php-how-to-calculate-age-from-date-of-birth/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:59:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[age]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[Date]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=452</guid>
		<description><![CDATA[This is a very simple script that starts from a string date in format yyyy-mm-dd and return the age.
To do this it splits the date, calculate years with difference from current year and the fix the value based on difference between months and days from current date:

// input $date string format: YYYY-MM-DD
function age($date){
	list($year,$month,$day) = explode(&#34;-&#34;,$date);
	$year_diff [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2009/11/11/php-day-add-function/' rel='bookmark' title='Permanent Link: PHP Day add function'>PHP Day add function</a></li>
<li><a href='http://www.barattalo.it/2009/12/24/php-meteo-bot-for-google/' rel='bookmark' title='Permanent Link: PHP bot to grab meteo information from Google'>PHP bot to grab meteo information from Google</a></li>
<li><a href='http://www.barattalo.it/2010/02/01/calculate-dir-size-recursively/' rel='bookmark' title='Permanent Link: Calculate dir size recursively with PHP (and count files)'>Calculate dir size recursively with PHP (and count files)</a></li>
<li><a href='http://www.barattalo.it/2009/11/24/truncate-string-preserving-some-words-in-php/' rel='bookmark' title='Permanent Link: Truncate string preserving some words in PHP'>Truncate string preserving some words in PHP</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/10/php-how-to-calculate-age-from-date-of-birth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP equivalent to PHP strip_tags</title>
		<link>http://www.barattalo.it/2010/02/09/asp-strip-tags-function-equivalent-to-php/</link>
		<comments>http://www.barattalo.it/2010/02/09/asp-strip-tags-function-equivalent-to-php/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 09:09:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Asp]]></category>
		<category><![CDATA[PHPvsASP]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[RegExp]]></category>
		<category><![CDATA[strip_tags]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=445</guid>
		<description><![CDATA[I&#8217;ve found those functions around in the internet and I put them here just to remind how to strip tags with ASP. In ASP there isn&#8217;t an equivalent of PHP strip_tags function, so, here there are two function that do this with regular expressions. The first function strips anything:

function strip_tags(strHTML)
	dim regEx
	Set regEx = New RegExp
	With [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2009/11/10/asp-equivalent-to-php-ereg_replace-function/' rel='bookmark' title='Permanent Link: ASP equivalent to PHP ereg_replace function'>ASP equivalent to PHP ereg_replace function</a></li>
<li><a href='http://www.barattalo.it/2009/11/10/asp-equivalent-to-php-ucfirst-function/' rel='bookmark' title='Permanent Link: ASP equivalent to PHP Ucfirst function'>ASP equivalent to PHP Ucfirst function</a></li>
<li><a href='http://www.barattalo.it/2010/01/16/php-web-page-to-text-function/' rel='bookmark' title='Permanent Link: PHP Web page to text function'>PHP Web page to text function</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/09/asp-strip-tags-function-equivalent-to-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP Function to count files in a folder</title>
		<link>http://www.barattalo.it/2010/02/09/asp-function-to-count-files-in-a-folder/</link>
		<comments>http://www.barattalo.it/2010/02/09/asp-function-to-count-files-in-a-folder/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 08:50:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Asp]]></category>
		<category><![CDATA[dir]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[filesystemobject]]></category>
		<category><![CDATA[getfolder]]></category>

		<guid isPermaLink="false">http://www.barattalo.it/?p=442</guid>
		<description><![CDATA[This ASP function counts files of a specified extension inside a folder: this is done by creating a file system object, open folder and scan files for matching the extension. The match of the extension is made without regular expression but using string functions: Right, Len and Ucase.

Function countFiles(path,ext)
	Dim fs, folder, c
	c = 0
	Set fs [...]


Related posts:<ol><li><a href='http://www.barattalo.it/2010/02/01/calculate-dir-size-recursively/' rel='bookmark' title='Permanent Link: Calculate dir size recursively with PHP (and count files)'>Calculate dir size recursively with PHP (and count files)</a></li>
<li><a href='http://www.barattalo.it/2009/11/10/asp-equivalent-to-php-ucfirst-function/' rel='bookmark' title='Permanent Link: ASP equivalent to PHP Ucfirst function'>ASP equivalent to PHP Ucfirst function</a></li>
<li><a href='http://www.barattalo.it/2010/02/02/recursive-remove-directory-rmdir-in-php/' rel='bookmark' title='Permanent Link: Recursive remove directory (RMDIR) in PHP'>Recursive remove directory (RMDIR) in PHP</a></li>
<li><a href='http://www.barattalo.it/2010/01/19/recursive-chmod-on-files-and-directory/' rel='bookmark' title='Permanent Link: Recursive chmod on files and directory'>Recursive chmod on files and directory</a></li>
</ol>]]></description>
		<wfw:commentRss>http://www.barattalo.it/2010/02/09/asp-function-to-count-files-in-a-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>