<?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>Talk Unafraid &#187; calendar</title>
	<atom:link href="http://www.talkunafraid.co.uk/tag/calendar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.talkunafraid.co.uk</link>
	<description>The (occasionally coherent) ramblings of a geek</description>
	<lastBuildDate>Sat, 07 Jan 2012 22:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>RiCal and Google Calendar</title>
		<link>http://www.talkunafraid.co.uk/2009/07/rical-and-google-calendar/</link>
		<comments>http://www.talkunafraid.co.uk/2009/07/rical-and-google-calendar/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 00:29:52 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Charactr]]></category>
		<category><![CDATA[Code Snippets and Examples]]></category>
		<category><![CDATA[EVE Metrics]]></category>
		<category><![CDATA[MMMetrics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[eve metrics]]></category>
		<category><![CDATA[ical]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=401</guid>
		<description><![CDATA[So, there was a request on Twitter from ChainerCygnus to get Google Calendar support in Charactr, so I went ahead and implemented it. You can now access an iCal feed of skill changes on Charactr on the characters page, and it uses the Charactr API key to authenticate so it works in anything, no need [...]]]></description>
			<content:encoded><![CDATA[<p>So, there was a request on Twitter from <a href="http://twitter.com/chainercygnus/status/2556207281">ChainerCygnus</a> to get Google Calendar support in Charactr, so I went ahead and implemented it. You can now access an iCal feed of skill changes on Charactr on the characters page, and it uses the Charactr API key to authenticate so it works in anything, no need for HTTP Basic authentication support or anything.</p>
<p>Implementing was actually really easy. I grabbed the RiCal gem off Github, threw in the config.gem line in environment.rb, and added this to the characters controller index action:</p>
<div class="geshi no ruby">
<div class="head">respond_to do |format|</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; <span class="kw3">format</span>.<span class="me1">html</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw3">format</span>.<span class="me1">ics</span> <span class="kw1">do</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; rna = <span class="br0">&#91;</span><span class="st0">&#39;(Untrained)&#39;</span>,<span class="st0">&#39;I&#39;</span>,<span class="st0">&#39;II&#39;</span>,<span class="st0">&#39;III&#39;</span>,<span class="st0">&#39;IV&#39;</span>,<span class="st0">&#39;V&#39;</span><span class="br0">&#93;</span> <span class="co1"># Used below for roman numerals</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; cal = RiCal.<span class="me1">Calendar</span> <span class="kw1">do</span> <span class="sy0">|</span>cal<span class="sy0">|</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; cal.<span class="me1">add_x_property</span><span class="br0">&#40;</span><span class="st0">&#39;X-WR-CALNAME&#39;</span>,<span class="st0">&#39;Charactr&#39;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="re1">@characters</span>.<span class="me1">each</span> <span class="kw1">do</span> <span class="sy0">|</span>char<span class="sy0">|</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> char.<span class="me1">skills_in_training</span>.<span class="me1">length</span> <span class="sy0">&amp;</span>gt; <span class="nu0">0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char.<span class="me1">skills_in_training</span>.<span class="me1">each</span> <span class="kw1">do</span> <span class="sy0">|</span>s<span class="sy0">|</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cal.<span class="me1">event</span> <span class="kw1">do</span> <span class="sy0">|</span>e<span class="sy0">|</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span class="me1">summary</span> <span class="st0">&quot;#{char.name} finishes #{s.type.name} #{rna[s.level]}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span class="me1">description</span> <span class="st0">&quot;#{char.name} finishes #{s.type.name} #{rna[s.level]}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span class="me1">dtstart</span> s.<span class="me1">end_time</span><span class="nu0">-10</span>.<span class="me1">minutes</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span class="me1">dtstart</span> s.<span class="me1">end_time</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">end</span><span class="co1"># event</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">end</span> <span class="co1"># skills loop</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">end</span> <span class="co1"># skillintraining &amp;gt; 0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">end</span> <span class="co1"># char loop</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">end</span> <span class="co1"># calendar</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; render <span class="re3">:text</span><span class="sy0">=&amp;gt;</span>cal.<span class="me1">export</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">end</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">end</span></div>
</li>
</ol>
</div>
<p>So as you can see, it&#8217;s a snap. Rails ships with a preconfigured MIME type for the :ics format, so it&#8217;s handled properly by nginx automatically. Still having some issues making Google Calendar accept the feed&#8217;s name as Charactr, mind you, but the rest works flawlessly and is available for all Charactr users right now.</p>
<p>On a side note, we&#8217;ve set up the <a href="http://twitter.com/mmmetrics">@mmmetrics</a> Twitter account as a shared account between all the MMMetrics team; if you&#8217;re having problems with any of the sites and use Twitter that&#8217;s a pretty good port of call. We&#8217;ll also be using that for announcements and so on, so it might make sense to follow if you&#8217;re interested in what we do.</p>
<p>It&#8217;s been a busy day on EVE Metrics 2, so I leave you with a few teaser screenshots. We&#8217;re almost done with the basic market view pages, and it&#8217;s now a matter of implementing the smaller features- market favourites, map features, and the APIs. EM2 won&#8217;t be an instant fullfilment of every feature promised over the past year or so; we&#8217;re taking the development slowly. EM2 at release won&#8217;t be as feature-packed as EM1, but it&#8217;ll work a whole lot better! Once we&#8217;ve gotten it released (hopefully in just under a week) we&#8217;ll be adding features and maintaining the site continuously to get all the features you want implemented without affecting performance.</p>

<a href='http://www.talkunafraid.co.uk/2009/07/rical-and-google-calendar/2009-07-09_1746/' title='Regional Statistics Overview'><img width="150" height="150" src="http://assets.talkunafraid.co.uk/2009/07/2009-07-09_1746-150x150.png" class="attachment-thumbnail" alt="Regional Statistics Overview" title="Regional Statistics Overview" /></a>
<a href='http://www.talkunafraid.co.uk/2009/07/rical-and-google-calendar/2009-07-09_1653/' title='Price History Graphs'><img width="150" height="150" src="http://assets.talkunafraid.co.uk/2009/07/2009-07-09_1653-150x150.png" class="attachment-thumbnail" alt="Price History Graphs" title="Price History Graphs" /></a>
<a href='http://www.talkunafraid.co.uk/2009/07/rical-and-google-calendar/2009-07-09_1923/' title='Order Lists'><img width="150" height="150" src="http://assets.talkunafraid.co.uk/2009/07/2009-07-09_1923-150x150.png" class="attachment-thumbnail" alt="Order Lists" title="Order Lists" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2009/07/rical-and-google-calendar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

