<?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>Isern Palaus &#187; General</title>
	<atom:link href="http://blog.ipalaus.es/category/general/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.ipalaus.es</link>
	<description>PHP, CodeIgniter y jQuery</description>
	<lastBuildDate>Sat, 10 Apr 2010 13:10:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CodeIgniter: Goo.gl helper</title>
		<link>http://blog.ipalaus.es/codeigniter-goo-gl-helper</link>
		<comments>http://blog.ipalaus.es/codeigniter-goo-gl-helper#comments</comments>
		<pubDate>Sat, 10 Apr 2010 13:10:51 +0000</pubDate>
		<dc:creator>Isern Palaus</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.ipalaus.es/?p=67</guid>
		<description><![CDATA[Estoy planeando en publicar mi sistema de tienda virtual que he programado en CodeIgniter como open-source&#8230; de modo que quiero familiarizarme con las herramientas publicas tipo Git/bitbucket. He decidido crear un perfil y probar con un simple repositorio: codeigniter-googl-helper (con la convención de nombres propuesta por jamierumbelow).
El uso es muy sencillo: necesitas cargar el helper <a href="http://blog.ipalaus.es/codeigniter-goo-gl-helper" class="more-link">Más &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Estoy planeando en publicar mi sistema de tienda virtual que he programado en CodeIgniter como open-source&#8230; de modo que quiero familiarizarme con las herramientas publicas tipo Git/bitbucket. He decidido crear un perfil y probar con un simple repositorio: <a href="http://bitbucket.org/ipalaus/codeigniter-googl-helper/">codeigniter-googl-helper</a> (con la <a href="http://jamieonsoftware.com/blog/entry/codeigniter-repo-naming-conventions">convención de nombres propuesta por jamierumbelow</a>).</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_about(1)" title="Show plugin information"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
<span style="color: #009933; font-style: italic;">/**<br />
&nbsp;* A helper to create easy Goo.gl short urls<br />
&nbsp;*<br />
&nbsp;* @package &nbsp; &nbsp; CodeIgniter<br />
&nbsp;* @subpackage &nbsp;Googl_Helper<br />
&nbsp;* @license &nbsp; &nbsp; GPLv3 &lt;http://www.gnu.org/licenses/gpl-3.0.txt&gt;<br />
&nbsp;* @link &nbsp; &nbsp;&nbsp; &nbsp; http://bitbucket.org/ipalaus/codeigniter-googl-helper/<br />
&nbsp;* @link&nbsp; &nbsp; &nbsp; &nbsp; http://ggl-shortener.appspot.com/instructions/<br />
&nbsp;* @version &nbsp; &nbsp; 1.0<br />
&nbsp;* @author &nbsp;&nbsp; &nbsp; Isern Palaus &lt;http://blog.ipalaus.es&gt;<br />
&nbsp;* @copyright &nbsp; Copyright (c) 2010, Isern Palaus &lt;http://blog.ipalaus.es&gt;<br />
&nbsp;*/</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'googl_url'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> googl_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$long_url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$secure</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$curl</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/curl_init"><span style="color: #990000;">curl_init</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://ggl-shortener.appspot.com/?url='</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/rawurlencode"><span style="color: #990000;">rawurlencode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$long_url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/curl_setopt"><span style="color: #990000;">curl_setopt</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</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><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/curl_exec"><span style="color: #990000;">curl_exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$json_response</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/json_decode"><span style="color: #990000;">json_decode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$json_response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">error_message</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$json_response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">short_url</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$secure</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$long_url</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/curl_close"><span style="color: #990000;">curl_close</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$secure</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$long_url</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>El uso es muy sencillo: necesitas cargar el <em>helper</em> y usar la función <strong>googl_url()</strong>:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_about(2)" title="Show plugin information"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'googl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://blog.ipalaus.es'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$short_url</span> <span style="color: #339933;">=</span> googl_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Puedes pasar un segundo parámetro TRUE/FALSE para que devuelve la URL original si alguna cosa va mal. Por defecto será <em>TRUE</em> (por defecto devolverá la url original si algo falla):</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_about(3)" title="Show plugin information"><img border="0" style="border: 0 none" src="http://blog.ipalaus.es/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><span style="color: #000088;">$short_url</span> <span style="color: #339933;">=</span> googl_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><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></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ipalaus.es/codeigniter-goo-gl-helper/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wpToGo, la aplicaci&#243;n m&#243;vil para Wordpress y Android</title>
		<link>http://blog.ipalaus.es/wptogo-la-aplicacin-mvil-para-wordpress-y-android</link>
		<comments>http://blog.ipalaus.es/wptogo-la-aplicacin-mvil-para-wordpress-y-android#comments</comments>
		<pubDate>Sat, 21 Nov 2009 13:49:10 +0000</pubDate>
		<dc:creator>Isern Palaus</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[wptogo]]></category>

		<guid isPermaLink="false">http://blog.ipalaus.es/wptogo-la-aplicacin-mvil-para-wordpress-y-android</guid>
		<description><![CDATA[Hola amigos,
Estoy provando la aplicaci&#243;n wpToGo para m&#243;viles con el sistema operativo Android. La verdad, me parece una gran aplicaci&#243;n y seguramente la usar&#233; para un nuevo proyecto. Me gustaria poder modificarla o adaptar una aplicaci&#243;n en PHP que trabajara con la misma, pero seria necesario adaptarse a este sistema&#8230; ya que mi pr&#243;ximo proyecto <a href="http://blog.ipalaus.es/wptogo-la-aplicacin-mvil-para-wordpress-y-android" class="more-link">Más &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Hola amigos,</p>
<p>Estoy provando la aplicaci&oacute;n wpToGo para m&oacute;viles con el sistema operativo Android. La verdad, me parece una gran aplicaci&oacute;n y seguramente la usar&eacute; para un nuevo proyecto. Me gustaria poder modificarla o adaptar una aplicaci&oacute;n en PHP que trabajara con la misma, pero seria necesario adaptarse a este sistema&#8230; ya que mi pr&oacute;ximo proyecto lo escribir&eacute; integramente des del m&oacute;vil.</p>
<p>Hasta pronto!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ipalaus.es/wptogo-la-aplicacin-mvil-para-wordpress-y-android/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
