<?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>TecnoCaos</title>
	<atom:link href="http://www.tecnocaos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tecnocaos.com</link>
	<description></description>
	<lastBuildDate>Sun, 05 Sep 2010 15:18:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Un caos de interfaz de HP</title>
		<link>http://www.tecnocaos.com/un-caos-de-interfaz-de-hp/</link>
		<comments>http://www.tecnocaos.com/un-caos-de-interfaz-de-hp/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 15:18:52 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Periféricos]]></category>
		<category><![CDATA[configuración]]></category>
		<category><![CDATA[escala de grises]]></category>
		<category><![CDATA[Hewlett Packard]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[impresora]]></category>
		<category><![CDATA[interfaz]]></category>
		<category><![CDATA[mala interfaz]]></category>
		<category><![CDATA[Paint para Mac]]></category>
		<category><![CDATA[todo en uno]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=297</guid>
		<description><![CDATA[El trasto este de aquí arriba es un todo en uno de HP que compró mi padre hace unos años y que usamos en casa. No voy a hablaros de su hobby de hacer bolas de papel con los folios, ni de &#8230; <a href="http://www.tecnocaos.com/un-caos-de-interfaz-de-hp/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/HP_Photosmart_2710.jpg"><img class="aligncenter size-medium wp-image-280" title="HP_Photosmart_2710" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/HP_Photosmart_2710-300x208.jpg" alt="" width="300" height="208" /></a>El trasto este de aquí arriba es un todo en uno de HP que compró mi padre hace unos años y que usamos en casa. No voy a hablaros de su hobby de hacer bolas de papel con los folios, ni de su maravilloso sistema de tragárselos de 10 en 10, sino de la interfaz que Hewlett Packard ha implementado para Mac OS X.</p>
<p><span id="more-297"></span></p>
<p>Una de las funciones de este blog es tratar de que no se me olviden cosas que aprendo y que probablemente necesite en un futuro. Mi problema es que muy de vez en cuando (meses) la utilizo para imprimir los apuntes de la universidad, y es un derroche hacerlo en color, así que siempre que me toca busco la opción de escala de grises.</p>
<p>Esta que veis aquí es la pantalla inicial del menú de configuración (click encima para ampliar foto):</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.21.09.png"><img class="aligncenter size-medium wp-image-281" title="Captura de pantalla 2010-09-05 a las 16.21.09" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.21.09-300x280.png" alt="" width="300" height="280" /></a>La lista desplegable que pone &#8220;Copias y páginas&#8221; tiene acceso a los submenús, porque en HP decidieron que las pestañas &#8220;son de pijos&#8221;. El contenido de esa lista es este:</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.21.21.png"><img class="aligncenter size-medium wp-image-282" title="Captura de pantalla 2010-09-05 a las 16.21.21" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.21.21-300x280.png" alt="" width="300" height="280" /></a>Cualquiera con dos dedos de frente haría click en la opción de &#8220;Ajuste de color&#8221; para acceder al cambio de escala, pero si estuviera bien hecha no estaría escribiendo este post. El contenido de ese submenú es este:</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.21.58.png"><img class="aligncenter size-medium wp-image-283" title="Captura de pantalla 2010-09-05 a las 16.21.58" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.21.58-300x188.png" alt="" width="300" height="188" /></a>Como se puede ver sólo muestra &#8220;Del fabricante&#8221; y &#8220;ColorSync&#8221; (que podemos deducir que es &#8220;de otro&#8221;), pero no hay rastro de la mierda de escala de grises. El siguiente paso para mí siempre era volverme loco y mirar en todos los demás submenús, hasta dar con esto:</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.22.11.png"><img class="aligncenter size-medium wp-image-284" title="Captura de pantalla 2010-09-05 a las 16.22.11" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.22.11-300x188.png" alt="" width="300" height="188" /></a>¡&#8221;Tipo/calidad de papel&#8221; cuenta con un huevo de pascua en forma de menú desplegable de configuración de color!¡Son unos genios! querían sorprendernos y lo han conseguido! Dentro de este menú SI existe la llamada escala de grises:</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.22.44.png"><img class="aligncenter size-medium wp-image-285" title="Captura de pantalla 2010-09-05 a las 16.22.44" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.22.44-300x261.png" alt="" width="300" height="261" /></a>Y ya está, espero que la próxima vez no me haga perder el tiempo, y siento haber escrito sobre esto, pero si no lo hacía reventaba. Otro día os contaré como interpreta la impresora estos símbolos:</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.48.06.png"><img class="aligncenter size-medium wp-image-286" title="Captura de pantalla 2010-09-05 a las 16.48.06" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/Captura-de-pantalla-2010-09-05-a-las-16.48.06-300x202.png" alt="" width="300" height="202" /></a></p>
<p>Escribir un comentario si algún periférico os alegra la vida!</p>
<p>P.D.: he descubierto el <a href="http://sourceforge.net/projects/paintbrush/files/Paintbrush%202.x/Paintbrush%202.0.1/paintbrush-2.0.1.dmg/download">Paint</a> para Mac OS, echaba de menos un programa más tonto que el Photoshop para pintar sobre imágenes, y este es perfecto.</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/un-caos-de-interfaz-de-hp/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/un-caos-de-interfaz-de-hp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URLs bonitas modificando .htaccess</title>
		<link>http://www.tecnocaos.com/urls-bonitas-modificando-htaccess/</link>
		<comments>http://www.tecnocaos.com/urls-bonitas-modificando-htaccess/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 02:19:22 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Lenguaje]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[cambiar urls]]></category>
		<category><![CDATA[RewriteRule]]></category>
		<category><![CDATA[rewrite_module]]></category>
		<category><![CDATA[url bonita]]></category>
		<category><![CDATA[url fea]]></category>
		<category><![CDATA[url Twitter]]></category>
		<category><![CDATA[urls bonitas]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=275</guid>
		<description><![CDATA[Esta noche he estado buscando información sobre la manera de sustituir las URLs &#8220;feas&#8221;, llenas de parámetros o con los nombres de los ficheros, por otras del estilo &#8220;/funcion/usuario/contenido/&#8221;, como la que usa Twitter con sus usuarios. He visto que &#8230; <a href="http://www.tecnocaos.com/urls-bonitas-modificando-htaccess/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/url.jpg"><img class="aligncenter size-medium wp-image-276" title="url" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/url-300x197.jpg" alt="" width="300" height="197" /></a></p>
<p>Esta noche he estado buscando información sobre la manera de sustituir las URLs &#8220;feas&#8221;, llenas de parámetros o con los nombres de los ficheros, por otras del estilo &#8220;/funcion/usuario/contenido/&#8221;, como la que usa Twitter con sus <a href="http://twitter.com/tecno_caos">usuarios</a>. He visto que para mejorar el aspecto de las URLs se puede emplear el módulo de Apache <strong>rewrite_module</strong> y la modificación del fichero <strong>.htaccess</strong></p>
<p><strong><span id="more-275"></span></strong></p>
<p>Para empezar tenemos que crear, en caso de que no exista ya, este fichero en el mismo directorio donde se encuentre la página de inicio de nuestra página web (index.php o index.html o lo que sea).</p>
<p>Dentro del fichero tenemos que escribir en primer lugar la activación de la reescritura de URLs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    RewriteEngine on</pre></div></div>

<p>A continuación se pueden añadir condiciones. La función de estas es filtrar los casos en los que se van a emplear las reglas y siguen el esquema &#8220;RewriteCond VARIABLE VALOR&#8221;. Yo no he empleado funciones para mi .htaccess, pero algunos ejemplos comentados serían:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    RewriteCond  <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_USER_AGENT<span style="color: #7a0874; font-weight: bold;">&#125;</span>  ^Mozilla.<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">//</span>User-Agent de la peticion HTTP debe ser Mozilla, el usuario utiliza Firefox
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REMOTE_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span>  ^hostA.<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">//</span>El nombre de la maquina que hace las peticiones contiene la cadena hostA</pre></div></div>

<p>Existen muchas más variables a las que podemos acceder desde las condiciones, como son: HTTP_REFERER, HTTP_COOKIE, REMOTE_USER, REMOTE_PORT, etc.</p>
<p>Además es posible concatenar condiciones empleando [AND] o [OR] si se usa más de una.<br />
Ahora toca hablar de las reglas, que son las que llevan a cabo las modificaciones sobre las URL. Todas siguen el esquema &#8220;RewriteRule URL_TUNING URL_FEA&#8221;. El parámetro URL_TUNING acepta patrones (como los que se usaban en <a href="http://www.tecnocaos.com/editando-texto-en-bash-con-el-comando-sed/">seed</a>). Ahora como ejemplo voy a usar las reglas que he utilizado yo para probar el sistema:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    RewriteRule ^about about.php <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
    RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>_-<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>$ index.php?<span style="color: #007800;">usuario</span>=$<span style="color: #000000;">1</span></pre></div></div>

<p>En la primera de ellas la URL &#8220;http://dominio.com/about&#8221; es redirigida a la fea &#8220;http://dominio.com/about.php&#8221;. La L entre corchetes es un flag, las reglas pueden incluir uno o más separados por comas. En este caso la L significa &#8220;Last rule&#8221;, al aplicar esta regla deja de hacerlo con las siguientes, funciona como un <em>break</em> dentro de un <em>switch</em>.</p>
<p>La segunda regla incluye un patrón, que recorta la cadena que coincida con él y la guarda en $1, que después se le pasa al index.php como valor del nombre de usuario. El resultado nos permite que la url &#8220;http://dominio.com/Pepe&#8221; sustituya a &#8220;http://dominio.com/index.php?usuario=Pepe&#8221; (Twitter&#8217;s style).</p>
<p>Es posible del mismo modo definir un patrón que use más conjuntos entre paréntesis y recorte $1, $2, $3&#8230;</p>
<p>La página oficial del módulo, de donde he sacado la información, esta <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">aquí</a>.</p>
<p>Si os animáis a probarlo&#8230; comentario!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/urls-bonitas-modificando-htaccess/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/urls-bonitas-modificando-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conectarse a servidor por SSH sin tener que introducir el password</title>
		<link>http://www.tecnocaos.com/conectarse-a-servidor-por-ssh-sin-tener-que-introducir-el-password/</link>
		<comments>http://www.tecnocaos.com/conectarse-a-servidor-por-ssh-sin-tener-que-introducir-el-password/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 15:52:15 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[clave privada]]></category>
		<category><![CDATA[clave pública]]></category>
		<category><![CDATA[conexión con servidor]]></category>
		<category><![CDATA[conexión servidor sin password]]></category>
		<category><![CDATA[conexión servidor SSH]]></category>
		<category><![CDATA[conexión sin password]]></category>
		<category><![CDATA[criptosistema clave pública y privada]]></category>
		<category><![CDATA[RSA]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[ssh-kegen]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=264</guid>
		<description><![CDATA[Estos tres señores de la foto son Rivest, Shamir y Adleman, los resposables del sistema criptográfico de clave pública RSA (que toma sus iniciales). ¿Y que tiene esto que ver con el SSH? Pues que gracias a sus sistema podemos &#8230; <a href="http://www.tecnocaos.com/conectarse-a-servidor-por-ssh-sin-tener-que-introducir-el-password/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/RSA.jpeg"><img class="aligncenter size-full wp-image-265" title="RSA" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/RSA.jpeg" alt="Rivest, Shamir y Adleman" width="268" height="188" /></a></p>
<p>Estos tres señores de la foto son Rivest, Shamir y Adleman, los resposables del sistema criptográfico de clave pública RSA (que toma sus iniciales). ¿Y que tiene esto que ver con el SSH? Pues que gracias a sus sistema podemos generar un par de claves pública y privada para autenticarnos en un servidor sin necesidad de introducir el password.<br />
<span id="more-264"></span></p>
<p>Para ello, en primer lugar tenemos que tener instalado el SSH en nuestro ordenador. Si no lo tenemos, sólo hay que abrir una terminal y escribir:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span></pre></div></div>

<p>Después tendremos que ir a la carpeta oculta de SSH en nuestro home, con un:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh</pre></div></div>

<p>Una vez dentro de este directorio debemos generar un par de claves RSA, para lo que usaremos el comando ssh-keygen de la siguiente manera:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> rsa</pre></div></div>

<p>Con lo que obtendremos la salida:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    Generating public<span style="color: #000000; font-weight: bold;">/</span>private rsa key pair.
    Enter <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">which</span> to save the key <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>xaman<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
    Enter passphrase <span style="color: #7a0874; font-weight: bold;">&#40;</span>empty <span style="color: #000000; font-weight: bold;">for</span> no passphrase<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
    Enter same passphrase again:
    Your identification has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>xaman<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.
    Your public key has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>xaman<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub.
    The key fingerprint is:
    0e:<span style="color: #000000;">78</span>:<span style="color: #000000;">59</span>:5c:c8:<span style="color: #000000;">91</span>:<span style="color: #000000;">68</span>:<span style="color: #000000;">49</span>:<span style="color: #000000;">91</span>:<span style="color: #000000;">83</span>:<span style="color: #000000;">53</span>:0b:<span style="color: #000000;">58</span>:09:<span style="color: #000000;">27</span>:6d
    The key<span style="color: #ff0000;">'s randomart image is:
&nbsp;
    +--[ RSA 2048]----+
    |  o=+=+*.+.      |
    |    .oE.*o+.     |
    |       . o..o    |
    |          . o    |
    |       . + S     |
    |         . o     |
    |             .   |
    |                 |
    |                 |
    +-----------------+</span></pre></div></div>

<p>Como podéis ver da la opción de introducir una frase para cifrar la clave privada. Es recomendable para otros usos, ya que no es nada conveniente que te roben la clave privada, porque podrán usarla para entrar directamente al servidor, pero en este caso no la vamos a introducir ya que si lo hacemos, no será necesario introducir el password del servidor pero si el de la clave privada.<br />
Una vez que tengamos los ficheros id_rsa (clave privada) e id_rsa.pub (clave pública) deremos mover el segundo al servidor.<br />
Os recomiendo que para esto uséis el comando scp de la siguiente forma:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">scp</span> id_rsa.pub usuario<span style="color: #000000; font-weight: bold;">@</span>dominio:<span style="color: #000000; font-weight: bold;">/</span>ruta_del_directorio_de_destino</pre></div></div>

<p>Una vez que tengamos la clave pública en el servidor tenemos que añadirla al fichero authorized_keys que esta en el directorio .ssh de nuestra cuenta. Si no existiera lo creamos con un:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh</pre></div></div>

<p>Y copiamos dentro la clave. Exista o no el fichero authorized_keys, debemos incluir nuestra clave pública en el, con un:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">cat</span> id_rsa.pub <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> authorized_keys</pre></div></div>

<p>Después de esto ya no será necesario introducir el password de usuario en el servidor.<br />
Para hacer aún más sencilla la conexión podemos añadir al fichero .bashrc (en Linux) o .bash_profile (en Mac OS) del home el siguiente alias:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">servidor</span>=<span style="color: #ff0000;">'ssh usuario@servidor'</span>;</pre></div></div>

<p>De esta forma podemos conectarnos a un servidor con solo escribir su nombre en la terminal.</p>
<p>Si a alguien no le sale, ve algo mal o tiene un sistema mejor, que escriba un comentario!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/conectarse-a-servidor-por-ssh-sin-tener-que-introducir-el-password/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/conectarse-a-servidor-por-ssh-sin-tener-que-introducir-el-password/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Editando texto en BASH con el comando sed</title>
		<link>http://www.tecnocaos.com/editando-texto-en-bash-con-el-comando-sed/</link>
		<comments>http://www.tecnocaos.com/editando-texto-en-bash-con-el-comando-sed/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 03:18:24 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Lenguaje]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bases de datos]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[comando]]></category>
		<category><![CDATA[comando sed]]></category>
		<category><![CDATA[modificar cadenas]]></category>
		<category><![CDATA[modificar texto]]></category>
		<category><![CDATA[OVH]]></category>
		<category><![CDATA[patrones]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[script inserciones]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[sustituir en texto]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=256</guid>
		<description><![CDATA[Esta tarde he recibido un email de OVH diciendo que me quedaba una semana para que mi alojamiento compartido se terminara. Como a pesar de que me queje (porque un fin de semana sin server es apocalíptico), no me han &#8230; <a href="http://www.tecnocaos.com/editando-texto-en-bash-con-el-comando-sed/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/09/captura.png"><img class="aligncenter size-medium wp-image-257" title="captura" src="http://www.tecnocaos.com/wp-content/uploads/2010/09/captura-300x233.png" alt="El resultado de escribir man sed en la terminal de Linux" width="300" height="233" /></a></p>
<p>Esta tarde he recibido un email de OVH diciendo que me quedaba una semana para que mi alojamiento compartido se terminara. Como a pesar de que <a href="http://www.tecnocaos.com/problemas-con-ovh/">me queje</a> (porque un fin de semana sin server es apocalíptico), no me han dado muchos problemas este año, he decidido renovar con ellos, cambiando mi antiguo &#8220;plan90&#8243; (ahora ya no existe con ese nombre) por otro &#8220;profesional&#8221; que me venía mucho mejor (necesitaba una buena BD MySQL, bastante espacio y mucho tráfico mensual) y portando todo al nuevo servidor.<br />
<span id="more-256"></span></p>
<p>El caso es que la base de datos de nuestra aplicación &#8220;estrella&#8221; de Facebook es bastante inmanejable para un PHPMyAdmin, son 117 MB de backup. En una supertabla con millones de entradas teníamos un par de campos que no se usaban, y que ocupaban una burrada, no por su longitud sino por el número de instancias. Después de tratar unas cuantas veces de borrarlos por SSH, usando el comando &#8220;mysql&#8221;, y desde la interfaz web sin resultados me he puesto a buscar la mejor manera de modificar el script de backup.</p>
<p>Resulta que teníamos varios millones de inserciones del estilo <em>&#8220;INSERT INTO usuario VALUES (&#8217;121900349302&#8242;, 13, 44, 27);&#8221;</em>, donde los dos últimos número sobraban porque eran los valores de los campos que no quería usar más. El primero de los dos podía recibir un NULL, y el segundo valores negativos. Y aquí entra &#8220;<strong>sed</strong>&#8220;:</p>
<p>El comando sigue la estructura &#8220;sed [opciones] instrucciones [fichero]&#8220;. Si no se especifica un fichero lee de la entrada estándar (así que se le pueden pasar valores con un pipeline | ). Las instrucciones deben ir entre comillas simples, para que el comando no trate de explotar símbolos como * o $. Si son de sustitución deben empezar por <strong>s</strong> y seguir este formato: <strong>&#8216;s/VIEJA/NUEVA/&#8217;</strong><br />
Por ejemplo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Vivo en: C/ Fuencarral&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/C\//la calle/'</span></pre></div></div>

<p>Daría como resultado:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    Vivo en: la calle Fuencarral</pre></div></div>

<p>Como podéis ver he escapado la barra / con otra barra inversa delante \. VIEJA acepta patrones (otro día hablare de ellos), y el &#8220;juego de metacaracteres extendido&#8221; (para poder usar patrones con: *, ?, +, [ - ], {,}, etc) si usamos la opción <strong>-E</strong>, por ejemplo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Vivo en: C/ Fuencarral&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'s/[a-zA-Z]{5,10}/Gran Vía/g'</span></pre></div></div>

<p>Tiene por salida:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    Vivo en: C<span style="color: #000000; font-weight: bold;">/</span> Gran Vía</pre></div></div>

<p>En el ejemplo le he dicho que sustituya todas las cadenas formadas por letras mayúsculas o minúsculas de entre 5 y 10 caracteres por &#8220;Gran Vía&#8221;, por lo que ha sustituido &#8220;Fuencarral&#8221;. He añadido además una <strong>g</strong> después de la última barra, que significa que no se pare en la primera que encuentre, que sustituya hasta el final.</p>
<p>Es posible también aplicar varias instrucciones seguidas separadas por punto y coma, de esta forma:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/a/A; s/b/B'</span> fichero_a_modificar.txt</pre></div></div>

<p>o separándolas con la opción <strong>-e</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/a/A'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/b/B'</span> fichero_a_modificar.txt</pre></div></div>

<p>También es posible que decirle que coja las instrucciones de un fichero con la opción <strong>-f</strong> seguida del nombre:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-f</span> reglas.sed fichero_a_modificar.txt</pre></div></div>

<p>Y evitar que muestre el resultado por pantalla con <strong>-n</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sed</span>  <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'s/b/B'</span> fichero_a_modificar.txt</pre></div></div>

<p>Mi problema con las tablas se ha solucionado con:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'s/, (NULL|[0-9]+), -?[0-9]+\)/)/g'</span> backup.sql <span style="color: #000000; font-weight: bold;">&gt;</span> backup_limpio.sql</pre></div></div>

<p>Que sobre un fichero que contenga:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349302'</span>, <span style="color: #000000;">13</span>, NULL, -<span style="color: #000000;">27</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349303'</span>, <span style="color: #000000;">13</span>, <span style="color: #000000;">43</span>, <span style="color: #000000;">37</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349304'</span>, <span style="color: #000000;">13</span>, NULL, -<span style="color: #000000;">18</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349305'</span>, <span style="color: #000000;">13</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;</pre></div></div>

<p>Obtiene:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349302'</span>, <span style="color: #000000;">13</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349303'</span>, <span style="color: #000000;">13</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349304'</span>, <span style="color: #000000;">13</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    INSERT INTO usuario VALUES <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'121900349305'</span>, <span style="color: #000000;">13</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;</pre></div></div>

<p>¡Si alguien encuentra algo interesante sobre &#8220;sed&#8221; o patrones que lo comente!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/editando-texto-en-bash-con-el-comando-sed/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/editando-texto-en-bash-con-el-comando-sed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Usando la librería cURL para PHP</title>
		<link>http://www.tecnocaos.com/usando-la-libreria-curl-para-php/</link>
		<comments>http://www.tecnocaos.com/usando-la-libreria-curl-para-php/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 19:58:45 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Lenguaje]]></category>
		<category><![CDATA[Plugin WordPress]]></category>
		<category><![CDATA[Redes sociales]]></category>
		<category><![CDATA[actualizar estado Tuenti]]></category>
		<category><![CDATA[Compartir en Tuenti]]></category>
		<category><![CDATA[conexión Tuenti]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[cURL Tuenti]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[librería]]></category>
		<category><![CDATA[PHP cURL]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[script Tuenti]]></category>
		<category><![CDATA[Tuenti]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=192</guid>
		<description><![CDATA[Ayer no me apetecía nada de nada estudiar, y pensé que para aprender algo nuevo, y de paso mejorar un poco &#8220;Compartir en Tuenti&#8221; era buena idea echar un ojo a cURL. Se me ocurrió que podría ser útil que el &#8230; <a href="http://www.tecnocaos.com/usando-la-libreria-curl-para-php/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/curl-refined.jpg"><img class="aligncenter size-medium wp-image-193" title="curl-refined" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/curl-refined-300x111.jpg" alt="" width="300" height="111" /></a></p>
<p>Ayer no me apetecía nada de nada estudiar, y pensé que para aprender algo nuevo, y de paso mejorar un poco &#8220;<a href="http://www.tecnocaos.com/compartir-en-tuenti/">Compartir en Tuenti</a>&#8221; era buena idea echar un ojo a cURL. Se me ocurrió que podría ser útil que el plugin para WordPress pudiera actualizar nuestros estados con enlaces a las nuevas entradas del blog de forma automática. No era algo nuevo, ya que los plugins para Twitter, a pesar de que emplean un API, lo que hacen es eso, twittear con los cambios del blog (<a href="http://twitter.com/Tecno_Caos">@Tecno_Caos</a>).</p>
<p><span id="more-192"></span></p>
<p>A falta de API en Tuenti sólo queda intentar eso, emplear cURL, que es una librería preparada para conectar y comunicarse con muchos tipos de servidores y muchos tipos de protocolos. Actualmente libcurl soporta los protocolos http, https, ftp, gopher, telnet, dict, file y ldap. libcurl también soporta certificados HTTPS, HTTP, POST, HTTP PUT, subida de ficheros usando FTP (también se puede hacer con la extensión FTP de PHP), formularios HTTP, proxies, cookies, y autenticaciones usuario+contraseña (copy &#038; paste de <a href="http://es2.php.net/manual/es/book.curl.php">PHP.net</a>). El uso que yo quería darle era simple, con poder usar POST y GET me valía, así que ahora voy a explicar las funciones principales:</p>
<ul>
<li><a href="http://es2.php.net/manual/es/function.curl-init.php">curl_init()</a>, para iniciar la sesión cURL y obtener el manejador. Opcionalmente recibe una URL como parámetro. Se usa simplemente así:</li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$handler</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<li><a href="http://es2.php.net/manual/es/function.curl-setopt.php">curl_setopt()</a>, es la función que más he usado, se emplea para fijar valores a parámetros de configuración. La lista de parámetros es muy amplia. Un ejemplo de su uso sería:</li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Fijo la peticion POST a false, lo que activa la peticion GET</span></pre></div></div>

<li><a href="http://es2.php.net/manual/es/function.curl-exec.php">curl_exec()</a>, para ejecutar la petición con todos los parámetros de configuración que hemos fijado. Si ponemos la opción CURLOPT_RETURNTRANSFER a TRUE devuelve la salida de la ejecución en una variable en lugar de imprimirla, que es el comportamiento por defecto (funciona como un echo):</li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<li><a href="http://es2.php.net/manual/es/function.curl-close.php">curl_close()</a>, para cerrar la sesión cURL:</li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</ul>
<p>He tenido algunos problemas con las Cookies. Se supone que puede hacer que se guarden en un fichero configurando CURLOPT_COOKIEJAR y CURLOPT_COOKIEFILE, pero aunque he conseguido que las Cookies se guardaran correctamente, el Javascript de la página no hacía bien las modificaciones sobre el fichero, así que decidí hacerlas a mano modificando el valor de CURLOPT_COOKIE.</p>
<p>Como creo que lo mejor es que pegue aquí una clase que me he creado para iniciar sesión en Tuenti y hacer un par de cosas más, y que comente cada linea interesante&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> Tuenti<span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$handler</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$response</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$ruta_cookie</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$cookie</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$csfr</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> crearCookie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        ruta_cookie <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cookie.txt&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ruta_cookie</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;w&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//creo un fichero para almacenar las Cookies</span>
			<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">chmod</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ruta_cookie</span><span style="color: #339933;">,</span> <span style="color: #208080;">0777</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//le cambio los permisos por si acaso...</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIESESSION<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLINFO_HEADER_OUT<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIEJAR<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ruta_cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Fichero donde se guardan Cookies al cerrar conexion</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIEFILE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ruta_cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Fichero donde se almacenan las Cookies</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_FAILONERROR<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_AUTOREFERER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Cambio de HTTP Referer automatico</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Sigue automaticamente las URL que devuelve la cabecera HTTP</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_VERBOSE<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_USERAGENT<span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//Cambia el User-Agent, la informacion sobre el navegador usado por el cliente</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_HTTPHEADER<span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Accept-Language: es-ES,es;q=0.8&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Proxy-Connection: keep-alive&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Configuracion de la cabecera HTTP</span>
		        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Inicialmente configurado con GET</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Devuelve las cabeceras junto con la respuesta del servidor</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_CONNECTTIMEOUT<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Redirige la salida de curl_exec a una variable</span>
		<span style="color: #009900;">&#125;</span>	
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> iniciarSesionTuenti<span style="color: #009900;">&#40;</span><span style="color: #000088;">$login</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000088;">$url_base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.tuenti.com/?m=login&quot;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Primera carga de la pagina</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Por GET</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_base</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Fijo la URL de destino</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Ejecuto</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Mostrar el formulario de login</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;manual_logout=deleted; ue=deleted; em=deleted; fa=deleted; et=deleted; domain=.tuenti.com; expires=Sun, 30-Aug-2020 12:11:30 GMT; path=/;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Modifico la Cookie con los valores devueltos en la HTTP Header de los Set-Cookie, lo que el server receptor quiere que anadamos a la cookie</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_base</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Fijo la URL</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
			<span style="color: #666666; font-style: italic;">//Iniciar sesion</span>
			<span style="color: #000088;">$url_login</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://www.tuenti.com/?m=Login&amp;func=do_login&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Lo preparo para un POST</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;email=<span style="color: #006699; font-weight: bold;">$login</span>&amp;remember=1&amp;timezone=2&amp;input_password=<span style="color: #006699; font-weight: bold;">$pass</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Cadena con las variables enviadas por POST y sus valores. Tambien puede recibir un array asociativo (clave - valor)</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ourl=deleted; manual_logout=deleted; ue=deleted; em=deleted; fa=deleted; et=deleted; domain=.tuenti.com; expires=Sun, 30-Aug-2020 12:11:30 GMT; path=/;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Modifico la Cookie de nuevo</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Que no compruebe nada del SSL</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYHOST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Pasando de SSL</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_login</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Fijo URL</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$resultados</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/sid=([a-zA-Z0-9]*);/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resultados</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Obtengo el valor de la sesion  (sid) de usuario del Set-Cookie que aparece en la cabecera HTTP de la respuesta, para anadirlo a la Cookie</span>
			<span style="color: #000088;">$sid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$resultados</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Entrar en el perfil&quot;;</span>
			<span style="color: #000088;">$url_hash</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://www.tuenti.com/&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sid=<span style="color: #006699; font-weight: bold;">$sid</span>; lang=es_ES; ourl=deleted; manual_logout=deleted; ue=deleted; em=deleted; fa=deleted; et=deleted; domain=.tuenti.com; expires=Sun, 30-Aug-2020 12:11:30 GMT; path=/;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYHOST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_hash</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Tener hash;</span>
			<span style="color: #000088;">$url_hash</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://www.tuenti.com/&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;redirect_url=m=home&amp;func=view_home; tempHash=m=home&amp;func=view_home;  max-age=30; sid=<span style="color: #006699; font-weight: bold;">$sid</span>; lang=es_ES; ourl=deleted; manual_logout=deleted; ue=deleted; em=deleted; fa=deleted; et=deleted; domain=.tuenti.com; expires=Sun, 30-Aug-2020 12:11:30 GMT; path=/;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYHOST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_hash</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$resultados</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/user_id=([0-9]*)&quot;/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resultados</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Ahora busco el user_id en el HTML de la respuesta, para mandarlo con otro formulario</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$resultados</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> compartirEnlace<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url_post</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mensaje</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$url_base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.tuenti.com/?m=Share&amp;func=index&amp;url=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url_post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Uso urlencode para codificar los parametros de la URL</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Primera carga de la pagina</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_base</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot; redirect_url=deleted; lp=1;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$resultados</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/CSFR: \'([a-zA-Z0-9]*)\'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #339933;">,</span> <span style="color: #000088;">$resultados</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Busco el CSFR en el codigo HTML de la respuesta</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">csfr</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$resultados</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Envio de nuevo estado</span>
			<span style="color: #000088;">$url_envio</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://wwwb21.tuenti.com/?m=Share&amp;func=process_share_status&amp;ajax=1&amp;store=0&amp;ajax_target=canvas&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;url=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url_post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;csfr=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">csfr</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;status_body=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mensaje</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;〈=es_ES&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Respondo incluyendo el CSFR</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYHOST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_envio</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> cerrarSesion<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//Cerrar sesion</span>
			<span style="color: #000088;">$url_envio</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://wwwb21.tuenti.com/?m=Logout&amp;func=log_out&amp;ajax=1&amp;store=0&amp;ajax_target=canvas&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;user_id=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;csfr=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">csfr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Uso el user_id y el csfr para cerrar sesion por POST</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_COOKIE<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYHOST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url_envio</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> salir<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ruta_cookie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Destruyo el fichero de Cookies</span>
			<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Cierro la sesion de cURL</span>
			<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Libero de memoria la respuesta</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Con todo esto ya puedo hacer que mi plugin cambie mi estado por mi con las URLs a mis entradas nuevas, cosa que espero que haga con esta&#8230; Creo que esta noche lanzaré la versión que incluye los cambios.</p>
<p>Me han servido de ayuda PHP.net y dos tutoriales que encontre, <a href="http://web.ontuts.com/tutoriales/aprendiendo-a-utilizar-la-libreria-curl-en-php/">este</a> (con una clase de regalo muy práctica) y <a href="http://www.juanfelipe.net/node/26">este otro</a> (con un interesante caso práctico).</p>
<p>Si usáis cURL para algo y tenéis dudas (o me echáis con algo que no haya dicho/usado bien) comentario&#8230;</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/usando-la-libreria-curl-para-php/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/usando-la-libreria-curl-para-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ADW.Launcher para Android</title>
		<link>http://www.tecnocaos.com/adw-launcher-para-android/</link>
		<comments>http://www.tecnocaos.com/adw-launcher-para-android/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 13:30:15 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Aplicación]]></category>
		<category><![CDATA[ADW Launcher]]></category>
		<category><![CDATA[ADW.Lawncher]]></category>
		<category><![CDATA[aplicaciones]]></category>
		<category><![CDATA[Exposé]]></category>
		<category><![CDATA[gratis]]></category>
		<category><![CDATA[HTC Sense]]></category>
		<category><![CDATA[Launcher]]></category>
		<category><![CDATA[Market]]></category>
		<category><![CDATA[Motoblur]]></category>
		<category><![CDATA[Sense]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=170</guid>
		<description><![CDATA[El launcher de Android es el programa que se arranca siempre con el móvil y que muestra los escritorios, el menu de aplicaciones en ejecución (el que aparece al dejar apretada la casa) y la lista completa de aplicaciones (la &#8230; <a href="http://www.tecnocaos.com/adw-launcher-para-android/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/12.jpg"><img class="aligncenter size-medium wp-image-172" title="1" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/12-180x300.jpg" alt="" width="180" height="300" /></a></p>
<p>El launcher de Android es el programa que se arranca siempre con el móvil y que muestra los escritorios, el menu de aplicaciones en ejecución (el que aparece al dejar apretada la casa) y la lista completa de aplicaciones (la llaman drawer). Igual que HTC o Motorola han sacado launchers propios (el <a href="http://www.youtube.com/watch?v=meBGJ_2f8RU">Sense</a> y <a href="http://www.motorola.com/Consumers/ES-ES/Consumer-Products-and-Services/MOTOBLUR/Meet-MOTOBLUR">Motoblur</a> respectivamente) para sus terminales, hay desarrolladores que han lanzado en el Market launchers alternativos al de Google.</p>
<p><span id="more-170"></span>De todos los que he probado (y han pasado ya 4 ó 5 por mi Nexus One) me quedo con el <a href="http://jbthemes.com/anderweb/">ADW.Launcher</a>, y ahora voy a contaros porqué:</p>
<ul>
<li>Cuenta con el mismo sistema de mostrar todos los escritorios &#8220;pellizcando&#8221; la pantalla que el HTC Sense (o que Mac OS X, ya que es una copia descarada de Exposé)<a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/2.jpg"><img class="aligncenter size-medium wp-image-173" title="2" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/2-180x300.jpg" alt="Mostrar escritorios de Android con ADW.Launcher" width="180" height="300" /></a></li>
<li>Permite mostrar/ocultar la barra de notificaciones moviendo el dedo hacia arriba en la pantalla. Cuando la ocultas queda mejor el escritorio, y es casi innecesaria teniendo un trackball que se ilumina de diferentes colores según el tipo de notificación (para esto uso <a href="http://www.htcmania.com/showthread.php?t=118455">Trackball Alert Pro</a>). También puedes fijar el número de filas del escritorio, y el original a 4 desaprovecha el espacio.<a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/3.jpg"><img class="aligncenter size-medium wp-image-174" title="3" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/3-180x300.jpg" alt="Escritorio sin barra de notificaciones en Android" width="180" height="300" /></a></li>
<li>Permite utilizar el escritorio en horizontal al girar el móvil, algo útil que en la versión oficial 2.2 de Android no se puede y que la mayoría de aplicaciones lo hacen, por lo que queda un poco raro tener que estar girando el móvil cada vez que quieres ver el escritorio.<a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/4.jpg"><img class="aligncenter size-medium wp-image-175" title="4" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/4-180x300.jpg" alt="" width="180" height="300" /></a></li>
<li>Permite elegir el número de filas y columnas del drawer, y ocultar los nombres de todos los iconos (no son necesarios si te conoces todo lo que tienes instalado, sólo ocupan sitio). Además muestran el fondo de escritorio detrás, lo que queda bastante bien.<a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/5.jpg"><img class="aligncenter size-medium wp-image-176" title="5" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/5-180x300.jpg" alt="drawer de Android con ADW.Launcher" width="180" height="300" /></a></li>
<li>Incluye un nuevo gestor de escritorios, para poder ordenar escritorios enteros, y además te permite seleccionar el número de estos que quieras.<a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/6.jpg"><img class="aligncenter size-medium wp-image-177" title="6" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/6-180x300.jpg" alt="gestor de escritorios de ADW.Launcher" width="180" height="300" /></a></li>
<li>Permite configurar el drawer para que sea como el del iPhone o el Samsung Galaxy X, en horizontal.<a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/7.jpg"><img class="aligncenter size-medium wp-image-178" title="7" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/7-180x300.jpg" alt="drawer horizontal con ADW.Launcher" width="180" height="300" /></a></li>
<li>Incluye muchas otras opciones, como modificar todas las animaciones, seleccionar los accesos directos de la barra de abajo del escritorio, hacer backups de las configuraciones, aplicar temas (yo uso uno de Motorola Droid X), usar widgets con listas que se puedan deslizar con el dedo, etc.</li>
</ul>
<p>Es una aplicación <strong>GRATUITA</strong> así que os recomiendo a todos que la probéis, mejora bastante el aspecto del Launcher original. Si os gusta podéis probar el Launcher Pro, también gratis. ¡Ya me contaréis que os parece!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/adw-launcher-para-android/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/adw-launcher-para-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nuevo sistema de estadísticas de desarrollador en Facebook</title>
		<link>http://www.tecnocaos.com/nuevo-sistema-de-estadisticas-de-desarrollador-en-facebook/</link>
		<comments>http://www.tecnocaos.com/nuevo-sistema-de-estadisticas-de-desarrollador-en-facebook/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 13:39:44 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Estadísticas]]></category>
		<category><![CDATA[Redes sociales]]></category>
		<category><![CDATA[Analytics]]></category>
		<category><![CDATA[base de datos]]></category>
		<category><![CDATA[estadísticas Facebook]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[PHPMyAdmin]]></category>
		<category><![CDATA[usuarios]]></category>
		<category><![CDATA[visitas]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=158</guid>
		<description><![CDATA[Ya era hora, la verdad es antes las estadísticas dejaban mucho que desear, tardaban muchísimo en actualizar (mostraban menos de un millon de usuarios cuando en la base de datos teníamos más de millón y medio), mostraban valores absurdos (miles &#8230; <a href="http://www.tecnocaos.com/nuevo-sistema-de-estadisticas-de-desarrollador-en-facebook/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-14.29.26.png"><img class="aligncenter size-medium wp-image-159" title="Captura de pantalla 2010-08-27 a las 14.29.26" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-14.29.26-300x120.png" alt="" width="300" height="120" /></a></p>
<p>Ya era hora, la verdad es antes las estadísticas dejaban mucho que desear, tardaban muchísimo en actualizar (mostraban menos de un millon de usuarios cuando en la base de datos teníamos más de millón y medio), mostraban valores absurdos (miles de usuarios activos en aplicaciones recién &#8221;estrenadas&#8221; o que aún no eran públicas), o simplemente faltaban datos interesantes.</p>
<p><span id="more-158"></span></p>
<div id="attachment_160" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Facebook-Stats-2.png"><img class="size-medium wp-image-160" title="Facebook Stats 2" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Facebook-Stats-2-300x220.png" alt="Antiguo sistema de visistas" width="300" height="220" /></a><p class="wp-caption-text">Antiguo sistema de estadísticas</p></div>
<p>Todo esto parece estar resuelto, si bien se siguen volviendo &#8220;un poco locas&#8221;, ahora un desarrollador tiene muchísima información sobre el número de veces que los usuarios comparten enlaces, comentan, publican fotos, etc.</p>
<div id="attachment_161" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-14.30.20.png"><img class="size-medium wp-image-161  " title="Captura de pantalla 2010-08-27 a las 14.30.20" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-14.30.20-300x178.png" alt="Nuevo sistema de estadísticas de Facebook" width="300" height="178" /></a><p class="wp-caption-text">Nuevo sistema de estadísticas de Facebook (el escalón es el resultado de 2 días de bloqueo de servidor por parte de OVH)</p></div>
<p>Ahora mismo tenemos una subida del número de usuarios en <strong>Google Analytics</strong> y una bajada en Facebook que no me termino de creer, porque llevaba días subiendo, como tampoco me termino de creer que las fotos compartidas de los últimos dos días tiendan a cero (aparece en la imagen que esta encima del parrafo), pero al menos la precisión a aumentado.</p>
<div id="attachment_162" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-15.14.24.png"><img class="size-medium wp-image-162" title="Captura de pantalla 2010-08-27 a las 15.14.24" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-15.14.24-300x131.png" alt="Ejemplo de estadísticas de Analytics" width="300" height="131" /></a><p class="wp-caption-text">Datos recogidos por Google Analytics</p></div>
<p>Además, este aumento de precisión se nota mucho si lo comparas con el número de entradas de nuestra base de datos. Si antes se confundía en varios cientos de miles en el número de usuarios, ahora lo hace en menos de 60 mil.</p>
<div id="attachment_163" class="wp-caption aligncenter" style="width: 179px"><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-15.20.32.png"><img class="size-full wp-image-163" title="Captura de pantalla 2010-08-27 a las 15.20.32" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-15.20.32.png" alt="Estado actual de la BD" width="169" height="40" /></a><p class="wp-caption-text">Estado actual de la base de datos por PHPMyAdmin</p></div>
<p>Ahora sólo queda que le cambien el nombre al enlace para acceder a ellas, que pone &#8220;Ideas&#8221; xD</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/nuevo-sistema-de-estadisticas-de-desarrollador-en-facebook/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/nuevo-sistema-de-estadisticas-de-desarrollador-en-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consultas seguras a base de datos MySQL con PHP</title>
		<link>http://www.tecnocaos.com/consultas-a-base-de-datos-mysql-seguras-con-php/</link>
		<comments>http://www.tecnocaos.com/consultas-a-base-de-datos-mysql-seguras-con-php/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 01:48:48 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[addcslashes]]></category>
		<category><![CDATA[ataques]]></category>
		<category><![CDATA[bases de datos]]></category>
		<category><![CDATA[BBDD]]></category>
		<category><![CDATA[BD]]></category>
		<category><![CDATA[consultas]]></category>
		<category><![CDATA[consultas seguras]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[inyección]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql_real_escape_string]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sprintf]]></category>
		<category><![CDATA[SQL injection]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=136</guid>
		<description><![CDATA[Hace tiempo estuve buscando con unos amigos la mejor manera de realizar consultas a una base de datos MySQL desde PHP sin sufrir demasiado con el SQL Injection. Encontré varias técnicas recomendadas: Crear las consultas empleando la función sprintf para &#8230; <a href="http://www.tecnocaos.com/consultas-a-base-de-datos-mysql-seguras-con-php/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-02.52.53.png"><img class="aligncenter size-medium wp-image-137" title="Captura de pantalla 2010-08-27 a las 02.52.53" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-27-a-las-02.52.53-300x124.png" alt="" width="300" height="124" /></a></p>
<p>Hace tiempo estuve buscando con unos amigos la mejor manera de realizar consultas a una base de datos MySQL desde PHP sin sufrir demasiado con el <a href="http://es.wikipedia.org/wiki/Inyecci%C3%B3n_SQL">SQL Injection</a>. Encontré varias técnicas recomendadas:</p>
<p><span id="more-136"></span></p>
<ul>
<li>Crear las consultas empleando la función <a href="http://es.php.net/manual/es/function.sprintf.php">sprintf</a> para convertir los parámetros a String. Un ejemplo de uso de esta función sería:

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT id, name FROM products ORDER BY name LIMIT 20 OFFSET <span style="color: #009933; font-weight: bold;">%d</span>;&quot;</span> <span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li><span style="color: #008000;"><span style="color: #000000;">Usar <a href="http://es.php.net/manual/es/function.mysql-real-escape-string.php">mysql_real_escape_string</a> para escapar caracteres  &#8221;raros&#8221; que no deban aparecer en una consulta. Un ejemplo de su uso sería: </span></span>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select * from usuarios where name = '&quot;</span><span style="color: #339933;">.</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' and pass = '&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pass'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' LIMIT 1&quot;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li><span style="color: #008000;"><span style="color: #000000;">Si usamos en nuestras consultas LIKE, GRANT o REVOKE en conveniente usar la función <a href="http://es.php.net/manual/es/function.addcslashes.php">addcslashes</a>, para colocar barras invertidas delante de algunos caracteres y escaparlos. Se usa así:

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">addcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$autor_nombre</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'%_'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></span></span></li>
</ul>
<p>El resultado de combinar estas tres técnicas sería una consulta como esta:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM libros WHERE autor='<span style="color: #009933; font-weight: bold;">%s</span>';&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">addcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$autor_nombre</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'%_'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="font-style: normal;">Nosotros acabamos juntando esto en una función así  (sacada de <a href="http://es.php.net/">PHP.net</a>):</span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> secure_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">,</span><span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$params</span> <span style="color: #b1b100;">as</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$v</span> <span style="color: #339933;">=</span> <span style="color: #990000;">addcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'%_'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$sql_query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">vsprintf</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;?&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;'<span style="color: #009933; font-weight: bold;">%s</span>'&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$sql_query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql_query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$sql_query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql_query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Para usarla hay que pasarle por parámetros una cadena con la consulta en la que se use ? en el lugar que deberían ocupar las variables y un array con los valores de estas ordenados por orden de aparición, por ejemplo&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">secure_query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM persona WHERE nombre = ? AND apellidos = ?;&quot;</span><span style="color: #339933;">,</span>  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nombre</span><span style="color: #339933;">,</span> <span style="color: #000088;">$apellidos</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Espero que le sirva a alguien, y si encontráis algún problema o algo mejor dejar un comentario!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/consultas-a-base-de-datos-mysql-seguras-con-php/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/consultas-a-base-de-datos-mysql-seguras-con-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Actualización 1.1 de &#8220;Compartir en Tuenti&#8221;</title>
		<link>http://www.tecnocaos.com/actualizacion-1-1-de-compartir-en-tuenti/</link>
		<comments>http://www.tecnocaos.com/actualizacion-1-1-de-compartir-en-tuenti/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 02:57:24 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Plugin WordPress]]></category>
		<category><![CDATA[Redes sociales]]></category>
		<category><![CDATA[botón compartir]]></category>
		<category><![CDATA[plugin botón Tuenti]]></category>
		<category><![CDATA[plugin Tuenti]]></category>
		<category><![CDATA[plugin Wordpress]]></category>
		<category><![CDATA[plugin Wordpress Tuenti]]></category>
		<category><![CDATA[red social]]></category>
		<category><![CDATA[Tuenti]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=108</guid>
		<description><![CDATA[La primera versión de este plugin nació en una hora, el tiempo que tardé en entender lo que había hecho el creador de &#8220;Add to Facebook&#8221; y reescribirlo para que mostrara el botón de Tuenti. Después de mirarme lo que &#8230; <a href="http://www.tecnocaos.com/actualizacion-1-1-de-compartir-en-tuenti/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-21-a-las-04.20.04.png"><img class="aligncenter size-medium wp-image-109" title="Captura de pantalla 2010-08-21 a las 04.20.04" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-21-a-las-04.20.04-300x250.png" alt="" width="300" height="250" /></a></p>
<p>La primera versión de este plugin nació en una hora, el tiempo que tardé en entender lo que había hecho el creador de &#8220;Add to Facebook&#8221; y reescribirlo para que mostrara el botón de Tuenti. Después de mirarme lo que había publicado con más calma he decidido reescribirlo prácticamente del todo y abandonando el plugin que tome como ejemplo, para resolver algunas chapuzas y responder a <a href="http://www.nukeador.com/">Nukeador</a>, que escribió un comentario con una buena crítica.</p>
<p><span id="more-108"></span></p>
<p>He añadido unas cuantas cosas nuevas (que podéis ver haciendo click en la imagen):</p>
<ul>
<li>Colocación del botón sobre y bajo el texto</li>
<li>Selección de lugares del botón: portada, entradas y/o páginas</li>
<li>Acción al clickar el botón: abrir enlace en página nueva o en la misma</li>
<li>Edición del CSS del div del botón desde el menú de configuración.</li>
</ul>
<p>Espero que avise pronto de la <a href="http://wordpress.org/extend/plugins/compartir-en-tuenti/">actualización</a>, y nada más, que estoy esperando comentarios sobre sugerencias/errores.</p>
<p>Y si cae alguna que otra estrella mejor!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/actualizacion-1-1-de-compartir-en-tuenti/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/actualizacion-1-1-de-compartir-en-tuenti/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>El plugin &#8220;Compartir en Tuenti&#8221; y los repositorios de WordPress</title>
		<link>http://www.tecnocaos.com/el-plugin-compartir-en-tuenti-y-los-repositorios-de-wordpress/</link>
		<comments>http://www.tecnocaos.com/el-plugin-compartir-en-tuenti-y-los-repositorios-de-wordpress/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 14:37:19 +0000</pubDate>
		<dc:creator>Martín Chamarro</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Plugin WordPress]]></category>
		<category><![CDATA[Redes sociales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[botón compartir]]></category>
		<category><![CDATA[botón Tuenti]]></category>
		<category><![CDATA[plugin botón Tuenti]]></category>
		<category><![CDATA[plugin Tuenti]]></category>
		<category><![CDATA[plugin Wordpress]]></category>
		<category><![CDATA[plugin Wordpress Tuenti]]></category>
		<category><![CDATA[repositorio]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[validación]]></category>

		<guid isPermaLink="false">http://www.tecnocaos.com/?p=95</guid>
		<description><![CDATA[El otro día cuando me enteré de que Tuenti tenía un nuevo sistema para compartir enlaces, me puse, y acabe haciendo un plugin muy sencillito (sin tener ni idea del API, echando ojo al código de otro) para poder integrarlo en &#8230; <a href="http://www.tecnocaos.com/el-plugin-compartir-en-tuenti-y-los-repositorios-de-wordpress/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-20-a-las-16.10.59.png"><img class="aligncenter size-medium wp-image-98" title="Captura de pantalla 2010-08-20 a las 16.10.59" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-20-a-las-16.10.59-300x170.png" alt="" width="300" height="170" /></a>El otro día cuando me enteré de que Tuenti tenía un nuevo sistema para compartir enlaces, me puse, y <a href="http://www.tecnocaos.com/boton-de-compartir-en-tuenti-para-wordpress/">acabe haciendo un plugin muy sencillito</a> (sin tener ni idea del API, echando ojo al código de otro) para poder integrarlo en los blog con WordPress. Hoy os cuento como se hace público un plugin y como encontrar el mio.</p>
<p><span id="more-95"></span></p>
<p>Después tuve que seguir unos pasos para que lo añadieran a los repositorios:</p>
<p><span style="font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px; font-size: 16px;"> </span></p>
<ol>
<li><a href="http://wordpress.org/support/register.php">Registrarme</a> en WordPress.org</li>
<li><a href="http://wordpress.org/extend/plugins/about/validator/">Comprobar</a> que mi fichero readme.txt cumplía con el <a href="http://wordpress.org/extend/plugins/about/readme.txt">standard</a></li>
<li>Mandar información sobre mi plugin y un enlace a mi código a través de <a href="http://wordpress.org/extend/plugins/add/">este</a> cuestionario, y esperar a que el Plugin Master lo revise y de el visto bueno (la versión light del proceso de Apple para añadir aplicaciones al App Store)</li>
<li>Esperar a un email, con la información para añadir el plugin al repositorio de SVN (<a href="http://subversion.tigris.org/">Subversion</a>)</li>
<li>Crear la <a href="http://wordpress.org/extend/plugins/about/svn/">copia local del repositorio y hacer un commit</a> con los ficheros de plugin:</li>
</ol>
<ul>
<li>
<ul>
<li><em>mkdir   copia-repositorio-local</em></li>
<li><em>svn  co  http://svn.wp-plugins.org/mi-plugin    copia-repositorio-local/</em></li>
<li><em>cd    copia-repositorio-local/</em></li>
<li><em>cp    ../mi-plugin/*   trunk/</em></li>
<li><em>svn    add  trunk/*</em></li>
<li><em>svn   ci   -m   &#8216;Primera version de mi plugin&#8217;</em></li>
</ul>
</li>
</ul>
<p>Después de eso sólo nos queda esperar a que aparezca en el buscador de plugins del blog. De momento no he conseguido que lo encuentre buscando &#8220;Compartir en Tuenti&#8221;, pero aparece si buscas la etiqueta tuenti (como en la primera foto) o yendo directamente a la <a href="http://wordpress.org/extend/plugins/compartir-en-tuenti/">web</a>.</p>
<p>Para cerrar, una captura de coña de un texto que muestran los de WordPress cuando validas el readme.txt:</p>
<p><a href="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-19-a-las-18.02.26.png"><img class="aligncenter size-medium wp-image-99" title="Captura de pantalla 2010-08-19 a las 18.02.26" src="http://www.tecnocaos.com/wp-content/uploads/2010/08/Captura-de-pantalla-2010-08-19-a-las-18.02.26-300x31.png" alt="" width="300" height="31" /></a></p>
<p>Un saludo!</p>
<div align="left" style="float:left; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;"><a name="fb_share" type="button_count" share_url="http://www.tecnocaos.com/el-plugin-compartir-en-tuenti-y-los-repositorios-de-wordpress/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.tecnocaos.com/el-plugin-compartir-en-tuenti-y-los-repositorios-de-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
