<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Stiod Blog</title>
	
	<link>http://blog.stiod.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 05 Nov 2009 13:48:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Stiod" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Carrossel de imagens com jQuery</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/O9aqRQK2nFA/</link>
		<comments>http://blog.stiod.com/2009/11/05/carrossel-de-imagens-com-jquery/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 13:46:50 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=679</guid>
		<description><![CDATA[Neste post venho mostrar-lhes outro bom plugin para jQuery, o jCarousel.
Com este plugin podemos fazer com que diversas imagens rodem em um espaço limitado tornando o layout mais amigável.
Vamos ao nosso primeiro exemplo de carrossel:



Para fazer um carrossel simples, como este, precisaremos dos arquivos de js e css da biblioteca jCarousel, além do css de [...]]]></description>
			<content:encoded><![CDATA[<p>Neste post venho mostrar-lhes outro bom plugin para jQuery, o <a href="http://sorgalla.com/projects/jcarousel/" target="_blank">jCarousel</a>.<br />
Com este plugin podemos fazer com que diversas imagens rodem em um espaço limitado tornando o layout mais amigável.</p>
<p>Vamos ao nosso primeiro exemplo de carrossel:</p>
<p style="text-align:center;">
<iframe src="http://pub.stiod.com/jquery/carrossel.html" style="width:430px; height:200px;"></iframe>
</p>
<p>Para fazer um carrossel simples, como este, precisaremos dos arquivos de js e css da biblioteca jCarousel, além do css de skin do jCarousel a ser utilizado, e do js do jQuery. Segue o código:</p>
<pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;html<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;head<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;title<span style="font-weight: bold; color: black;">&gt;</span></span></span>Carrossel simples com jQuery<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/style.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/jcarousel.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/tango-skin.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/jquery.js&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/jcarousel.js&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
$(function(){
    $('#carrossel').jcarousel()
})
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/head<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;body<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;h1<span style="font-weight: bold; color: black;">&gt;</span></span></span>jCarousel - Carrosel Simples<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/h1<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ul</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;carrossel&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;jcarousel-skin-tango&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem1.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem2.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem3.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem4.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem5.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem6.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ul<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/body<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/html<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p><br/><br />
Este é o exemplo mais simples de utilização do jCarousel, existem várias outras variações deste através de opções passadas a ele. Dentre as funcionalidades podemos destacar:</p>
<ul>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/static_vertical.html" target="_blank">Carrossel Vertical</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/static_auto.html" target="_blank">Carrossel com scroll automático</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/static_controls.html" target="_blank">Carrosel com controles estáticos </a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_api.html" target="_blank">Carrossel com conteúdo dinâmico via AJAX utilizando a API do Flickr</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/special_textscroller.html" target="_blank">Scroll de Textos</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/special_thickbox.html" target="_blank">Carrossel e Thickbox (clique na imagem do carrossel)</a></li>
</ul>
<p> <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/11/05/carrossel-de-imagens-com-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/11/05/carrossel-de-imagens-com-jquery/</feedburner:origLink></item>
		<item>
		<title>Python logging em Django</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/E8oFHz0KTZM/</link>
		<comments>http://blog.stiod.com/2009/11/03/python-logging-em-django/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 12:30:05 +0000</pubDate>
		<dc:creator>Rafael Sierra</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=661</guid>
		<description><![CDATA[Que o módulo logging e o framework Django são excelentes ferramentas pra qualquer trabalho todos sabem, mas como fazer para integrar os dois?
Eu sempre achei um saco o fato do Django não ter um módulo builtin/contrib que permitisse que ao fazer um simples logging.error('PAN!') a mensagem, a data, o nível, the universe and everything, fossem [...]]]></description>
			<content:encoded><![CDATA[<p>Que o módulo <a href="http://docs.python.org/library/logging.html" targe="_blank">logging</a> e o framework <a href="http://djangoproject.com">Django</a> são excelentes ferramentas pra qualquer trabalho todos sabem, mas como fazer para integrar os dois?</p>
<p>Eu sempre achei um saco o fato do Django não ter um módulo builtin/contrib que permitisse que ao fazer um simples <strong>logging.error('PAN!')</strong> a mensagem, a data, o nível, the universe and everything, fossem gravados no banco de dados. Pra resolver esse simples problema, nada como uma simples solução.</p>
<p><center><img src="http://blog.stiod.com/wp-content/uploads/2009/10/hiccup.gif" alt="Solução" title="Solução" width="250" height="281" class="aligncenter size-full wp-image-663" /><br/><small>A Solução</small></center></p>
<p>Para começar crie um aplicativo em sua aplicação chamado "log", nunca crie a aplicação com nome de "logging", a não ser que você queira problemas com imports não funcionando:</p>
<pre class="bash">python manage.py startapp log</pre>
<p>Em seguida crie o seguinte model:</p>
<pre class="python"><span style="color: #808080; font-style: italic;"># -*- encoding: utf-8 -*-</span>
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">db</span> <span style="color: #ff7700;font-weight:bold;">import</span> models
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">contrib</span> <span style="color: #ff7700;font-weight:bold;">import</span> admin
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Log<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    level = models.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>db_index=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    <span style="color: #008000;">file</span> = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">512</span>, db_index=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    lineno = models.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    date = models.<span style="color: black;">DateTimeField</span><span style="color: black;">&#40;</span>db_index=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    message = models.<span style="color: black;">TextField</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> _get_level_name<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLevelName</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">level</span><span style="color: black;">&#41;</span>
    levelName = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span>fget=_get_level_name<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> _get_message_summary<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">message</span><span style="color: black;">&#41;</span> &gt; <span style="color: #ff4500;">100</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">'%s...'</span>%<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">message</span><span style="color: black;">&#91;</span>:<span style="color: #ff4500;">100</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">message</span>
    messageSummary = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span>fget=_get_message_summary<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> _get_file_summary<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: #008000;">file</span><span style="color: black;">&#41;</span> &gt; <span style="color: #ff4500;">30</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">'...%s'</span>%<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: #008000;">file</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">-30</span>:<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: #008000;">file</span>
    fileSummary = <span style="color: #008000;">property</span><span style="color: black;">&#40;</span>fget=_get_file_summary<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> LogAdmin<span style="color: black;">&#40;</span>admin.<span style="color: black;">ModelAdmin</span><span style="color: black;">&#41;</span>:
   date_hierarchy = <span style="color: #483d8b;">'date'</span>
   list_display = <span style="color: black;">&#40;</span><span style="color: #483d8b;">'level'</span>, <span style="color: #483d8b;">'levelName'</span>, <span style="color: #483d8b;">'date'</span>,<span style="color: #483d8b;">'messageSummary'</span>, <span style="color: #483d8b;">'fileSummary'</span>, <span style="color: #483d8b;">'lineno'</span><span style="color: black;">&#41;</span>
   list_filter = <span style="color: black;">&#40;</span><span style="color: #483d8b;">'level'</span>,<span style="color: black;">&#41;</span>
   search_fields = <span style="color: black;">&#40;</span><span style="color: #483d8b;">'message'</span>, <span style="color: #483d8b;">'file'</span><span style="color: black;">&#41;</span>
&nbsp;
admin.<span style="color: #dc143c;">site</span>.<span style="color: black;">register</span><span style="color: black;">&#40;</span>Log, LogAdmin<span style="color: black;">&#41;</span>
&nbsp;</pre>
<p>Em seguida crie o arquivo "handler.py" dentro do aplicativo "log" com o seguinte conteúdo:</p>
<pre class="python">&nbsp;
<span style="color: #808080; font-style: italic;"># -*- encoding: utf-8 -*-</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">datetime</span>
<span style="color: #ff7700;font-weight:bold;">from</span> SEUPROJETO.<span style="color: black;">log</span>.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Log
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> DjangoHandler<span style="color: black;">&#40;</span><span style="color: #dc143c;">logging</span>.<span style="color: black;">Handler</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'Executa a manipulação do log e insere no banco de dados'</span><span style="color: #483d8b;">''</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> emit<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, record<span style="color: black;">&#41;</span>:
        log = Log<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        log.<span style="color: black;">level</span> = record.<span style="color: black;">levelno</span>
        log.<span style="color: #008000;">file</span> = record.<span style="color: black;">pathname</span>
        log.<span style="color: black;">lineno</span> = record.<span style="color: black;">lineno</span>
        log.<span style="color: black;">message</span> = record.<span style="color: black;">msg</span>
        <span style="color: #808080; font-style: italic;"># TODO: Utiizar o record.created</span>
        log.<span style="color: black;">date</span> = <span style="color: #dc143c;">datetime</span>.<span style="color: #dc143c;">datetime</span>.<span style="color: black;">now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        log.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;</pre>
<p>Com isso você já tem tudo que precisa pra logar direto pro banco de dados, só falta uma coisa: Configurar o projeto para o logging usar nosso handler.</p>
<p>Pra fazer isso, edite o arquivo __init__.py (e você achando que esse arquivo era inutil <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  e adicione o seguinte conteúdo ao arquivo:</p>
<pre class="python">&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
<span style="color: #ff7700;font-weight:bold;">from</span> SEUPROJETO.<span style="color: black;">log</span>.<span style="color: black;">handler</span> <span style="color: #ff7700;font-weight:bold;">import</span> DjangoHandler
django_handler = DjangoHandler<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">logging</span>.<span style="color: black;">root</span>.<span style="color: black;">addHandler</span><span style="color: black;">&#40;</span>django_handler<span style="color: black;">&#41;</span>
&nbsp;</pre>
<p>E pronto, é só correr pro abraço, todo e qualquer log que você executar vai ser armazenado no banco de dados.</p>
<p><center><img src="http://blog.stiod.com/wp-content/uploads/2009/10/8.jpg" alt="Yes! Tudo que faltava pra terminar meu projeto!" title="É nois!" width="380" height="315" class="size-full wp-image-671" /><br/><small>Yes! Tudo que faltava pra terminar meu projeto!</small></center></p>
<p>... e antes que você venha me reclamar que a p0rr@ do log não ta aparecendo em lugar nenhum, verifique se você está usando o <strong>logging.debug</strong> com a configuração padrão do módulo logging (que só exibe mensagens de nível mais alto).</p>
<p>Em tempo: Eu sei que é extremamente simples criar um módulo/pacote com tudo isso, mas não seria tão didatico simplesmente falar "baixe aqui, copie ali e import lá".</p>
<p>Se você tiver interesse, sugira a implantação deste módulo ao <strong>django.contrib</strong> <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/11/03/python-logging-em-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/11/03/python-logging-em-django/</feedburner:origLink></item>
		<item>
		<title>Agregador de redes sociais em PHP</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/1rGWIHmN1Gk/</link>
		<comments>http://blog.stiod.com/2009/10/28/agregador-de-redes-sociais-em-php/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 17:10:11 +0000</pubDate>
		<dc:creator>Rafael Monteiro</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=586</guid>
		<description><![CDATA[Cenário
Atualmente temos uma diversidade de conteúdo espalhado sob diversas formas, seja através de fotos, comentários, tweets, blogs, links favoritos, etc. Como exemplo podemos citar as redes: Flickr, Last.fm e Twitter.
Não seria interessante agregá-los em uma página ?
Isso pode ser feito utilizando a classe SimplePie,  de código aberto,  fácil utilização, escrita em PHP e [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cenário</strong></p>
<p>Atualmente temos uma diversidade de conteúdo espalhado sob diversas formas, seja através de fotos, comentários, <em>tweets</em>, blogs, links favoritos, etc. Como exemplo podemos citar as redes: <a href="http://www.flickr.com/">Flickr</a>, <a href="http://www.lastfm.com.br/">Last.fm</a> e <a href="http://twitter.com/">Twitter</a>.</p>
<p>Não seria interessante agregá-los em uma página ?</p>
<p>Isso pode ser feito utilizando a classe SimplePie,  de código aberto,  fácil utilização, escrita em PHP e que nos ajudará a trabalhar com o RSS necessário para a manipulação dos dados.</p>
<p>Ela pode ser encontrada em: <a href="http://simplepie.org/downloads/" target="_blank">http://simplepie.org/downloads/</a>.</p>
<p><strong><span id="more-586"></span></strong></p>
<p><strong><br />
Utilização</strong></p>
<p>Primeiramente precisamos coletar os feeds desejados.</p>
<p>Para isso, acesse seus perfis (ou de quem você deseja seguir) e guarde as URLs que geralmente estão nos ícones de RSS.</p>
<p>Precisamos realizar um simples teste de compatibilidade (já disponível no pacote) para verificarmos se o servidor que rodará a aplicação oferece suporte completo à classe. Esse teste encontra-se na pasta "<em>compatibility_test</em>".</p>
<p>Devemos criar uma pasta para o cache da aplicação. Basicamente ela armazenará certificados.</p>
<p><strong><br />
Exemplo</strong></p>
<p>Definindo path da classe e variáveis de configuração</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'./simplepie/simplepie.inc'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$cache</span> = <span style="color: #ff0000;">&quot;./rsscache&quot;</span>;
<span style="color: #0000ff;">$duration</span> = <span style="color: #cc66cc;">2000</span>;</pre>
<p><br/><br />
Definindo os feeds</p>
<pre class="php"><span style="color: #808080; font-style: italic;">// Para o blog e twitter utilizamos o perfil da Stiod, como exemplo</span>
<span style="color: #0000ff;">$blog</span> = <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://blog.stiod.com/rss.xml&quot;</span>, <span style="color: #0000ff;">$cache</span>, <span style="color: #0000ff;">$duration</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$twitter</span> = <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://twitter.com/statuses/user_timeline/17368651.rss&quot;</span>, <span style="color: #0000ff;">$cache</span>, <span style="color: #0000ff;">$duration</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// Substitua PERFIL pelo desejado</span>
<span style="color: #0000ff;">$lastfm</span> = <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://ws.audioscrobbler.com/2.0/user/PERFIL/lovedtracks.rss&quot;</span>, <span style="color: #0000ff;">$cache</span>, <span style="color: #0000ff;">$duration</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p><br/><br />
Função para transformar os nomes em links diretos</p>
<pre class="php">&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> twitterify<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ret</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #0000ff;">$ret</span> = <a href="http://www.php.net/preg_replace"><span style="color: #000066;">preg_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;#(^|[<span style="color: #000099; font-weight: bold;">\n</span> ])([<span style="color: #000099; font-weight: bold;">\w</span>]+?://[<span style="color: #000099; font-weight: bold;">\w</span>]+[^ <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\t</span>&lt; ]*)#&quot;</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>1&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\\</span>2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\\</span>2&lt;/a&gt;&quot;</span>, <span style="color: #0000ff;">$ret</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #0000ff;">$ret</span> = <a href="http://www.php.net/preg_replace"><span style="color: #000066;">preg_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;#(^|[<span style="color: #000099; font-weight: bold;">\n</span> ])((www|ftp)<span style="color: #000099; font-weight: bold;">\.</span>[^ <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&lt; ]*)#&quot;</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>1&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://<span style="color: #000099; font-weight: bold;">\\</span>2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\\</span>2&lt;/a&gt;&quot;</span>, <span style="color: #0000ff;">$ret</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #0000ff;">$ret</span> = <a href="http://www.php.net/preg_replace"><span style="color: #000066;">preg_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/@(<span style="color: #000099; font-weight: bold;">\w</span>+)/&quot;</span>, <span style="color: #ff0000;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://www.twitter.com/<span style="color: #000099; font-weight: bold;">\\</span>1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;@<span style="color: #000099; font-weight: bold;">\\</span>1&lt;/a&gt;&quot;</span>, <span style="color: #0000ff;">$ret</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #0000ff;">$ret</span> = <a href="http://www.php.net/preg_replace"><span style="color: #000066;">preg_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/#(<span style="color: #000099; font-weight: bold;">\w</span>+)/&quot;</span>, <span style="color: #ff0000;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://search.twitter.com/search?q=<span style="color: #000099; font-weight: bold;">\\</span>1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;#<span style="color: #000099; font-weight: bold;">\\</span>1&lt;/a&gt;&quot;</span>, <span style="color: #0000ff;">$ret</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$ret</span>;
 <span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p><br/><br />
Para carregarmos os itens, utilizamos uma estrutura de repetição como a seguinte</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$twitter</span>-&gt;<span style="color: #006600;">get_items</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$item</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;li&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> twitterify<span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/str_replace"><span style="color: #000066;">str_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;raena: &quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span>, <span style="color: #0000ff;">$item</span>-&gt;<span style="color: #006600;">get_title</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;a href=<span style="color: #ff0000;">&quot;&lt;?php echo $item-&gt;get_link(); ?&gt;&quot;</span>&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$item</span>-&gt;<span style="color: #006600;">get_date</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;&lt;/a&gt;
&lt;/li&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
<p><br/><br />
Baixe o exemplo completo do <a href="http://blog.stiod.com/wp-content/uploads/2009/10/agregador.zip"> agregador</a></p>
<p>Esse foi um exemplo básico, entretanto, não ficamos restritos ao exposto, é possível fazermos aplicações com maiores funcionalidades.</p>
<p>Para isso, acesse o <a href="http://simplepie.org/wiki/">Wiki</a>, onde existem inclusive plugins para a extensão da classe.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/28/agregador-de-redes-sociais-em-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/28/agregador-de-redes-sociais-em-php/</feedburner:origLink></item>
		<item>
		<title>Slide de Imagens com jQuery</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/xplyEHjAqh0/</link>
		<comments>http://blog.stiod.com/2009/10/26/slide-de-imagens-jquery/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 14:44:38 +0000</pubDate>
		<dc:creator>Ricardo Perez</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=420</guid>
		<description><![CDATA[Continuando a série de post sobre jQuery iniciado por Gabriel.
Hoje vou mostrar um pouco sobre Effects e alguns métodos interessantes do jQuery, Usando como exemplo um simples slide de Imagem.
Neste código vemos o effect FadeIn(efeito de aparecer) e fadeOut(efeito de desaparecer) e o método next

&#160;
function slidein&#40;&#41;&#123;
    active_img = $&#40;&#34;.active&#34;&#41;;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Continuando a série de post sobre jQuery iniciado por Gabriel.</p>
<p>Hoje vou mostrar um pouco sobre <a href="http://docs.jquery.com/Effects" target="_blank">Effects</a> e alguns métodos interessantes do jQuery, Usando como exemplo um simples slide de Imagem.</p>
<p>Neste código vemos o effect <i>FadeIn</i>(efeito de aparecer) e <i>fadeOut</i>(efeito de desaparecer) e o método <i>next</i><br />
<span id="more-420"></span></p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> slidein<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    active_img = $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.active&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #009900; font-style: italic;">//O método next pega o próximo objeto,  dentro do div #slide-img</span>
    next_img =active_img.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #009900; font-style: italic;">// verifica se existe um próximo objeto no div #slide-img</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>next_img.<span style="color: #006600;">length</span>==<span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
            <span style="color: #009900; font-style: italic;">//se não tem um próximo objeto retorna pro primeiro</span>
            next_img = $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.first-active&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    active_img.<span style="color: #006600;">fadeOut</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #66cc66;">&#41;</span>;
    active_img.<span style="color: #006600;">removeClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    next_img.<span style="color: #006600;">fadeIn</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #66cc66;">&#41;</span>;
    next_img.<span style="color: #006600;">addClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
$<span style="color: #66cc66;">&#40;</span>document<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
setInterval<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;slidein()&quot;</span>, <span style="color: #3366CC;">&quot;3500&quot;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
<p><br/><br />
O HTML para o slide de imagem deve ser o seguinte:</p>
<pre>&nbsp;
&lt;div id=&quot;slide-img&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;active first-active&quot;&gt;&lt;img src=&quot;img1.jpg&quot;/&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;img2.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;img3.jpg&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&nbsp;</pre>
<p><br/><br />
Antes coloque esse trecho de CSS:</p>
<pre class="css">&nbsp;
<span style="color: #cc00cc;">#slide-img</span> <span style="color: #66cc66;">&#123;</span>
    float<span style="color: #3333ff;">:left</span>;
    height<span style="color: #3333ff;">:xxx</span> <span style="color: #993333;">px</span>;<span style="color: #808080; font-style: italic;">/* a largura padrão das imgs dentro do slide*/</span>
    overflow<span style="color: #3333ff;">:hidden</span>;
    width<span style="color: #3333ff;">:yyy</span> <span style="color: #993333;">px</span>;<span style="color: #808080; font-style: italic;">/* o altura padrão das imgs dentro do slide*/</span>;
<span style="color: #66cc66;">&#125;</span>
* <span style="color: #66cc66;">&#123;</span>
    margin<span style="color: #3333ff;">:<span style="color: #933;">0</span></span>;
    padding<span style="color: #3333ff;">:<span style="color: #933;">0</span></span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p></br><br />
</br><br />
Veja o exemplo aqui:<br />
<iframe src="http://pub.stiod.com/slides.html"  style="height: 300px; width: 500px;" frameborder="0" border="0"></iframe></p>
<p><br/><br/><br />
<em>O ideal que o tamanho das imagens dentro do slide sejam as mesmas</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/26/slide-de-imagens-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/26/slide-de-imagens-jquery/</feedburner:origLink></item>
		<item>
		<title>Bordas arredondadas com jQuery</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/GZwmjry-eYU/</link>
		<comments>http://blog.stiod.com/2009/10/22/bordas-arredondadas-com-jquery/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 16:25:21 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=557</guid>
		<description><![CDATA[Pulando um pouco a seqüência de posts anteriores, gostaria de mostrar-lhes o plugin Jquery Corner que cria bordas arredondas com o JQuery.
E como funciona?

Para adicionar bordas arredondas basta você adicionar a biblioteca do jquery na sua página e o arquivo js do plugin:
&#160;
&#60;html&#62;
&#60;head&#62;
&#60;title&#62;JQuery Corner&#60;/title&#62;
// Jquery
&#60;script src=&#34;jquery.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
// JQuery Corner
&#60;script src=&#34;jquery.corner.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
&#60;script type=&#34;text/javascript&#34;&#62;
$(function(){    [...]]]></description>
			<content:encoded><![CDATA[<p>Pulando um pouco a seqüência de posts anteriores, gostaria de mostrar-lhes o plugin <a href="http://www.malsup.com/jquery/corner/">Jquery Corner</a> que cria bordas arredondas com o JQuery.</p>
<p><strong>E como funciona?</strong></p>
<p><span id="more-557"></span></p>
<p>Para adicionar bordas arredondas basta você adicionar a biblioteca do jquery na sua página e o <a href="http://www.malsup.com/jquery/corner/jquery.corner.js">arquivo js</a> do plugin:</p>
<pre>&nbsp;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;JQuery Corner&lt;/title&gt;
// Jquery
&lt;script src=&quot;jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
// JQuery Corner
&lt;script src=&quot;jquery.corner.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){     
    // Arredonda a borda do elemento com id borda-arredondada
    $('#borda-arredondada').corner() 
})
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;borda-arredondada&quot;&gt;
Lorem ipsum dolor sit amet
&lt;/div&gt;
&nbsp;
&lt;/body&gt;
&lt;/html&gt;
&nbsp;</pre>
<p><br/>Segue o exemplo:<br />
<iframe src="http://pub.stiod.com/jquery-corner.html" frameborder="0" border="0" style="height:220px;width:100%;"></iframe><br />
<br/></p>
<p>
Você ainda pode passar parâmetros para colocar bordas com certo tamanho de arredondamento, ou somente no topo, em baixo, ou outras "formas de arredondamento":</p>
<pre>&nbsp;
// Borda de 30px em todas as pontas
$(&quot;#borda-arredondada').corner('30px')
// Somente no topo
$(&quot;#borda-arredondada').corner('top')
// Somente em baixo
$(&quot;#borda-arredondada').corner('bottom')
// Somente no topo direito (tr = top + right)
$(&quot;#borda-arredondada').corner('tr')
// Bevel
$(&quot;#borda-arredondada').corner('bevel')
&nbsp;</pre>
<p><br/><br />
Outros exemplos podem ser vistos no site <a href="http://www.malsup.com/jquery/corner/">http://www.malsup.com/jquery/corner/</a>.<br />
<br/><br />
É isso ai <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/22/bordas-arredondadas-com-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/22/bordas-arredondadas-com-jquery/</feedburner:origLink></item>
		<item>
		<title>Envio de email utilizando a classe PHPMailer</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/kHSS9zGso_U/</link>
		<comments>http://blog.stiod.com/2009/10/19/envio-de-email-utilizando-a-classe-phpmailer/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:31:13 +0000</pubDate>
		<dc:creator>Rafael Monteiro</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=438</guid>
		<description><![CDATA[Cenário
De início você pode estar pensando: "mas porquê vou incluir essa biblioteca se o PHP já possui a função mail() nativamente ?".
Através da classe PHPMailer, temos uma solução de envio de email mais robusta e com maiores funcionalidades, dentre elas a possibilidade de incluir anexos à mensagem, incluir CCs e CCOs, definir tamanho padrão para [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cenário</strong></p>
<p>De início você pode estar pensando: "mas porquê vou incluir essa biblioteca se o PHP já possui a função <em>mail() </em>nativamente ?".</p>
<p>Através da classe PHPMailer, temos uma solução de envio de email mais robusta e com maiores funcionalidades, dentre elas a possibilidade de incluir anexos à mensagem, incluir CCs e CCOs, definir tamanho padrão para quebra de palavras (<em>wordwrap</em>) e utilizar um servidor SMTP, sendmail ou QMail para o envio.</p>
<p>O fato de podermos especificar como será feito o envio é particularmente útil no caso de hospedarmos uma aplicação em um ambiente que não possua um servidor de email integrado (cenário incomum mas que pode vir a ocorrer). Nesse caso, é possível, ainda, definirmos um <em>host</em> padrão para envio e um outro redundante, no caso de o primeiro falhar.</p>
<p><strong>Onde encontrar</strong></p>
<p>O download da biblioteca pode ser feito em: <a href="http://sourceforge.net/projects/phpmailer/files/">http://sourceforge.net/projects/phpmailer/files/</a>.<br />
Nesse endereço existem versões para o PHP 4 e PHP 5.</p>
<p><span id="more-438"></span><br />
<strong>Exemplo de utilização (adaptado do leiame do projeto):</strong><br />
<br/><br />
Configurações de envio</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;class.phpmailer.php&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0000ff;">$mail</span> = <span style="color: #000000; font-weight: bold;">new</span> PHPMailer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">// configuramos o mailer para utilizar SMTP</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">IsSMTP</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">// especificamos o servidor principal e o reserva</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Host</span> = <span style="color: #ff0000;">&quot;smtp1.example.com;smtp2.example.com&quot;</span>;
    <span style="color: #808080; font-style: italic;">// ativamos a autenticação no SMTP</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">SMTPAuth</span> = <span style="color: #000000; font-weight: bold;">true</span>;
    <span style="color: #808080; font-style: italic;">// usuário(s) de SMTP</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Username</span> = <span style="color: #ff0000;">&quot;usuario_smtp1;usuario_smtp2&quot;</span>;
    <span style="color: #808080; font-style: italic;">// senha(s) de SMTP</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Password</span> = <span style="color: #ff0000;">&quot;senha_smtp1;senha_smtp2&quot;</span>;</pre>
<p><br/><br />
Cabeçalho e conteúdo da mensagem</p>
<pre class="php">    <span style="color: #808080; font-style: italic;">/* podemos utilizar qualquer idioma presente na pasta languages,
    facilitando uma eventual depuração de erros */</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">SetLanguage</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;br&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">From</span> = <span style="color: #ff0000;">&quot;from@example.com&quot;</span>;
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">FromName</span> = <span style="color: #ff0000;">&quot;Mailer&quot;</span>;
    <span style="color: #808080; font-style: italic;">// o nome é opcional</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">AddAddress</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;josh@example.net&quot;</span>, <span style="color: #ff0000;">&quot;Josh Adams&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">// quebra de palavra em 50 caracteres</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">WordWrap</span> = <span style="color: #cc66cc;">50</span>;
    <span style="color: #808080; font-style: italic;">// anexo - nome é opcional</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">AddAttachment</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/tmp/image.jpg&quot;</span>, <span style="color: #ff0000;">&quot;new.jpg&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">// configuramos o formato de email como HTML</span>
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">IsHTML</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Subject</span> = <span style="color: #ff0000;">&quot;Este é o assunto&quot;</span>;
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Body</span>    = <span style="color: #ff0000;">&quot;Este é o corpo da mensagem HTML &lt;b&gt;em negrito!&lt;/b&gt;&quot;</span>;
    <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">AltBody</span> = <span style="color: #ff0000;">&quot;Este é o texto puro para clientes de email que não suportam HTML&quot;</span>;</pre>
<p><br/><br />
Envio do email</p>
<pre class="php">    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Send</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;A mensagem não pôde ser enviada.&lt;br/&gt;&quot;</span>;
        <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;Erro: &quot;</span> . <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">ErrorInfo</span>;
        <a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a>;
    <span style="color: #66cc66;">&#125;</span>
    <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;Mensagem enviada !&quot;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/19/envio-de-email-utilizando-a-classe-phpmailer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/19/envio-de-email-utilizando-a-classe-phpmailer/</feedburner:origLink></item>
		<item>
		<title>API do Twitter para Python</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/y-FonYgUnqs/</link>
		<comments>http://blog.stiod.com/2009/10/14/api-do-twitter-para-python/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 04:50:52 +0000</pubDate>
		<dc:creator>Yoshio Iwamoto</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=528</guid>
		<description><![CDATA[Hoje vou mostrar como fazer uso da API do Twitter para Python, a Python Twitter API. Sua utilização é bem simples e podemos criar vários aplicativos ou scripts para automatizar algumas tarefas no microblog, como o script que fiz no meu último post.
Instalação no Linux
Baixe o código fonte da última versão aqui.
Descompacte com o comando:
$ [...]]]></description>
			<content:encoded><![CDATA[<p>Hoje vou mostrar como fazer uso da API do Twitter para Python, a <a href="http://code.google.com/p/python-twitter/">Python Twitter API</a>. Sua utilização é bem simples e podemos criar vários aplicativos ou scripts para automatizar algumas tarefas no microblog, como o script que fiz no meu <a href="http://blog.stiod.com/2009/10/07/seja-seguido-no-twitter-sem-incomodar-as-pessoas/">último post</a>.<br/></p>
<p><strong>Instalação no Linux</strong><br />
Baixe o código fonte da última versão <a href="http://code.google.com/p/python-twitter/downloads/list">aqui</a>.</p>
<p>Descompacte com o comando:<br />
<code>$ tar -zxvf python-twitter-XXX.tar.gz</code></p>
<p>Após descompactar entre no diretório criado e execute o seguinte comando como usuário root:<br />
<code># python setup.py install</code><br />
<br/><br />
<strong>Utilização</strong><br />
Para utilizar a API importe o módulo <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html">twitter</a>:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> twitter
...</pre>
<p>As principais classes que você deve conhecer são:<br />
<a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Api">twitter.Api</a><br />
<a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#User">twitter.User</a><br />
<a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Status">twitter.Status</a><br />
<a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#DirectMessage">twitter.DirectMessage</a></p>
<p>Para iniciar, crie uma instancia da classe <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Api">twitter.Api</a>:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> twitter
api = twitter.<span style="color: black;">Api</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre>
<p>Com este objeto você pode utilizar os métodos da API que não necessitam de autenticação do usuário. Um Exemplo é o método <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Api-GetPublicTimeline">GetPublicTimeline</a>, que sem parâmetros retorna as últimas 20 mensagens de status dos usuários.</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> twitter
api = twitter.<span style="color: black;">Api</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
status_list = api.<span style="color: black;">GetPublicTimeline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> status <span style="color: #ff7700;font-weight:bold;">in</span> status_list:
    <span style="color: #ff7700;font-weight:bold;">print</span> status.<span style="color: #dc143c;">user</span>.<span style="color: black;">name</span></pre>
<p>No exemplo anterior o status é um objeto da classe <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Status">twitter.Status</a>. A classe twitter.Status possui um atributo user que é um objeto da classe <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#User">twitter.User</a>.</p>
<p>Para realizar a autenticação de um usuário, instancie a classe <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Api">twitter.Api</a>, porém passando o usuário e a senha como parâmetros:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> twitter
api = twitter.<span style="color: black;">Api</span><span style="color: black;">&#40;</span>username=<span style="color: #483d8b;">'joao'</span>, password=<span style="color: #483d8b;">'abc123'</span><span style="color: black;">&#41;</span></pre>
<p>Para enviar uma mensagem utilize o método <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Api-PostUpdate">PostUpdate</a>:</p>
<pre class="python"><span style="color: #808080; font-style: italic;"># -*- encoding: utf-8 -*-</span>
<span style="color: #ff7700;font-weight:bold;">import</span> twitter
api = twitter.<span style="color: black;">Api</span><span style="color: black;">&#40;</span>username=<span style="color: #483d8b;">'joao'</span>, password=<span style="color: #483d8b;">'abc123'</span><span style="color: black;">&#41;</span>
status = api.<span style="color: black;">PostUpdate</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: #483d8b;">'Yohohoho! Enviei uma mensagem! Mas cuidado
com os limite de 140 caracteres.'</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span></pre>
<p>Repare que ele retorna o status da mensagem enviada.<br/></p>
<p><strong>Várias mensagens contínuas</strong><br />
Um método interessante da API é o <a href="http://static.unto.net/python-twitter/0.6/doc/twitter.html#Api-PostUpdates">PostUpdates</a>, que permite que seja enviada uma mensagem com mais de 140 caracteres. A mensagem na verdade é enviada como se fosse várias mensagens com no máximo 140 caracteres.</p>
<p>Você também pode indicar uma string de continuação no segundo parâmetro, esta string é colocada no final das mensagens para indicar a continuação.</p>
<pre class="python"><span style="color: #808080; font-style: italic;"># -*- encoding: utf-8 -*-</span>
<span style="color: #ff7700;font-weight:bold;">import</span> twitter
api = twitter.<span style="color: black;">Api</span><span style="color: black;">&#40;</span>username=<span style="color: #483d8b;">'joao'</span>, password=<span style="color: #483d8b;">'abc123'</span><span style="color: black;">&#41;</span>
status = api.<span style="color: black;">PostUpdates</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: #483d8b;">'Yohohoho! Enviei uma mensagem bem grande!
Agora você não precisa se preocupar com o tamanho da mensagem pois
este método irá dividi-la para você em várias mensagens, você também
pode utilizar uma string de continuação ao lado.'</span><span style="color: #483d8b;">''</span>, <span style="color: #483d8b;">'…'</span><span style="color: black;">&#41;</span></pre>
<p><em><strong>Obs: Segundo a documentação da API, o Twitter remove as reticências ("...") das strings das mensagem, por isso utilize o caractere UNICODE \u2026 ("…"). Também não ultrapasse o limite dos 150 requests permitidos por hora pelo Twitter.</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/14/api-do-twitter-para-python/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/14/api-do-twitter-para-python/</feedburner:origLink></item>
		<item>
		<title>O objeto JQuery e seus seletores</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/iDyjVNN6jb0/</link>
		<comments>http://blog.stiod.com/2009/10/09/o-objeto-jquery-e-seus-seletores/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 13:24:01 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript jquery xhtml]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=380</guid>
		<description><![CDATA[Continuando o post anterior sobre jQuery, iremos descrever o objeto jQuery.
A maioria das funcionalidades do jQuery é iniciada pela objeto $. O $ no jQuery possui diversas funcionalidades, que podem ser:
- Obtenção de objetos a partir de seletores.
Ex.: Obtendo todos os objetos que contenham a classe "dinamico":
alert($(".dinamico").length)
- "Window onload" (funções que irão ser executadas após [...]]]></description>
			<content:encoded><![CDATA[<p>Continuando o <a href="/2009/09/21/jquery-introducao-a-biblioteca-javascript/">post anterior</a> sobre jQuery, iremos descrever o objeto jQuery.<br />
A maioria das funcionalidades do jQuery é iniciada pela objeto $. O $ no jQuery possui diversas funcionalidades, que podem ser:</p>
<p><strong>- Obtenção de objetos a partir de seletores.</strong><br />
Ex.: Obtendo todos os objetos que contenham a classe "dinamico":<br />
<code>alert($(".dinamico").length)</code></p>
<p><strong>- "Window onload" (funções que irão ser executadas após o término do carregamento da página).</strong><br />
Ex.: Executando função com mensagem simples:<br />
<code>$(function(){<br />
alert("A página já carregou!")<br />
})</code></p>
<p><strong>- Funções úteis (<em>a serem descritas em um próximo post</em>).</strong><br />
Ex.: Removendo espaços do final e começo de uma string:<br />
<code>alert($.trim("              texto             ").length)</code></p>
<p><strong>- Ajax</strong><br />
Ex.: Requisição ajax por get<br />
<code>$.get("exemplo-ajax.php", function(resposta){<br />
alert(resposta)<br />
})</code></p>
<p><strong>- Criar conteúdo dinâmicamente</strong><br />
Ex.: Adicionando um novo paragrafo ao corpo da página:<br />
<code>$('&lt;p&gt;Novo Paragrafo&lt;/p&gt;').appendTo(document.body)</code></p>
<p><strong>Seletores</strong></p>
<p>Seletores são declarações que igualam um ou vários elementos do HTML. São eles que mapeiam o HTML no css:</p>
<table style="width: 100%;" border="1" bordercolor="#000000">
<thead>
<tr>
<th>Seletor</th>
<th>Descrição</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center"><strong>TAG</strong></td>
<td>Traz todos os elementos que sejam da TAG selecionada.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">alert($('p').length)</code></td>
</tr>
<tr>
<td align="center"><strong>#ID</strong></td>
<td>Traz o elemento que tenha o ID selecionado.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('#conteudo').css('background-color', '#ccc')</code></td>
</tr>
<tr>
<td align="center"><strong>.CLASSE</strong></td>
<td>Traz todos os elementos que tenham a CLASSE selecionada.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('.content-center').css('text-align', 'center')</code></td>
</tr>
<tr>
<td align="center"><strong>[PROPRIEDADE=VALOR]</strong></td>
<td>Traz todos os elementos que tenham a PROPRIEDADE com o VALOR selecionado.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('[name=nome]').val('Gabriel Verta')</code></td>
</tr>
<tr>
<td align="center"><strong>SELETOR1 SELETOR2</strong></td>
<td>Traz todos os elementos que SELETOR2 que estejem dentro do SELETOR1.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('div label').addClass('required')</code></td>
</tr>
</tbody>
</table>
<p><br/><br />
Existe uma lista extensa de seletores para jQuery, que podem ser vistas na <a href="http://docs.jquery.com/Selectors" target="_blank">documentação oficial do jQuery</a>. Tentei criar um site com uma <a href="http://gabriel.stiod.com/jquery/" target="_blank">forma dinâmica de ver estes seletores em jQuery</a>, espero que entendam como funciona o site. <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/09/o-objeto-jquery-e-seus-seletores/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/09/o-objeto-jquery-e-seus-seletores/</feedburner:origLink></item>
		<item>
		<title>Seja seguido no Twitter sem incomodar as pessoas</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/UObEZu8UEmI/</link>
		<comments>http://blog.stiod.com/2009/10/07/seja-seguido-no-twitter-sem-incomodar-as-pessoas/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 16:36:57 +0000</pubDate>
		<dc:creator>Yoshio Iwamoto</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=468</guid>
		<description><![CDATA[Em dois dias meu usuário doTwitter pulou de 20 seguidores para quase 200. Não é enganação, é até um problema do Twitter, ou não, já que não é bem um bug.
Se você procurar por aí na internet irá encontrar vários métodos de como conseguir mais seguidores no Twitter, mas todos dizem praticamente a mesma coisa: [...]]]></description>
			<content:encoded><![CDATA[<p>Em dois dias <a href="http://twitter.com/yoshioiwamoto">meu usuário doTwitter</a> pulou de 20 seguidores para quase 200. Não é enganação, é até um problema do <a href="http://twitter.com/">Twitter</a>, ou não, já que não é bem um bug.</p>
<p>Se você procurar por aí na internet irá encontrar vários métodos de como conseguir mais seguidores no Twitter, mas todos dizem praticamente a mesma coisa: seguir os outros e esperar que eles te sigam também.</p>
<p>De fato isto é verdade e funciona se você seguir muitos (muitos) usuários, mas minha idéia foi um pouco diferente. Vou contar uma historinha.</p>
<p>Estava vendo na <a href="http://www.folha.uol.com.br/">Folha Online</a> uma <a href="http://www1.folha.uol.com.br/folha/informatica/ult124u631036.shtml">matéria sobre as principais frases ditas pelos famosos no Twitter</a> e umas das frases era do ilustre William Bonner (que aliás sou grande fã). Eu já esqueci qual foi a frase dele, mas o importante é que graças a matéria eu descobri que ele tinha Twitter (<a href="http://twitter.com/realwbonner">@realwbonner</a>), então passei a segui-lo.</p>
<p>Por curiosidade fui ver quantos seguidores ele tinha e ao entrar na página de seguidores dele meu usuário do Twitter estava sendo exibido no topo dos resultados.</p>
<p>Naquele dia, acho que ele tinha mais ou menos 40 mil seguidores. A exibição do meu usuário na página de seguidores dele acabou me rendendo 3 novos seguidores. Uma idéia estava surgindo...</p>
<p>Entrei novamente na página de seguidores dele, mas meu usuário não estava mais no topo. A causa era que o <a href="http://twitter.com/realwbonner">@realwbonner</a> estava adquirindo mais seguidores fazendo os antigos caírem nos resultados. Uma idéia se completou!</p>
<p>Eureka! <strong>Vou criar um script para dar Unfollows e Follows nos Twitters com mais usuários do Brasil</strong>. Em tempos em tempos eu executo o script e ele faz o meu usuário ficar no topo dos resultados dos seguidores deles.</p>
<p>Se pegarmos o <a href="http://twitter.com/hucklucianO">@hucklucianO</a> que possui mais de 1 milhão de seguidores e deixar o seu usuário em exibição no topo da página de seguidores dele, isto irá fazer as pessoas prestarem mais atenção em você.</p>
<p><strong>Vamos ao script</strong></p>
<p>O script foi desenvolvido em <a href="http://www.python.org/">Python (v2.6)</a> e utiliza a <a href="http://code.google.com/p/python-twitter/">Python Twitter API (v0.6)</a>.</p>
<p>Baixe o código fonte da <a href="http://code.google.com/p/python-twitter/">Python Twitter API</a> em:<br />
<a href="http://python-twitter.googlecode.com/files/python-twitter-0.6.tar.gz">http://python-twitter.googlecode.com/files/python-twitter-0.6.tar.gz</a></p>
<p>Descompacte com o arquivo com o comando:<br />
<code>$ tar -zxvf python-twitter-0.6.tar.gz</code></p>
<p>Entre na pasta criada e instale a API (como root):<br />
<code>$ cd python-twitter-0.6<br />
$ sudo python setup.py install</code></p>
<p>Finalmente, <a href='http://blog.stiod.com/wp-content/uploads/2009/10/followme.py'>baixe o script que criei aqui</a>. Será necessário edita-lo. Abra com algum editor de texto e altere este trecho:</p>
<pre class="python">your_users = <span style="color: black;">&#91;</span>
    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'seu_usuario'</span>, <span style="color: #483d8b;">'senha'</span>,<span style="color: black;">&#41;</span>, <span style="color: #808080; font-style: italic;"># Ex: ('joao', 'asd123'),</span>
    <span style="color: #808080; font-style: italic;"># ('outro usuario', 'senha'),</span>
    <span style="color: #808080; font-style: italic;"># ...</span>
<span style="color: black;">&#93;</span></pre>
<p>No trecho acima você deve inserir o seu usuário e senha do Twitter para que a API possa realizar o login. Você está de posse de 100% do código, repare que em momento algum o seu usuário e senhas são enviados para mim. <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Neste outro trecho você insere os usuário do Twitter que deseja seguir. Coloque cada usuário em uma linha dentro do espaço delimitado entre as três aspas. No script eu já adicionei alguns camaradas <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="python">twitter_users = <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'
yoshioiwamoto
rafaelsdm
ricardoperez
gabrielverta
'</span><span style="color: #483d8b;">''</span></pre>
<p>Quanto mais seguidores eles tiverem, melhor. Uma dica é dar uma passada no <a href="http://twittercounter.com/">twittercounter</a> onde você pode encontrar quem são os usuários mais seguidos no mundo ou em um país específico (Brasil).</p>
<p>Para rodar o script execute na linha de comando:<br />
<code>$ python followme.py</code></p>
<p>No meu usuário <a href="http://twitter.com/yoshioiwamoto">@yoshioiwamoto</a> eu precisei seguir os 15 usuários do Twitter mais seguidos do Brasil e o script era rodado 3 vezes ao dia.</p>
<p>Uma informação importante, para cada usuário que você segue são necessários 2 requests e o Twitter possui um limite de 150 requests por hora, então gerencie bem os uso deste script.</p>
<p>Se você utiliza sistemas operacionais proprietários que não são baseados em Unix, aguarde até que uma boa alma crie um tutorial para você. <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/07/seja-seguido-no-twitter-sem-incomodar-as-pessoas/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/07/seja-seguido-no-twitter-sem-incomodar-as-pessoas/</feedburner:origLink></item>
		<item>
		<title>VIM – Substituir Tab por Espaços</title>
		<link>http://feedproxy.google.com/~r/Stiod/~3/yXL567yzacw/</link>
		<comments>http://blog.stiod.com/2009/10/06/vim-substituir-tab-por-espacos/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:26:44 +0000</pubDate>
		<dc:creator>Ricardo Perez</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[vim linux vi shell]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=425</guid>
		<description><![CDATA[Uma dica muito rápida!
Se você estiver precisando trocar "Tab" por espaços para identação do seu código fonte, como eu preciso para editar alguns scripts python em  um servidor, basta fazer o seguinte:

:set tabstop=n // seta para cada tab o numero n de espaços
:set expandtab // troca a tab por espaço

Note que para as tabs [...]]]></description>
			<content:encoded><![CDATA[<p>Uma dica muito rápida!</p>
<p>Se você estiver precisando trocar "Tab" por espaços para identação do seu código fonte, como eu preciso para editar alguns scripts <a href="http://python.org">python</a> em  um servidor, basta fazer o seguinte:<br />
<code><br />
:set tabstop=n // seta para cada tab o numero n de espaços<br />
:set expandtab // troca a tab por espaço<br />
</code></p>
<p>Note que para as tabs já existentes no código estes comandos não funcionarão, para ajusta isto basta fazer:<br />
<code><br />
:retab<br />
</code></p>
<p>Para setar permanentemente esses ajuste em seu <em>Vim </em>  basta colocar estes comandos dentro do <em>~/.vimrc</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/06/vim-substituir-tab-por-espacos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.stiod.com/2009/10/06/vim-substituir-tab-por-espacos/</feedburner:origLink></item>
	</channel>
</rss>
