<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: conky : integrating rTorrent downloads monitoring</title>
	<atom:link href="http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/</link>
	<description>On the fly saving of few useful (?) tech tips</description>
	<lastBuildDate>Sun, 05 Feb 2012 16:37:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Stephane Kattoor</title>
		<link>http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/comment-page-1/#comment-8754</link>
		<dc:creator>Stephane Kattoor</dc:creator>
		<pubDate>Thu, 11 Nov 2010 16:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=292#comment-8754</guid>
		<description>Right, I totally forgot about that ! I think Frontier::Client could use an update !

You need to edit Frontier::RPC2 and add the i8 data type like this :
&lt;pre lang=&quot;perl&quot;&gt;
%scalars = (
    &#039;base64&#039; =&gt; 1,
    &#039;boolean&#039; =&gt; 1,
    &#039;dateTime.iso8601&#039; =&gt; 1,
    &#039;double&#039; =&gt; 1,
    &#039;int&#039; =&gt; 1,
    &#039;i4&#039; =&gt; 1,
    &#039;string&#039; =&gt; 1,
    &#039;i8&#039; =&gt; 1,
);
&lt;/pre&gt;

Stephane</description>
		<content:encoded><![CDATA[<p>Right, I totally forgot about that ! I think Frontier::Client could use an update !</p>
<p>You need to edit Frontier::RPC2 and add the i8 data type like this :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p292code1'); return false;">View Code</a> PERL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2921"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p292code1"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">%scalars</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
    <span style="color: #ff0000;">'base64'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'boolean'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'dateTime.iso8601'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'double'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'int'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'i4'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'string'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'i8'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Stephane</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Vereshagin</title>
		<link>http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/comment-page-1/#comment-8753</link>
		<dc:creator>Peter Vereshagin</dc:creator>
		<pubDate>Wed, 10 Nov 2010 10:00:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=292#comment-8753</guid>
		<description>Frontier::Client doesn&#039;t work with such a response from rtorrent:
31744
===
wanted a data type, got `i8&#039;
at line 7 column 7
===
with rtorrent-status.pl</description>
		<content:encoded><![CDATA[<p>Frontier::Client doesn&#8217;t work with such a response from rtorrent:<br />
31744<br />
===<br />
wanted a data type, got `i8&#8242;<br />
at line 7 column 7<br />
===<br />
with rtorrent-status.pl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Perl+Twitter : Getting @mentions from command line&#160;-&#160;Tech@Sakana &#8211; A sysadmin&#8217;s blog</title>
		<link>http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/comment-page-1/#comment-8313</link>
		<dc:creator>Perl+Twitter : Getting @mentions from command line&#160;-&#160;Tech@Sakana &#8211; A sysadmin&#8217;s blog</dc:creator>
		<pubDate>Sun, 24 Jan 2010 09:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=292#comment-8313</guid>
		<description>[...] Now off to integrate this in my Conky layout [...]</description>
		<content:encoded><![CDATA[<p>[...] Now off to integrate this in my Conky layout [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Perl : Using the Finance::Quote module to get your stock prices&#160;-&#160;Tech@Sakana &#8211; A sysadmin&#8217;s blog</title>
		<link>http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/comment-page-1/#comment-8280</link>
		<dc:creator>Perl : Using the Finance::Quote module to get your stock prices&#160;-&#160;Tech@Sakana &#8211; A sysadmin&#8217;s blog</dc:creator>
		<pubDate>Wed, 30 Dec 2009 15:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=292#comment-8280</guid>
		<description>[...] already added it into my conky layout with an execpi directive, and it works like a charm     Bookmark to:                         Tagged [...]</description>
		<content:encoded><![CDATA[<p>[...] already added it into my conky layout with an execpi directive, and it works like a charm     Bookmark to:                         Tagged [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hindumagic</title>
		<link>http://www.sakana.fr/blog/2009/10/11/conky-integrating-rtorrent-downloads-monitoring/comment-page-1/#comment-8257</link>
		<dc:creator>hindumagic</dc:creator>
		<pubDate>Sat, 05 Dec 2009 23:17:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=292#comment-8257</guid>
		<description>Hi, I found your entry very enlightening!

Not being familiar with xmlrpc, conky, rtorrent and perl made this challenging for me to implement (I despise reading perl code - haha).

I ran into trouble with your script as it stands because my rtorrent runs on a different, 64 bit machine.  As such, it has a more recent xmlrpc-c implementation that reports xml types of , which the ubuntu installed version of xmlrpc-c doesn&#039;t have.  I wrestled with compiling and installing a more recent version of xmlrpc-c for ubuntu but wasn&#039;t having much success, but then found out I can just add to Frontier&#039;s scalers in perl so this fixed that problem:
$Frontier::RPC2::scalars{&#039;i8&#039;} = 1;

Additionally, I improved your script by removing the need for Data::Dump.  You can just echo the value back to execbar.  I also added a total up and down rate summary to the top of the bittorrent section and limited the retrieved list of torrents to those that are active.  I also simplified/fixed the conversion of bytes to kB and removed some unnecessary creation of variables.

Here is my modified section of your perl script:
my $uprate = $server-&gt;call(&#039;get_up_rate&#039;);
my $downrate = $server-&gt;call(&#039;get_down_rate&#039;);

my $torrents = $server-&gt;call(&#039;d.multicall&#039;, &quot;active&quot;,
	&quot;d.get_base_filename=&quot;,
	&quot;d.get_bytes_done=&quot;,
	&quot;d.get_size_bytes=&quot;,
	&quot;d.get_down_rate=&quot;);

my @res;
foreach my $d (@$torrents) {
	my $dl_rate = $d-&gt;[3] / 1024;
	my $percent_done = 100 * ($d-&gt;[1] / $d-&gt;[2]);
	push @res,
		sprintf(&quot;%.44s \${alignr}%6.1f kB/s\$alignr\n&quot; . 
			&quot; &quot; x 5 . &quot;%3.2f%%&quot; . &quot;\${goto 70}\${execbar echo %3.0f }&quot;,
			$d-&gt;[0], $dl_rate, $percent_done, $percent_done);
}

printf(&quot;%6.1f kB/s up / %6.1f kB/s down\n&quot;, $uprate / 1024, $downrate / 1024);
print join(&quot;\n\n&quot;, @res), &quot;\n&quot;;

So thanks for pointing me in the right direction!  I think that I have a small problem where it doesn&#039;t seem to pick up that a new torrent has been activated - not sure about that yet.</description>
		<content:encoded><![CDATA[<p>Hi, I found your entry very enlightening!</p>
<p>Not being familiar with xmlrpc, conky, rtorrent and perl made this challenging for me to implement (I despise reading perl code &#8211; haha).</p>
<p>I ran into trouble with your script as it stands because my rtorrent runs on a different, 64 bit machine.  As such, it has a more recent xmlrpc-c implementation that reports xml types of , which the ubuntu installed version of xmlrpc-c doesn&#8217;t have.  I wrestled with compiling and installing a more recent version of xmlrpc-c for ubuntu but wasn&#8217;t having much success, but then found out I can just add to Frontier&#8217;s scalers in perl so this fixed that problem:<br />
$Frontier::RPC2::scalars{&#8216;i8&#8242;} = 1;</p>
<p>Additionally, I improved your script by removing the need for Data::Dump.  You can just echo the value back to execbar.  I also added a total up and down rate summary to the top of the bittorrent section and limited the retrieved list of torrents to those that are active.  I also simplified/fixed the conversion of bytes to kB and removed some unnecessary creation of variables.</p>
<p>Here is my modified section of your perl script:<br />
my $uprate = $server-&gt;call(&#8216;get_up_rate&#8217;);<br />
my $downrate = $server-&gt;call(&#8216;get_down_rate&#8217;);</p>
<p>my $torrents = $server-&gt;call(&#8216;d.multicall&#8217;, &#8220;active&#8221;,<br />
	&#8220;d.get_base_filename=&#8221;,<br />
	&#8220;d.get_bytes_done=&#8221;,<br />
	&#8220;d.get_size_bytes=&#8221;,<br />
	&#8220;d.get_down_rate=&#8221;);</p>
<p>my @res;<br />
foreach my $d (@$torrents) {<br />
	my $dl_rate = $d-&gt;[3] / 1024;<br />
	my $percent_done = 100 * ($d-&gt;[1] / $d-&gt;[2]);<br />
	push @res,<br />
		sprintf(&#8220;%.44s \${alignr}%6.1f kB/s\$alignr\n&#8221; .<br />
			&#8221; &#8221; x 5 . &#8220;%3.2f%%&#8221; . &#8220;\${goto 70}\${execbar echo %3.0f }&#8221;,<br />
			$d-&gt;[0], $dl_rate, $percent_done, $percent_done);<br />
}</p>
<p>printf(&#8220;%6.1f kB/s up / %6.1f kB/s down\n&#8221;, $uprate / 1024, $downrate / 1024);<br />
print join(&#8220;\n\n&#8221;, @res), &#8220;\n&#8221;;</p>
<p>So thanks for pointing me in the right direction!  I think that I have a small problem where it doesn&#8217;t seem to pick up that a new torrent has been activated &#8211; not sure about that yet.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

