<?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/" version="2.0">

<channel>
	<title>Peter Carroll: Software Developer</title>
	
	<link>http://blog.eringal.com</link>
	<description>Like "Ace Ventura: Pet Detective," except not</description>
	<lastBuildDate>Thu, 05 Aug 2010 07:10:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.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" type="application/rss+xml" href="http://feeds.feedburner.com/PeterCarrollSoftwareDeveloper" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="petercarrollsoftwaredeveloper" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Esperanto Support Plugin for Anki</title>
		<link>http://blog.eringal.com/python/esperanto-support-plugin-for-anki/</link>
		<comments>http://blog.eringal.com/python/esperanto-support-plugin-for-anki/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 07:10:29 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[Anki]]></category>
		<category><![CDATA[Esperanto]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=98</guid>
		<description><![CDATA[So I decided to learn Esperanto, which as an avid user of the SRS application Anki, meant I needed to either enter Esperanto&#8217;s special characters (ĉ, ĝ, ĥ, ĵ, ŝ, ŭ) into my flash cards, which can&#8217;t easily be typed with the US International keyboard layout, or I could deal with the ugly &#8220;x method&#8221; [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>So I decided to learn <a href="http://en.lernu.net/">Esperanto</a>, which as an avid user of the <a href="http://en.wikipedia.org/wiki/Spaced_repetition">SRS</a> application <a href="http://ichi2.net/anki/">Anki</a>, meant I needed to either enter Esperanto&#8217;s special characters <em>(ĉ, ĝ, ĥ, ĵ, ŝ, ŭ)</em> into my flash cards, which can&#8217;t easily be typed with the <a href="http://babelhut.com/writing-systems/why-you-should-be-using-the-us-international-keyboard-layout/">US International keyboard layout</a>, or I could deal with the ugly &#8220;x method&#8221; workaround <em>(cx, gx, hx, jx, sx, ux)</em>. At first, I was only creating Esperanto cards from my Linux computers at home, which let me use an Esperanto keyboard layout to type in the special characters. Pretty soon though, I found myself creating cards from my Windows machine at work during breaks. There is no Esperanto keyboard layout in Windows by default, so I tried to install some third party keyboard layouts without success. I eventually came across a program called <a href="http://www.esperanto.mv.ru/Ek/">Ek</a>, which seemed to do the job of letting me type special characters, except in Anki where it would only type &#8220;ĉ&#8221;. So I just dealt with the &#8220;x method&#8221; and was typing words like <em>vojagxas</em> instead of <em>vojaĝas</em>. I don&#8217;t know why, but after a while all the x&#8217;s began to really bother me. I didn&#8217;t want to see <em>mangxi</em> in my flash cards, it just doesn&#8217;t seem as natural as <em>manĝi</em> does. So I did what any other software developer would do&#8230;.</p>
<p>I wrote some code.</p>
<p>Specifically, I wrote a plugin for Anki which converts all those terrible <em>cx</em>, <em>gx</em>, <em>hx</em>, <em>jx</em>, <em>sx</em>, and <em>ux</em> combinations into the aesthetically pleasing <em>ĉ</em>, <em>ĝ</em>, <em>ĥ</em>, <em>ĵ</em>. ŝ. and <em>ŭ</em> characters. Prior to this I&#8217;ve never written a plugin for Anki, and even now I claim no expertise. Anki is written in Python, and so are its plugins. I found a plugin that adds some support for the German language to Anki and used that as a model to build my plugin.</p>
<p>To use the Esperanto plugin, open Anki, go to File -&gt; Download -&gt; Shared Plugin. Type &#8220;esperanto&#8221; into the search box. My plugin is the only one that matches that search, so it should be highlighted already. The plugin is called &#8220;Esperanto Support for Anki&#8221;. Click Ok and it should download and install for you. In your deck, when you want to add a card for Esperanto, make sure the card is using the &#8220;Esperanto&#8221; model rather than &#8220;Basic&#8221; model.</p>
<p>I&#8217;m open to suggestions and feedback, and if you are curious about the code at all, open up your Anki plugins folder and take it a look. The code is right there and it&#8217;s very simple.</p>


<p>No related posts.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=3314JfXmKNU:sll4nkXeRtE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=3314JfXmKNU:sll4nkXeRtE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=3314JfXmKNU:sll4nkXeRtE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=3314JfXmKNU:sll4nkXeRtE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=3314JfXmKNU:sll4nkXeRtE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=3314JfXmKNU:sll4nkXeRtE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=3314JfXmKNU:sll4nkXeRtE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=3314JfXmKNU:sll4nkXeRtE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=3314JfXmKNU:sll4nkXeRtE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=3314JfXmKNU:sll4nkXeRtE:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/python/esperanto-support-plugin-for-anki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foreign Language Audio on Demand at RhinoSpike.com</title>
		<link>http://blog.eringal.com/projects/rhinospike/foreign-language-audio-on-demand-at-rhinospike-com/</link>
		<comments>http://blog.eringal.com/projects/rhinospike/foreign-language-audio-on-demand-at-rhinospike-com/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 05:57:40 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[RhinoSpike]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=88</guid>
		<description><![CDATA[So aside from my day job and my family, I&#8217;ve been keeping myself busy since December working on a project with my friend Thomas that we&#8217;ve released to the public just a few weeks ago. That project is RhinoSpike, a web site where people can submit text in a foreign language to be read aloud [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://rhinospike.com"><img class="alignright" title="RhinoSpike" src="http://rhinospike.com/site_media/static/images/rs_logo_60.png" alt="RhinoSpike" width="330" height="60" /></a>So aside from my day job and my family, I&#8217;ve been keeping myself busy since December working on a project with my friend <a href="http://twitter.com/tummai">Thomas</a> that we&#8217;ve released to the public just a few weeks ago. That project is <a href="http://rhinospike.com/">RhinoSpike</a>, a web site where people can submit text in a foreign language to be read aloud and recorded by native speakers of that language. In return, people can read and record themselves reading texts submitted in their native language for students of that language. It&#8217;s swap meet of mp3 files, only instead of copyrighted music, these mp3 files contain the voice and sound of many languages worldwide! I consider it my small and humble contribution to the goal of bringing peace and goodwill towards men through learning each others language.</p>
<p>The entire venture is a part-time deal for myself and Thomas, because we both have day jobs. So we had to maximize the effect of our efforts by building on a platform that provides all of the basic stuff that just about any website needs these days. That platform for us is <a href="http://pinaxproject.com/">Pinax</a>, which is itself built on top of <a href="http://www.djangoproject.com/">Django</a> in the <a href="http://blog.eringal.com/tags/python/">Python</a> programming language. I can&#8217;t say enough good things about Pinax because it let us focus on what was unique to our site, while Pinax handled user authentication, <a href="http://openid.net/">OpenID</a>, avatars, <a href="http://en.gravatar.com/">Gravatar</a>, social network features like friends and messaging, announcements, administration, error handling, internationalization, and so much more that we actually had to strip out some of the built-in features because we felt it was too much for our site. These features are very modular and allowed us to essentially turn them on and off as if by a switch.</p>
<p>This project has been a great learning experience for me and continues to be so. In just three weeks we have almost 900 users, who mostly have found their way to our site via word of mouth on <a href="http://twitter.com/rhino_spike">Twitter</a> and some <a href="http://www.tofugu.com/2010/04/09/getting-japanese-people-to-record-japanese-audio-for-you-with-rhinospike/">great</a> <a href="http://www.spanish-only.com/2010/04/weekly-newsletter-6-7/">language</a> <a href="http://www.fluentin3months.com/language-hacking-links/">learning</a> <a href="http://www.alljapaneseallthetime.com/blog/ajatt-twitter-tweets-for-week-of-2010-04-03">blogs</a>. These users have been making many suggestions to make RhinoSpike even better, some of which we&#8217;ve already implemented and many more which we plan to do soon.</p>
<p>If you haven&#8217;t done so already, check <a href="http://rhinospike.com/">RhinoSpike</a> out, and tell me what you think! I&#8217;d love to hear it!</p>


<p>No related posts.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=UyC8Y0BWIKA:R1jrmfTn-R4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=UyC8Y0BWIKA:R1jrmfTn-R4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=UyC8Y0BWIKA:R1jrmfTn-R4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=UyC8Y0BWIKA:R1jrmfTn-R4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=UyC8Y0BWIKA:R1jrmfTn-R4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=UyC8Y0BWIKA:R1jrmfTn-R4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=UyC8Y0BWIKA:R1jrmfTn-R4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=UyC8Y0BWIKA:R1jrmfTn-R4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=UyC8Y0BWIKA:R1jrmfTn-R4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=UyC8Y0BWIKA:R1jrmfTn-R4:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/projects/rhinospike/foreign-language-audio-on-demand-at-rhinospike-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Barra de Español 1.2 is now available!</title>
		<link>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/</link>
		<comments>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 18:01:39 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[BarraDeEspañol]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[spanish]]></category>
		<category><![CDATA[toolbar]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=86</guid>
		<description><![CDATA[The newest version of Barra de Español, version 1.2, is now available! See details about what&#8217;s new in this version in my post on Babelhut.com.


Related posts:Update: Barra de Español version 1.1 released!
Barra de Español has been accepted to Mozilla&#8217;s public addon list
Barra de Español: The making of a Firefox extension



Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/' rel='bookmark' title='Permanent Link: Update: Barra de Español version 1.1 released!'>Update: Barra de Español version 1.1 released!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/' rel='bookmark' title='Permanent Link: Barra de Español has been accepted to Mozilla&#8217;s public addon list'>Barra de Español has been accepted to Mozilla&#8217;s public addon list</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The newest version of Barra de Español, version 1.2, is now available! See details about what&#8217;s new in this version in <a href="http://babelhut.com/languages/spanish/barradeespanol/barra-de-espanol-1-2-is-now-available/">my post on Babelhut.com</a>.</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/' rel='bookmark' title='Permanent Link: Update: Barra de Español version 1.1 released!'>Update: Barra de Español version 1.1 released!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/' rel='bookmark' title='Permanent Link: Barra de Español has been accepted to Mozilla&#8217;s public addon list'>Barra de Español has been accepted to Mozilla&#8217;s public addon list</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=NMui5o5qA-Q:wSNNfPuGEFc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=NMui5o5qA-Q:wSNNfPuGEFc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=NMui5o5qA-Q:wSNNfPuGEFc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=NMui5o5qA-Q:wSNNfPuGEFc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=NMui5o5qA-Q:wSNNfPuGEFc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=NMui5o5qA-Q:wSNNfPuGEFc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=NMui5o5qA-Q:wSNNfPuGEFc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=NMui5o5qA-Q:wSNNfPuGEFc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=NMui5o5qA-Q:wSNNfPuGEFc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=NMui5o5qA-Q:wSNNfPuGEFc:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simulating a keypress in Firefox</title>
		<link>http://blog.eringal.com/firefox/simulating-a-keypress-in-firefox/</link>
		<comments>http://blog.eringal.com/firefox/simulating-a-keypress-in-firefox/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 13:28:19 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[BarraDeEspañol]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=81</guid>
		<description><![CDATA[Last night, I was working on Barra de Español and had spent quite a bit of time on Google looking for how to simulate a keypress in Firefox. It&#8217;s as simple as creating an event and dispatching it, though how to do so is not exactly intuitive. I needed to be able to do this [...]


Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last night, I was working on <a href="http://blog.eringal.com/topics/projects/barradeespanol/">Barra de Español</a> and had spent quite a bit of time on Google looking for how to simulate a keypress in Firefox. It&#8217;s as simple as creating an event and dispatching it, though how to do so is not exactly intuitive. I needed to be able to do this because inserting accented characters from Barra de Español was not working in the message body textbox in Gmail and other webmail apps.</p>
<p>The way I inserted the characters before was to find the currently focused element, assume it was a textbox, and modify its value using the selectionStart property to know where the cursor was. Once I learned that the message body textbox could not be found using <em>document.commandDispatcher.focusedElement</em>, (that&#8217;s what &#8220;<em>if(!focused) focused = document.commandDispatcher.focusedWindow.document.activeElement;</em>&#8221; is all about) I found that the element used by Gmail for the message body wasn&#8217;t even a textbox, and didn&#8217;t have a value or selectionStart properties.</p>
<p>So the solution is to create a keypress event and dispatch it, like so:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">insertchar<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ch<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> focused <span style="color: #339933;">=</span> document.<span style="color: #660066;">commandDispatcher</span>.<span style="color: #660066;">focusedElement</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>focused<span style="color: #009900;">&#41;</span> focused <span style="color: #339933;">=</span> document.<span style="color: #660066;">commandDispatcher</span>.<span style="color: #660066;">focusedWindow</span>.<span style="color: #660066;">document</span>.<span style="color: #660066;">activeElement</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> evt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;KeyboardEvent&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; evt.<span style="color: #660066;">initKeyEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;keypress&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span> ch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; focused.<span style="color: #660066;">dispatchEvent</span><span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>One important thing to note is that the parameter ch is not a character value, but an integer containing the character code you want to insert. So, for example, to insert the character &#8216;á&#8217;, ch must be the value 225. To find the values I needed I used the wonderful character lookup tool at <a href="http://leftlogic.com/lounge/articles/entity-lookup/">http://leftlogic.com/lounge/articles/entity-lookup/</a>.</p>
<p><strong>Bonus tip:</strong> If you are developing a Firefox extension and are using a text file in your profile&#8217;s extension directory to point to the folder where your code is located, and you move your code to another folder, you will discover that Firefox won&#8217;t load your extension, even though you edited the text file with the new location. The fix is to find a file in your profile directory called extensions.cache and delete it. This frustrated me for at least an hour last night, and Google failed me on this.</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=n4hpGNxM420:EhTp-frmqiM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=n4hpGNxM420:EhTp-frmqiM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=n4hpGNxM420:EhTp-frmqiM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=n4hpGNxM420:EhTp-frmqiM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=n4hpGNxM420:EhTp-frmqiM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=n4hpGNxM420:EhTp-frmqiM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=n4hpGNxM420:EhTp-frmqiM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=n4hpGNxM420:EhTp-frmqiM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=n4hpGNxM420:EhTp-frmqiM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=n4hpGNxM420:EhTp-frmqiM:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/firefox/simulating-a-keypress-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update on my Android Developer Challenge 2 attempt</title>
		<link>http://blog.eringal.com/android/update-on-my-android-developer-challenge-2-attempt/</link>
		<comments>http://blog.eringal.com/android/update-on-my-android-developer-challenge-2-attempt/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 22:40:41 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[ADC 2]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=74</guid>
		<description><![CDATA[So the deadline for the Android Developer Challenge 2 has come and gone, and I did not submit an entry. It wasn&#8217;t for a lack of trying though. This was entirely a spare time project and I worked on it 3 to 5 days a week for an hour or more at a time. I&#8217;m [...]


Related posts:<ol><li><a href='http://blog.eringal.com/android/my-development-plan-for-the-android-developer-challenge-2/' rel='bookmark' title='Permanent Link: My development plan for the Android Developer Challenge 2'>My development plan for the Android Developer Challenge 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So the deadline for the <a href="http://blog.eringal.com/android/my-development-plan-for-the-android-developer-challenge-2/">Android Developer Challenge 2</a> has come and gone, and I did not submit an entry. It wasn&#8217;t for a lack of trying though. This was entirely a spare time project and I worked on it 3 to 5 days a week for an hour or more at a time. I&#8217;m still not comfortable going into specifics about the project because I think it&#8217;s still a viable project. I do still hope to release it to the public at some point.</p>
<p>I will say that I was able to write one of the major features completely, and nearly completed the second major feature. The main reason I didn&#8217;t complete the second feature is because it required scraping some data from a web site, and that web site made some of the data difficult to parse by putting it into an image. I didn&#8217;t discover this until about 2 nights before the deadline. Without the second feature  I didn&#8217;t feel the application was compelling enough to enter into the contest, which is too bad. I think I will be able to get the data I need from an alternate source, so I will resume development of this app and hopefully release it to the public later.</p>
<p>I didn&#8217;t realize it at the time, but working on this project had increased my stress level quite a bit. I enjoyed working on it, and I&#8217;m beginning to appreciate how the Android SDK works, but the deadline was always in the back of my mind. When I decided to call it off, I felt a quite noticeable relief.  I don&#8217;t think the stress builds as much for deadlines at my day job, but having to focus my spare time on one project to the exclusion of others was too much for me. I think I need to keep my side projects deadline-free from now on.</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/android/my-development-plan-for-the-android-developer-challenge-2/' rel='bookmark' title='Permanent Link: My development plan for the Android Developer Challenge 2'>My development plan for the Android Developer Challenge 2</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=lpfq8Y-dADw:3l1Akw1i-6c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=lpfq8Y-dADw:3l1Akw1i-6c:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=lpfq8Y-dADw:3l1Akw1i-6c:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=lpfq8Y-dADw:3l1Akw1i-6c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=lpfq8Y-dADw:3l1Akw1i-6c:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=lpfq8Y-dADw:3l1Akw1i-6c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=lpfq8Y-dADw:3l1Akw1i-6c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=lpfq8Y-dADw:3l1Akw1i-6c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=lpfq8Y-dADw:3l1Akw1i-6c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=lpfq8Y-dADw:3l1Akw1i-6c:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/android/update-on-my-android-developer-challenge-2-attempt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barra de Español has been accepted to Mozilla’s public addon list</title>
		<link>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/</link>
		<comments>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 17:02:42 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[BarraDeEspañol]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[spanish]]></category>
		<category><![CDATA[toolbar]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=71</guid>
		<description><![CDATA[I got an email today from the Mozilla Add-ons group that my add-on for Firefox, Barra de Español, has been approved to be in the public listing for Firefox add-ons! This means that it&#8217;s no longer listed as &#8220;experimental&#8221; and no longer requires that users check a box in order to install it.
I was a [...]


Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/' rel='bookmark' title='Permanent Link: Update: Barra de Español version 1.1 released!'>Update: Barra de Español version 1.1 released!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/' rel='bookmark' title='Permanent Link: Barra de Español 1.2 is now available!'>Barra de Español 1.2 is now available!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I got an email today from the Mozilla Add-ons group that my add-on for Firefox, <a href="http://addons.mozilla.org/addon/12029">Barra de Español</a>, has been approved to be in the public listing for Firefox add-ons! This means that it&#8217;s no longer listed as &#8220;experimental&#8221; and no longer requires that users check a box in order to install it.</p>
<p>I was a bit surprised by how long this process took. I nominated it when I released version 1.1 on June 7. 83 days later it was accepted, and during those 83 days I had no feedback as to what was going on. A week or two ago I visited an IRC chat room for add-on developers and was told that 2 or 3 months was pretty common. Recently Mozilla released a <a href="https://addons.mozilla.org/en-US/statistics">statistics dashboard</a> that shows how many add-ons get created or updated daily. I&#8217;m not sure how many reviewers Mozilla has, but it makes more sense why it takes as long as it does now that I can see those numbers.</p>
<p>Regardless, I&#8217;m happy my little add-on has been accepted and I definitely have plans to enhance it in the future.</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/' rel='bookmark' title='Permanent Link: Update: Barra de Español version 1.1 released!'>Update: Barra de Español version 1.1 released!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/' rel='bookmark' title='Permanent Link: Barra de Español 1.2 is now available!'>Barra de Español 1.2 is now available!</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=gk3dXX07kAs:qbNsH2fQdac:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=gk3dXX07kAs:qbNsH2fQdac:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=gk3dXX07kAs:qbNsH2fQdac:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=gk3dXX07kAs:qbNsH2fQdac:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=gk3dXX07kAs:qbNsH2fQdac:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=gk3dXX07kAs:qbNsH2fQdac:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=gk3dXX07kAs:qbNsH2fQdac:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=gk3dXX07kAs:qbNsH2fQdac:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=gk3dXX07kAs:qbNsH2fQdac:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=gk3dXX07kAs:qbNsH2fQdac:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My development plan for the Android Developer Challenge 2</title>
		<link>http://blog.eringal.com/android/my-development-plan-for-the-android-developer-challenge-2/</link>
		<comments>http://blog.eringal.com/android/my-development-plan-for-the-android-developer-challenge-2/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 03:45:55 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[ADC 2]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=63</guid>
		<description><![CDATA[I haven&#8217;t posted lately about Barra de Español or the Biblefeed Project because my free time has been split among other projects and I have not been able to return to these two for the moment. Barra de Español is still awaiting approval on addons.mozilla.org to be put in the public section, so I don&#8217;t [...]


Related posts:<ol><li><a href='http://blog.eringal.com/android/update-on-my-android-developer-challenge-2-attempt/' rel='bookmark' title='Permanent Link: Update on my Android Developer Challenge 2 attempt'>Update on my Android Developer Challenge 2 attempt</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t posted lately about <a href="http://blog.eringal.com/topics/projects/barradeespanol/">Barra de Español</a> or the <a href="http://blog.eringal.com/topics/projects/biblefeed/">Biblefeed Project</a> because my free time has been split among other projects and I have not been able to return to these two for the moment. Barra de Español is still awaiting approval on <a href="https://addons.mozilla.org/en-US/firefox/addon/12029/">addons.mozilla.org</a> to be put in the public section, so I don&#8217;t want to make further improvements to it until that happens.</p>
<p>Recently I purchased an <a href="http://en.wikipedia.org/wiki/HTC_Dream">Android phone</a>, and I love it! It&#8217;s everything I wanted a phone to be. It has an excellent web browser, a full QWERTY keyboard, GPS, and it&#8217;s hackable! I decided pretty quickly that I wanted to write an app for it, and as I start looking for the documentation on how to write one, I discover that Google is holding a <a href="http://code.google.com/intl/en-US/android/adc/">developer contest</a>. This discovery changed my approach to developing this app.</p>
<p>I&#8217;m not going to talk about the app I&#8217;m working on, but I did want to share how I intend to work on it, because it&#8217;s a little different than my normal approach to personal projects. Normally I start with a minimal list of features. These are the features that are most important to me. I work on each one a little at time, slowly improving the pieces until they are functional and working well together. Each piece  that I work usually causes me to improve the other pieces of the program until finally they&#8217;re all done at around the same time. At this point the project is probably ugly. I may give it some finishing touches, but not always. The project is for me, so functionality trumps aesthetics.</p>
<p>For this contest I felt that developing an app required a different approach. I made a larger list of features that I felt the app could do that I had not originally planned for, especially features which would take advantage of some of the built-in hardware and software on the Android platform. I then prioritized each feature based on how essential the functionality is to the application, how much the feature took advantage of the platform, and how impressive I thought that the feature could be.</p>
<p>With this prioritized list, I&#8217;m going to develop each feature as a whole, one feature at a time. Each feature must be functionally complete and aesthetically pleasing before I move on to the next feature. The reason for this is because if the entry deadline arrives before all of the features are complete, I can still submit an application which is still functional and polished, even if it has fewer features than planned. With my normal development style I could be stuck with an ugly app where only half of the features work by the time the deadline rolls around.</p>
<p>I don&#8217;t expect that I will be able to complete all of my planned features for this project by the August 31 deadline, but I hope with this plan I will have a decent app to submit. There is a bit of a learning curve that is slowing me down though. Even though it&#8217;s been over five or six years since I&#8217;ve worked with Java, the changes to the language are similar to the changes to C# over the same time period. The real learning curve comes from the Android framework. The <a href="http://developer.android.com/guide/topics/fundamentals.html">activities, intents, content providers, etc.</a> are easy enough to understand but I&#8217;m still dealing with an API that is brand new to me, and will take time to absorb.</p>
<p>Wish me luck!</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/android/update-on-my-android-developer-challenge-2-attempt/' rel='bookmark' title='Permanent Link: Update on my Android Developer Challenge 2 attempt'>Update on my Android Developer Challenge 2 attempt</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=OBq7qlcjOXY:CIZHtTpXNSc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=OBq7qlcjOXY:CIZHtTpXNSc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=OBq7qlcjOXY:CIZHtTpXNSc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=OBq7qlcjOXY:CIZHtTpXNSc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=OBq7qlcjOXY:CIZHtTpXNSc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=OBq7qlcjOXY:CIZHtTpXNSc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=OBq7qlcjOXY:CIZHtTpXNSc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=OBq7qlcjOXY:CIZHtTpXNSc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=OBq7qlcjOXY:CIZHtTpXNSc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=OBq7qlcjOXY:CIZHtTpXNSc:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/android/my-development-plan-for-the-android-developer-challenge-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Update: Barra de Español version 1.1 released!</title>
		<link>http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/</link>
		<comments>http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 21:44:13 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[BarraDeEspañol]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[spanish]]></category>
		<category><![CDATA[toolbar]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=60</guid>
		<description><![CDATA[Just a quick update to announce that Barra de Español version 1.1 has been released. For more details, see my post on babelhut.com about the release.


Related posts:Barra de Español 1.2 is now available!
Barra de Español has been accepted to Mozilla&#8217;s public addon list
Barra de Español: The making of a Firefox extension



Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/' rel='bookmark' title='Permanent Link: Barra de Español 1.2 is now available!'>Barra de Español 1.2 is now available!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/' rel='bookmark' title='Permanent Link: Barra de Español has been accepted to Mozilla&#8217;s public addon list'>Barra de Español has been accepted to Mozilla&#8217;s public addon list</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Just a quick update to announce that Barra de Español version 1.1 has been released. For more details, see <a href="http://babelhut.com/languages/spanish/barradeespanol/update-barra-de-espanol-version-11-has-been-released/">my post on babelhut.com about the release</a>.</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/' rel='bookmark' title='Permanent Link: Barra de Español 1.2 is now available!'>Barra de Español 1.2 is now available!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/' rel='bookmark' title='Permanent Link: Barra de Español has been accepted to Mozilla&#8217;s public addon list'>Barra de Español has been accepted to Mozilla&#8217;s public addon list</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/' rel='bookmark' title='Permanent Link: Barra de Español: The making of a Firefox extension'>Barra de Español: The making of a Firefox extension</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=rmDxF4o_78I:N-9SlOYHXTA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=rmDxF4o_78I:N-9SlOYHXTA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=rmDxF4o_78I:N-9SlOYHXTA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=rmDxF4o_78I:N-9SlOYHXTA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=rmDxF4o_78I:N-9SlOYHXTA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=rmDxF4o_78I:N-9SlOYHXTA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=rmDxF4o_78I:N-9SlOYHXTA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=rmDxF4o_78I:N-9SlOYHXTA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=rmDxF4o_78I:N-9SlOYHXTA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=rmDxF4o_78I:N-9SlOYHXTA:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barra de Español: The making of a Firefox extension</title>
		<link>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/</link>
		<comments>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/#comments</comments>
		<pubDate>Fri, 22 May 2009 14:14:46 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[BarraDeEspañol]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[spanish]]></category>
		<category><![CDATA[toolbar]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=43</guid>
		<description><![CDATA[
I have just released a new Firefox add-on called Barra de Español, a toolbar for those who are studying the Spanish language. It makes it easier to find definitions for words in Spanish or English, it helps you insert special characters that are specific to Spanish into any textbox in Firefox, and it provides links [...]


Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/' rel='bookmark' title='Permanent Link: Barra de Español has been accepted to Mozilla&#8217;s public addon list'>Barra de Español has been accepted to Mozilla&#8217;s public addon list</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/' rel='bookmark' title='Permanent Link: Barra de Español 1.2 is now available!'>Barra de Español 1.2 is now available!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/' rel='bookmark' title='Permanent Link: Update: Barra de Español version 1.1 released!'>Update: Barra de Español version 1.1 released!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-50" title="bde-toolbar" src="http://blog.eringal.com/wp-content/uploads/2009/05/bde-toolbar.png" alt="Barra de Español" width="654" height="56" /></p>
<p>I have just <a href="http://babelhut.com/languages/spanish/barradeespanol/barra-de-espanol-a-new-firefox-toolbar-for-spanish-students/">released a new Firefox add-on</a> called <a href="http://eringal.com/Projects/BarraDeEspa%f1ol">Barra de Español</a>, a toolbar for those who are studying the Spanish language. It makes it easier to find definitions for words in Spanish or English, it helps you insert special characters that are specific to Spanish into any textbox in Firefox, and it provides links to native Spanish websites useful for learning the language. You may <a href="https://addons.mozilla.org/firefox/addon/12029/">install it from addons.mozilla.org</a>.</p>
<p>Jealousy inspired me to create this add-on. A couple of months ago, I saw an <a href="http://www.tofugu.com/2009/03/08/nipponsters-japanese-toolbar/">article on Tofugu.com about a Japanese toolbar</a> and thought to myself, &#8220;Why do the people who study Japanese have all the cool tools? Where is the cool stuff for Spanish students?&#8221; Seriously, I see links to cool Japanese tools all the time, but rarely do I see the same thing for other languages. So rather than letting jealousy slowly consume me like a snake eating a mouse, I did something about it.</p>
<p>Doing something about it did not happen instantly though. With as many years as I&#8217;ve been writing code, I still cannot conjure working applications into being through wishful thinking alone. Also, I&#8217;ve never written an add-on for Firefox before, I did not know what was involved. Searching the tubes provided me with <a href="http://www.borngeek.com/firefox/toolbar-tutorial/">this handy tutorial on creating a Firefox toolbar</a>. This was exactly what I needed, and explained in small steps the process of creating a toolbar.</p>
<p>Firefox add-ons are written using XUL, Javascript, and CSS. As a web developer, I already knew two out of the three. XUL turned out to be pretty simple though. It&#8217;s just an XML-based language used to describe the UI, just like you would use HTML on a web page. Some of the Javascript I wrote did require some googling, because in addition to the standard stuff (DOM, etc) used in Javascript when doing web pages, there are APIs specific to Firefox that you need to use. Overall the process of putting together this add-on was pretty quick and easy.</p>
<p>While I may have skills in art of coding, I lack any skill in the art of&#8230; art. So while I was able to put together a nice, functional toolbar on my own, it was ugly. What it really needed was some decent icons. Instead of taking art lessons, I looked around a bit and I found an excellent set of icons created by <a href="http://www.pinvoke.com/">Yusuke Kamiyamane</a> which were free to use under the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution License 3.0</a>. What a deal! I can use some nice icons for my toolbar for free as long as I give credit to the person who made them? I can&#8217;t beat that.</p>
<p>To my credit, I did create the icons that look like &#8220;á&#8221; and &#8220;Á&#8221;. Even I can select a font and type in an image editor.<img class="alignright size-full wp-image-54" title="Typing can be art, right?" src="http://blog.eringal.com/wp-content/uploads/2009/05/bde-minuscula.png" alt="Typing can be art, right?" width="237" height="245" /></p>
<p>Once I had the toolbar put together and looking nice, I needed a way to distribute it. I can use my website, but that&#8217;s not visible enough. The place to go for Firefox extensions is <a href="https://addons.mozilla.org">addons.mozilla.org</a>. The process to get your add-on on their site is pretty easy. You register as a user, go to their developer tools page and follow the directions to upload your add-on. Your add-on isn&#8217;t publicly listed at this point though. You must first fill out all the required information about your add-on, and categorize it properly. Once you&#8217;ve done that, you can have it moved into the Sandbox, which is where Barra de Español is as I write this. Add-ons in the Sandbox get the &#8220;Experimental&#8221; label that you may have seen on some Firefox extensions. It&#8217;s also a little harder to search for them because you have to specify that you want to include experimental extensions when you search for add-ons.</p>
<p>The next step beyond the Sandbox is to get your add-on publicly listed. In order to do that you must upload some images showing your extension to the addons.mozilla.org site, your add-on must not be considered &#8220;pre-release&#8221;, and you must get some user reviews. Barra de Español meets all three requirements now, so I&#8217;m going to nominate to be moved to public today. When I do that, I need to describe my testing process for the add-on. I tested it by installing it and using it on Firefox 1.5, 2.0, 3.0, and the 3.5 beta on Windows XP, and also on Firefox 3.0 on Linux. Worked like a charm on all of those versions thankfully, since that&#8217;s what I claim to support. From here I&#8217;m not sure how long it will take to be publicly listed. It has to go through some review process that I&#8217;m not familiar with yet. I hope it&#8217;s as easy as the rest of the process has been.</p>
<p>I&#8217;d like to add a special thank you to Ramses of <a href="http://www.spanish-only.com/">spanish-only.com</a> for correcting my Spanish on the Barra de Español homepage. I hope this article was informative, interesting, or both for you. If it wasn&#8217;t, then why did you read it all the way to the bottom?</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-has-been-accepted-to-mozillas-public-addon-list/' rel='bookmark' title='Permanent Link: Barra de Español has been accepted to Mozilla&#8217;s public addon list'>Barra de Español has been accepted to Mozilla&#8217;s public addon list</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-1-2-is-now-available/' rel='bookmark' title='Permanent Link: Barra de Español 1.2 is now available!'>Barra de Español 1.2 is now available!</a></li>
<li><a href='http://blog.eringal.com/projects/barradeespanol/update-barra-de-espanol-version-11-released/' rel='bookmark' title='Permanent Link: Update: Barra de Español version 1.1 released!'>Update: Barra de Español version 1.1 released!</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=bdCAuaOD6R8:X78wQ_lul2Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=bdCAuaOD6R8:X78wQ_lul2Y:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=bdCAuaOD6R8:X78wQ_lul2Y:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=bdCAuaOD6R8:X78wQ_lul2Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=bdCAuaOD6R8:X78wQ_lul2Y:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=bdCAuaOD6R8:X78wQ_lul2Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=bdCAuaOD6R8:X78wQ_lul2Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=bdCAuaOD6R8:X78wQ_lul2Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=bdCAuaOD6R8:X78wQ_lul2Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=bdCAuaOD6R8:X78wQ_lul2Y:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/projects/barradeespanol/barra-de-espanol-the-making-of-a-firefox-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BibleFeed Project: Consuming a SOAP web service</title>
		<link>http://blog.eringal.com/projects/biblefeed/biblefeed-project-consuming-a-soap-web-service/</link>
		<comments>http://blog.eringal.com/projects/biblefeed/biblefeed-project-consuming-a-soap-web-service/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 20:18:16 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Biblefeed]]></category>
		<category><![CDATA[bible]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.eringal.com/?p=28</guid>
		<description><![CDATA[This is the third post in the BibleFeed Project. If you haven&#8217;t already, read the first and second posts.
In my last post I stated the difficulty I was having finding a python library to handle the SOAP web service which I&#8217;ll be using to get the data for this project. I gave up on using [...]


Related posts:<ol><li><a href='http://blog.eringal.com/projects/biblefeed/biblefeed-project-creating-the-models/' rel='bookmark' title='Permanent Link: BibleFeed Project: Creating the models'>BibleFeed Project: Creating the models</a></li>
<li><a href='http://blog.eringal.com/python/the-difficulty-of-consuming-a-net-web-service-using-python/' rel='bookmark' title='Permanent Link: The difficulty of consuming a .NET Web Service using Python'>The difficulty of consuming a .NET Web Service using Python</a></li>
<li><a href='http://blog.eringal.com/projects/biblefeed/introducing-the-biblefeed-project/' rel='bookmark' title='Permanent Link: Introducing the BibleFeed project'>Introducing the BibleFeed project</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is the third post in the BibleFeed Project. If you haven&#8217;t already, read the <a href="http://blog.eringal.com/projects/biblefeed/introducing-the-biblefeed-project/">first</a> and <a href="http://blog.eringal.com/projects/biblefeed/biblefeed-project-creating-the-models/">second</a> posts.</p>
<p>In <a href="http://blog.eringal.com/python/the-difficulty-of-consuming-a-net-web-service-using-python/">my last post</a> I stated the difficulty I was having finding a python library to handle the SOAP web service which I&#8217;ll be using to get the data for this project. I gave up on using a library for SOAP and decided to use <a href="http://www.voidspace.org.uk/python/articles/urllib2.shtml">urllib2</a> to send the SOAP request and retrieve the response, and <a href="http://docs.python.org/library/xml.etree.elementtree.html">ElementTree</a> to parse the response. Both of these are standard libraries in Python 2.5 and higher, so you should not need to install anything extra to use these libraries.</p>
<p><strong>Creating the SOAP request</strong></p>
<p>I decided to take advantage of <a href="http://docs.djangoproject.com/en/dev/topics/templates/">Django&#8217;s template system</a> to create the SOAP requests. The advantages of this approach are that I can easily insert variable data into each SOAP request, I don&#8217;t have to manually build the XML in code using a potentially clumsy API, I&#8217;m not hard-coding the XML in a string, and tweaking the request is as simple as editing any other XML file.</p>
<p>To accomplish this, I created a templates directory under the bible directory (this the directory where models.py lives). I edited settings.py so that Django knows where the template directory is.</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">TEMPLATE_DIRS = <span style="color: black;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Put strings here, like &quot;/home/html/django_templates&quot; or &quot;C:/www/django/templates&quot;.</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Always use forward slashes, even on Windows.</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Don't forget to use absolute paths, not relative paths.</span><br />
&nbsp; &nbsp; <span style="color: #483d8b;">'bible/templates'</span>,<br />
<span style="color: black;">&#41;</span></div></div>
<p>In the templates directory I created a file called soaprequest_listbooks.xml which contains the SOAP request to get the list of books from the web service.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SOAP-ENV:Envelope</span> <span style="color: #000066;">xmlns:ns0</span>=<span style="color: #ff0000;">&quot;http://www.francisshanahan.com/&quot;</span> <span style="color: #000066;">xmlns:SOAP-ENC</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xmlns:SOAP-ENV</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SOAP-ENV:Header</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SOAP-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ns0:ListBooks</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SOAP-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SOAP-ENV:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>You may have noticed that this template doesn&#8217;t use any variables at all. That&#8217;s okay, in the future I will be making this code usuable for all our SOAP requests, so I will need to be able to use template variables in the future.</p>
<p><strong>Sending the SOAP request and reading the response</strong></p>
<p>At this point, I haven&#8217;t written any code that does anything yet. I&#8217;m going to change that now. In the bible directory there is a mostly empty file called views.py.  This file is intended to contain <a href="http://docs.djangoproject.com/en/dev/topics/http/views/#topics-http-views">views</a>, which are methods that produce an HttpResponse based on a given HttpRequest. I created a view called listbooks_view, which will retrieve the list of books of the Bible from the web service, and save these books in my database.</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib2</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">template</span> <span style="color: #ff7700;font-weight:bold;">import</span> Context, loader<br />
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">http</span> <span style="color: #ff7700;font-weight:bold;">import</span> HttpResponse<br />
<span style="color: #ff7700;font-weight:bold;">from</span> bible.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">string</span> <span style="color: #ff7700;font-weight:bold;">import</span> atoi<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">xml</span>.<span style="color: black;">etree</span>.<span style="color: black;">ElementTree</span> <span style="color: #ff7700;font-weight:bold;">as</span> ET<br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> listbooks_view<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Create the SOAP request and send it</span><br />
&nbsp; &nbsp; url = <span style="color: #483d8b;">'http://francisshanahan.com/TheHolyBible.asmx'</span><br />
&nbsp; &nbsp; headers = <span style="color: black;">&#123;</span><span style="color: #483d8b;">'Soapaction'</span> : <span style="color: #483d8b;">'&quot;http://www.francisshanahan.com/ListBooks&quot;'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'Content-Type'</span> : <span style="color: #483d8b;">'text/xml'</span><span style="color: black;">&#125;</span><br />
&nbsp; &nbsp; request_template = loader.<span style="color: black;">get_template</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'soaprequest_listbooks.xml'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; request_context = Context<span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#nothing is needed for this request</span><br />
&nbsp; &nbsp; request_data = request_template.<span style="color: black;">render</span><span style="color: black;">&#40;</span>request_context<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; http_req = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">Request</span><span style="color: black;">&#40;</span>url, request_data, headers<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; http_resp = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>http_req<span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Assuming we got a successful response, parse it and store the results in the database</span><br />
&nbsp; &nbsp; soap_resp = ET.<span style="color: black;">fromstring</span><span style="color: black;">&#40;</span>http_resp.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Lovely path, huh?</span><br />
&nbsp; &nbsp; books_xml = soap_resp.<span style="color: black;">findall</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'{http://schemas.xmlsoap.org/soap/envelope/}Body/{http://www.francisshanahan.com/}ListBooksResponse/{http://www.francisshanahan.com/}ListBooksResult/{urn:schemas-microsoft-com:xml-diffgram-v1}diffgram/NewDataSet/bible_content'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> book_xml <span style="color: #ff7700;font-weight:bold;">in</span> books_xml:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">id</span> = atoi<span style="color: black;">&#40;</span>book_xml.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Book'</span><span style="color: black;">&#41;</span>.<span style="color: black;">text</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> id<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">100</span>: <span style="color: #808080; font-style: italic;"># This webservice returns other stuff numbered 100 and higher that isn't actual bible content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; book = Book<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; book.<span style="color: #008000;">id</span> = <span style="color: #008000;">id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; book.<span style="color: black;">name</span> = book_xml.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'BookTitle'</span><span style="color: black;">&#41;</span>.<span style="color: black;">text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> id<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">40</span>: <span style="color: #808080; font-style: italic;">#The first 39 books are in the Old Testament, the rest are New Testament</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; book.<span style="color: black;">testament</span> = <span style="color: #483d8b;">'O'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; book.<span style="color: black;">testament</span> = <span style="color: #483d8b;">'N'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; book.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span><span style="color: #483d8b;">'Success!'</span><span style="color: black;">&#41;</span></div></div>
<p>The path used to parse the XML in the SOAP response is kind of nasty due to the heavy use of XML namespaces in the SOAP response. In my experience this is pretty common, and is just the nature of dealing with SOAP. To give you an idea of what the XML that I&#8217;m parsing looks like, here&#8217;s a snippet of the SOAP response:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Envelope</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ListBooksResponse</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.francisshanahan.com/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ListBooksResult<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:schema</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;NewDataSet&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:msdata</span>=<span style="color: #ff0000;">&quot;urn:schemas-microsoft-com:xml-msdata&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;NewDataSet&quot;</span> <span style="color: #000066;">msdata:IsDataSet</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">msdata:UseCurrentLocale</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:complexType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:choice</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">maxOccurs</span>=<span style="color: #ff0000;">&quot;unbounded&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bible_content&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:complexType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:sequence<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Book&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:int&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xs:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;BookTitle&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:string&quot;</span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:sequence<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:complexType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:element<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:choice<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:complexType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:element<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xs:schema<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;diffgr:diffgram</span> <span style="color: #000066;">xmlns:msdata</span>=<span style="color: #ff0000;">&quot;urn:schemas-microsoft-com:xml-msdata&quot;</span> <span style="color: #000066;">xmlns:diffgr</span>=<span style="color: #ff0000;">&quot;urn:schemas-microsoft-com:xml-diffgram-v1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;NewDataSet</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bible_content</span> <span style="color: #000066;">diffgr:id</span>=<span style="color: #ff0000;">&quot;bible_content1&quot;</span> <span style="color: #000066;">msdata:rowOrder</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;BookTitle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The First Book of Moses, called Genesis<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/BookTitle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bible_content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bible_content</span> <span style="color: #000066;">diffgr:id</span>=<span style="color: #ff0000;">&quot;bible_content2&quot;</span> <span style="color: #000066;">msdata:rowOrder</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;BookTitle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The Second Book of Moses, Called Exodus<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/BookTitle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bible_content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bible_content</span> <span style="color: #000066;">diffgr:id</span>=<span style="color: #ff0000;">&quot;bible_content3&quot;</span> <span style="color: #000066;">msdata:rowOrder</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>If you&#8217;re following along at home, you may be tempting to run the django test web server and see if the code works. You will be disappointed when you see &#8220;ProgrammingError at /listbooks/ ERROR:  value too long for type character varying(50).&#8221; What this means is that the name field in the Book model is too short. As you can see from the SOAP response above, this webservice uses long names for each of the books of the Bible. Where I initially expected names like &#8220;Matthew&#8221; and &#8220;Corinthians I&#8221;, instead I got names like &#8220;The Gospel According to St. Matthew&#8221; and &#8220;The First Epistle of Paul the Apostle to the Corinthians.&#8221; Thankfully this is easy to fix. I edited models.py so that the name field in the Book model is 120 characters long instead of 50.</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">class</span> Book<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; TESTAMENTS = <span style="color: black;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'O'</span>,<span style="color: #483d8b;">'Old Testament'</span><span style="color: black;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'N'</span>,<span style="color: #483d8b;">'New Testament'</span><span style="color: black;">&#41;</span>,<br />
&nbsp; &nbsp; <span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; name = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">120</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; testament = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">1</span>, choices=TESTAMENTS<span style="color: black;">&#41;</span></div></div>
<p>Next, I need to adjust the database so that the name column for the &#8220;bible_book&#8221; table is 120 characters long. Note that in the snippet below I use PostgreSQL for my database. If you are using MySQL or some other database, the SQL will be slightly different.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ python manage.py dbshell<br />
Password for user postgres:<br />
Welcome to psql 8.3.3, the PostgreSQL interactive terminal.<br />
<br />
Type: &nbsp;\copyright for distribution terms<br />
&nbsp; &nbsp; &nbsp; &nbsp;\h for help with SQL commands<br />
&nbsp; &nbsp; &nbsp; &nbsp;\? for help with psql commands<br />
&nbsp; &nbsp; &nbsp; &nbsp;\g or terminate with semicolon to execute query<br />
&nbsp; &nbsp; &nbsp; &nbsp;\q to quit<br />
<br />
biblefeed=# alter table bible_book alter name type varchar(120);<br />
ALTER TABLE<br />
biblefeed=# \d bible_book<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table &quot;public.bible_book&quot;<br />
&nbsp; Column &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Modifiers<br />
-----------+------------------------+---------------------------------------------------------<br />
&nbsp;id &nbsp; &nbsp; &nbsp; &nbsp;| integer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| not null default nextval('bible_book_id_seq'::regclass)<br />
&nbsp;name &nbsp; &nbsp; &nbsp;| character varying(120) | not null<br />
&nbsp;testament | character varying(1) &nbsp; | not null<br />
Indexes:<br />
&nbsp; &nbsp; &quot;bible_book_pkey&quot; PRIMARY KEY, btree (id)</div></div>
<p>Now, you can run the django test webserver. Open http://localhost:8000/listbooks/ and you should see &#8220;Success!&#8221;</p>
<p>So how do I know this worked? I go back to the database to see what&#8217;s in the &#8220;bible_book&#8221; table.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ python manage.py dbshell<br />
Password for user postgres:<br />
Welcome to psql 8.3.3, the PostgreSQL interactive terminal.<br />
<br />
Type: &nbsp;\copyright for distribution terms<br />
&nbsp; &nbsp; &nbsp; &nbsp;\h for help with SQL commands<br />
&nbsp; &nbsp; &nbsp; &nbsp;\? for help with psql commands<br />
&nbsp; &nbsp; &nbsp; &nbsp;\g or terminate with semicolon to execute query<br />
&nbsp; &nbsp; &nbsp; &nbsp;\q to quit<br />
<br />
biblefeed=# select * from bible_book order by id;<br />
&nbsp;id | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | testament<br />
----+-------------------------------------------------------------+-----------<br />
&nbsp; 1 | The First Book of Moses, called Genesis &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp; 2 | The Second Book of Moses, Called Exodus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp; 3 | The Second Book of Moses, called Leviticus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp; 4 | The Fourth Book of Moses, called Numbers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp; 5 | The Fifth Book of Moses, called Deuteronomy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp; 6 | The Book of Joshua &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp; 7 | The Book of Judges &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp; 8 | The Book of Ruth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp; 9 | The First Book of Samuel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;10 | The Second Book of Samuel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;11 | The First Book of the Kings &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;12 | The Second Book of the Kings &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;13 | The First Book of the Chronicles &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;14 | The Second Book of the Chronicles &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;15 | The Book of Ezra &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;16 | The Book of Nehemiah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;17 | The Book of Esther &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;18 | The Book of Job &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;19 | The Book of Psalms &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;20 | The Proverbs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;21 | Ecclesiastes or, The Preacher &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;22 | The Song of Songs, Which is Solomon's &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;23 | The Book of the Prophet Isaiah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;24 | The Book of the Prophet Jeremiah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;25 | The Lamentations of Jeremiah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;26 | The Book of the Prophet Ezekiel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;27 | The Book of Daniel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;28 | The Book of Hosea &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;29 | The Book of Joel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;30 | The Book of Amos &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;31 | The Book of Obadiah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;32 | The Book of Jonah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;33 | The Book of Micah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;34 | The Book of Nahum &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;35 | The Book of Habakkuk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;36 | The Book of Zephaniah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;37 | The Book of Haggai &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| O<br />
&nbsp;38 | The Book of Zechariah &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;39 | The Book of Malachi &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | O<br />
&nbsp;40 | The Gospel According to St. Matthew &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;41 | The Gospel According to Saint Mark &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;42 | The Gospel According to St. Luke &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;43 | The Gospel According to Saint John &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;44 | The Acts of the Apostles &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;45 | The Epistle of Paul the Apostle to the Romans &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;46 | The First Epistle of Paul the Apostle to the Corinthians &nbsp; &nbsp;| N<br />
&nbsp;47 | The Second Epistle of Paul the Apostle to the Corinthians &nbsp; | N<br />
&nbsp;48 | The Epistle of Paul the Apostle to the Galatians &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;49 | The Epistle of Paul the Apostle to the Ephesians &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;50 | The Epistle of Paul the Apostle to the Philippians &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;51 | The Epistle of Paul the Apostle to the Colossians &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;52 | The First Epistle of Paul to the Thessalonians &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;53 | The Second Epistle of Paul the Apostle to the Thessalonians | N<br />
&nbsp;54 | The First Epistle of Paul the Apostle to Timothy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;55 | The Second Epistle of Paul the Apostle to Timothy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;56 | The Epistle of Paul to Titus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;57 | The Epistle of Paul to Philemon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;58 | The Epistle to the Hebrews &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;59 | The General Epistle of James &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;60 | The First Epistle General of Peter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;61 | The Second Epistle General of Peter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;62 | The First Epistle General of John &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;63 | The Second Epistle of John &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
&nbsp;64 | The Third Epistle of John &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;65 | The General Epistle of Jude &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | N<br />
&nbsp;66 | The Revelation to Saint John &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| N<br />
(66 rows)</div></div>
<p>If you have questions, or if I missed something or just didn&#8217;t cover it enough, then leave a comment.</p>


<p>Related posts:<ol><li><a href='http://blog.eringal.com/projects/biblefeed/biblefeed-project-creating-the-models/' rel='bookmark' title='Permanent Link: BibleFeed Project: Creating the models'>BibleFeed Project: Creating the models</a></li>
<li><a href='http://blog.eringal.com/python/the-difficulty-of-consuming-a-net-web-service-using-python/' rel='bookmark' title='Permanent Link: The difficulty of consuming a .NET Web Service using Python'>The difficulty of consuming a .NET Web Service using Python</a></li>
<li><a href='http://blog.eringal.com/projects/biblefeed/introducing-the-biblefeed-project/' rel='bookmark' title='Permanent Link: Introducing the BibleFeed project'>Introducing the BibleFeed project</a></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=HNe9STAHwYM:0FDc1Frr4q0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=HNe9STAHwYM:0FDc1Frr4q0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=HNe9STAHwYM:0FDc1Frr4q0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=HNe9STAHwYM:0FDc1Frr4q0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=HNe9STAHwYM:0FDc1Frr4q0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=HNe9STAHwYM:0FDc1Frr4q0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=HNe9STAHwYM:0FDc1Frr4q0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=HNe9STAHwYM:0FDc1Frr4q0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?a=HNe9STAHwYM:0FDc1Frr4q0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/PeterCarrollSoftwareDeveloper?i=HNe9STAHwYM:0FDc1Frr4q0:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.eringal.com/projects/biblefeed/biblefeed-project-consuming-a-soap-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
