<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dysfunctional Programming</title>
	<atom:link href="http://www.joshmatthews.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joshmatthews.net/blog</link>
	<description>/* You are not expected to understand this */</description>
	<lastBuildDate>Mon, 04 Feb 2013 09:45:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Taking a page from roc&#8217;s book</title>
		<link>http://www.joshmatthews.net/blog/2013/02/taking-a-page-from-rocs-book/</link>
		<comments>http://www.joshmatthews.net/blog/2013/02/taking-a-page-from-rocs-book/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 09:45:28 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=194</guid>
		<description><![CDATA[17cb212dfcd0e69bc28e9fec652acfa4]]></description>
				<content:encoded><![CDATA[<p>17cb212dfcd0e69bc28e9fec652acfa4</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2013/02/taking-a-page-from-rocs-book/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Next steps for Bugs Ahoy: patches desired!</title>
		<link>http://www.joshmatthews.net/blog/2012/12/next-steps-for-bugs-ahoy-patches-desired/</link>
		<comments>http://www.joshmatthews.net/blog/2012/12/next-steps-for-bugs-ahoy-patches-desired/#comments</comments>
		<pubDate>Thu, 13 Dec 2012 02:56:47 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=190</guid>
		<description><![CDATA[Bugs Ahoy is coasting along right now, and that&#8217;s fine. It fills a need, and apparently it does that pretty well from what I hear. However, there is a greater need &#8211; Mozilla needs a task board for all activities, and we need to not be distracted by reinventing yet another system. I&#8217;m kicking off [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.joshmatthews.net/bugsahoy/">Bugs Ahoy</a> is coasting along right now, and that&#8217;s fine. It fills a need, and apparently it does that pretty well from what I hear. However, there is a greater need &#8211; Mozilla needs a task board for all activities, and we need to not be distracted by reinventing yet another system. I&#8217;m kicking off a project to expand the Bugs Ahoy project to fill this need, and I am need lots of help.</p>
<p>Here&#8217;s the plan:</p>
<ul>
<li>The task board will scrape data from an empty github repository&#8217;s issues list</li>
<li>These issues will be tagged in broad, useful ways (marketing, design, writing, mozilla hispano, whatever)</li>
<li>New contributors with skills other than writing code will be able to browse the tasks available and get involved easier and quicker than ever before!</li>
</ul>
<p>The main work that needs to be done falls into two categories:</p>
<ul>
<li>Authenticating with github (please help, my brain just falls apart when I try to read about OAuth)</li>
<li>Creating a page that allows creating new tasks/modifying existing ones through the Github API</li>
</ul>
<p>We want to avoid any need for users of the task board (both task creators and browsers) to ever visit Github; it&#8217;s just serving as a convenient backend to store the data. I&#8217;m snowed under with too many projects right now and can&#8217;t focus on this right now, but I would be thrilled to work with someone (or several someones!) to get it done. This is going to be a very useful tool when it&#8217;s finished, we just need some elbow grease to crank out a prototype. If you have experience with Javascript and/or Python, please get in touch! You can find the source <a href="https://github.com/jdm/bugsahoy">on github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/12/next-steps-for-bugs-ahoy-patches-desired/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Numbers rule the world</title>
		<link>http://www.joshmatthews.net/blog/2012/11/numbers-rule-the-world/</link>
		<comments>http://www.joshmatthews.net/blog/2012/11/numbers-rule-the-world/#comments</comments>
		<pubDate>Fri, 30 Nov 2012 19:34:51 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=181</guid>
		<description><![CDATA[One thing that has become clear in my work as a Firefox coding steward is that we have no idea how healthy our community is. When people ask me how many unpaid contributors we have, I don&#8217;t have an answer I can give them. The corollary to this is that any attempts to change our [...]]]></description>
				<content:encoded><![CDATA[<p>One thing that has become clear in my work as a Firefox <a href="https://wiki.mozilla.org/Stewards">coding steward</a> is that we have no idea how healthy our community is. When people ask me how many unpaid contributors we have, I don&#8217;t have an answer I can give them. The corollary to this is that any attempts to change our contributor engagement processes will be complete shots in the dark, with us fumbling to discover what kind of effect our changes cause. David Eaves underlined this message in the <a href="https://wiki.mozilla.org/Contribute/Workshops/Metrics_for_growth">community building workshop</a> yesterday, so I decided to do something about it.</p>
<p>Measuring the size of a whole community is hard, so I&#8217;m not tackling that problem yet. Instead, I&#8217;ve focused on the problem of making first-time contributions more visible, and measuring the rate of incoming new contributors in a methodical way. I decided to extract the commit data of mozilla-central into a database which I could query in useful ways; in particular I store a table of committers that includes a name, email address, number of commits, date of first commit, and date of last commit. You can see the raw results of my work at <a href="https://github.com/jdm/swagger">my github repository</a>, where I&#8217;m banging away at multiple tools that use this data in different ways.</p>
<p>Tool the first &#8211; the <a href="http://www.joshmatthews.net/swagger/health.html" target="_blank">Firefox coding community health report:</a></p>
<p><a href="http://www.joshmatthews.net/swagger/health.html" target="_blank"><img class="alignnone size-medium wp-image-183" title="Health report screenshot" src="http://www.joshmatthews.net/blog/stuffz/Screenshot-from-2012-11-30-134238-300x228.png" alt="" width="300" height="228" /></a></p>
<p>This measures the number of first patches that are committed in any given month. This graph allows us to see how effective we are at shepherding new contributors through the process of shipping their first change to the code.</p>
<p>Tool the second &#8211; the <a href="http://www.joshmatthews.net/swagger/index.cgi" target="_blank">first-time contributor awareness raiser:</a></p>
<p><a href="http://www.joshmatthews.net/swagger/index.cgi" target="_blank"><img class="alignnone size-medium wp-image-182" title="Awareness-raiser screenshot" src="http://www.joshmatthews.net/blog/stuffz/Screenshot-from-2012-11-30-134201-300x294.png" alt="" width="300" height="294" /></a></p>
<p>This tool lists the contributors whose first patch was committed in a given period of time. With this, we can create reports that will allow us to take actions that celebrate this accomplishment (blog posts, swag, announcements in meetings, submissions for about:credits, etc.). This will allow us to take the burden of these tasks off of the engineers who can&#8217;t see beyond the patch, and place it in the hands of people who have a broader vision of building community effectively.</p>
<p>I&#8217;m not finished yet! I&#8217;m also really interested in measuring how many contributors drop off in a given month &#8211; by combining this with the incoming contributor data, we can get rough data about churn in the community, and compare how many people are leaving vs. how many newcomers we have. There are many more interesting measurements to be taken here, and I&#8217;m excited to be digging into this data. Feel free to join me! The <a href="https://github.com/jdm/swagger">github repo</a> contains the script to create the database from the <a href="https://github.com/mozilla/mozilla-central">git mozilla-central</a> repository, and you&#8217;re welcome to explore the data with me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/11/numbers-rule-the-world/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Help wanted: using the github API with authentication</title>
		<link>http://www.joshmatthews.net/blog/2012/11/help-wanted-using-the-github-api-with-authentication/</link>
		<comments>http://www.joshmatthews.net/blog/2012/11/help-wanted-using-the-github-api-with-authentication/#comments</comments>
		<pubDate>Tue, 27 Nov 2012 20:53:17 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[helpwanted]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=177</guid>
		<description><![CDATA[Bugs Ahoy retrieves issues from Github for certain categories (such as B2G and Test Automation). Unfortunately, I learned recently that unauthenticated API users are now limited to 60 requests an hour, and that means that these categories often end up broken. I really want to fix this by being an authenticated user, but OAuth scares [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.joshmatthews.net/bugsahoy/">Bugs Ahoy</a> retrieves issues from Github for certain categories (such as B2G and Test Automation). Unfortunately, I learned recently that unauthenticated API users are now limited to 60 requests an hour, and that means that these categories often end up broken. I really want to fix this by being an authenticated user, but OAuth scares me. I would dearly appreciate someone fearless to help me get my github authentication ducks in a row so new contributors can see the full range of bugs available to them. Bugs Ahoy is entirely a client-side app written in HTML/CSS/JS, so bear that in mind when volunteering. Thanks in advance!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/11/help-wanted-using-the-github-api-with-authentication/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Private Browsing and You</title>
		<link>http://www.joshmatthews.net/blog/2012/09/private-browsing-and-you/</link>
		<comments>http://www.joshmatthews.net/blog/2012/09/private-browsing-and-you/#comments</comments>
		<pubDate>Wed, 26 Sep 2012 15:50:35 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=174</guid>
		<description><![CDATA[Hello everyone, it&#8217;s your resident Private Browsing developer here! I&#8217;ll state it up front &#8211; the release of 15.0.1 was triggered by code I wrote that broke private browsing mode in significant, privacy-affecting ways. Ehsan and I fixed that for 15, 16, and 17 by backing out the problem code completely, but we&#8217;ve been working [...]]]></description>
				<content:encoded><![CDATA[<p>Hello everyone, it&#8217;s your resident Private Browsing developer here! I&#8217;ll state it up front &#8211; the release of 15.0.1 was triggered by code I wrote that broke private browsing mode in significant, privacy-affecting ways. <a href="http://ehsanakhgari.org/">Ehsan</a> and I fixed that for 15, 16, and 17 by backing out the problem code completely, but we&#8217;ve been working hard to fix it properly in Firefox 18 (currently in Nightly). This means that we want YOUR help to ensure that we haven&#8217;t subtly broken private browsing mode in nightly, and here&#8217;s how you can do that:</p>
<p>Take some time every day to clear your disk cache, then put your browser into private browsing mode. If you want to use it for traditionally-private things, that&#8217;s cool, it just may be slightly more embarrassing to thoroughly report bugs you encounter. What would be very helpful is if you could spend some time using your browser for regular, non-private things, and every so often open up <a href="about:cache">about:cache</a> and look through the entries in your disk cache. If you see <i>any entry</i> that looks like it came from one of the sites you were visiting, file a bug and CC :jdm and :ehsan. In fact, I will even accept comments on this post, or IRC pings, or emails, or whatever &#8211; these are important privacy failures that need to be addressed before FF 18 goes out the door. Do your part to make it unremarkable!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/09/private-browsing-and-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get your project listed in whatcanidoformozilla.org!</title>
		<link>http://www.joshmatthews.net/blog/2012/08/get-your-project-listed-in-whatcanidoformozilla-org/</link>
		<comments>http://www.joshmatthews.net/blog/2012/08/get-your-project-listed-in-whatcanidoformozilla-org/#comments</comments>
		<pubDate>Thu, 09 Aug 2012 18:21:29 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=166</guid>
		<description><![CDATA[Back in June I created the slightly-misnamed What Can I Do For Mozilla tool (misnamed since it only focuses on code that needs writing, ignoring any other useful skills). It took off all over twitter, but I never actually formally announced it. Now, whatcanidoformozilla.org needs your help! I want to fill it with as many [...]]]></description>
				<content:encoded><![CDATA[<p>Back in June I created the slightly-misnamed <a href="http://whatcanidoformozilla.org" title="What Can I Do For Mozilla">What Can I Do For Mozilla</a> tool (misnamed since it only focuses on code that needs writing, ignoring any other useful skills). It took off all over twitter, but I never actually formally announced it. Now, whatcanidoformozilla.org needs your help! I want to fill it with as many projects and teams as I can, since I link an average of 250 people to it every month. Is your project missing from it? Find me and let me know, or (even better), file a <a href="https://github.com/jdm/asknot">pull request</a>. The format for adding a new entry is <i>really simple</i>:&nbsp;&nbsp;</p>
<div class="dean_ch" style="white-space: nowrap;">&lt;li target=&quot;http://www.benmoskowitz.com/?p=527&quot;&gt;Popcorn<br />
&nbsp; &lt;div class=&quot;extra&quot;&gt;create interactive media pages that seamlessly integrate video, audio, and traditional web technologies&lt;/div&gt;<br />
&lt;/li&gt;</div>
<p>All I ask is that you link to a document that has some kind of instruction for how to get involved. That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/08/get-your-project-listed-in-whatcanidoformozilla-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things I want someone to create for me, volume 1</title>
		<link>http://www.joshmatthews.net/blog/2012/04/things-i-want-someone-to-create-for-me-volume-1/</link>
		<comments>http://www.joshmatthews.net/blog/2012/04/things-i-want-someone-to-create-for-me-volume-1/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 16:18:33 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=162</guid>
		<description><![CDATA[A mechanism that automatically expands all collapsed merges in a pushlog view. I don&#8217;t care if it&#8217;s a Firefox extension or modification to the pushloghtml source that adds an expand=1 parameter to the query string; I am tired of manually expanding each one.]]></description>
				<content:encoded><![CDATA[<p>A mechanism that automatically expands all collapsed merges in a <a href="http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?startdate=2012-04-08&#038;enddate=">pushlog view</a>. I don&#8217;t care if it&#8217;s a Firefox extension or modification to the pushloghtml <a href="http://hg.mozilla.org/hgcustom/pushlog/">source</a> that adds an expand=1 parameter to the query string; I am tired of manually expanding each one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/04/things-i-want-someone-to-create-for-me-volume-1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Sometimes I do other things than write code</title>
		<link>http://www.joshmatthews.net/blog/2012/03/sometimes-i-do-other-things-than-write-code/</link>
		<comments>http://www.joshmatthews.net/blog/2012/03/sometimes-i-do-other-things-than-write-code/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 06:52:23 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=156</guid>
		<description><![CDATA[I don&#8217;t always write code, but when I do&#8230; no wait, that&#8217;s not right. Here&#8217;s what I&#8217;ve been up to in the past week: I sing in the an all-male university a capella group called The Water Boys. Our end of term concert is happening on Sunday, and the overall club EOT concert just occurred [...]]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t always write code, but when I do&#8230; no wait, that&#8217;s not right. Here&#8217;s what I&#8217;ve been up to in the past week:</p>
<p>I sing in the an all-male university a capella group called The Water Boys. Our end of term concert is happening on Sunday, and the overall club EOT concert just occurred last weekend:<br />
<iframe width="560" height="315" src="http://www.youtube.com/embed/gajZ_b75KHU" frameborder="0" allowfullscreen></iframe></p>
<p>I also sing in a barbershop quartet called the Bearded Baritones, which doesn&#8217;t allow me to hide in the background nearly as much as the 17 person group does (third from right, if curious):</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/nwk6_v7AYrE?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Having just attended my last class of my university career (assuming exams go well), I have to say that this is one aspect of the past five years that I will miss dearly when I move to Toronto this summer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/03/sometimes-i-do-other-things-than-write-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>smartmake redux: harder, better, faster, stronger</title>
		<link>http://www.joshmatthews.net/blog/2012/01/smartmake-redux-harder-better-faster-stronger/</link>
		<comments>http://www.joshmatthews.net/blog/2012/01/smartmake-redux-harder-better-faster-stronger/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 20:43:21 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=150</guid>
		<description><![CDATA[Do you get frustrated about how long it takes to build Firefox after you&#8217;ve only made a small change to a single file? Have you heard the words &#8220;incremental build&#8221;, or tried to only build one or two directories but can&#8217;t figure out why your changes aren&#8217;t showing up? You are not alone. I released [...]]]></description>
				<content:encoded><![CDATA[<p>Do you get frustrated about how long it takes to build Firefox after you&#8217;ve only made a small change to a single file? Have you heard the words &#8220;incremental build&#8221;, or tried to only build one or two directories but can&#8217;t figure out why your changes aren&#8217;t showing up?</p>
<p>You are not alone.</p>
<p>I released my <a href="http://hg.mozilla.org/users/josh_joshmatthews.net/smartmake">smartmake</a> tool last year to allow people to specify then directories they&#8217;ve changed, and in return the tool would perform a correct incremental build. No hassle, no sweat. The name was deceptive; it was a pretty dumb tool, but it got the job done with a little help from the user. However, there is a rule that any build system tool eventually reimplements the functionality of make, and so I am proud to release <a href="http://hg.mozilla.org/users/josh_joshmatthews.net/smartmake">smartmake v2</a>, which requires less work than ever before to produce correct incremental builds.</p>
<p>Thanks to the hard work of the illustrious Till Schneidereit (till on IRC), smartmake now finds every source file modified since the last time you performed an incremental build, and performs a (mostly) minimal rebuild. It will also complain if it comes across any modified files for which it doesn&#8217;t have any dependency information, and suggest you perform a full build instead.</p>
<p>Go ahead, give it a shot! Tell me (or Till) what goes wrong so that we can fix it. I recommend doing a full build, then making a small change and running <code>smartmake.py '5 minutes ago'</code> to kick it off and get the timestamp caching happening.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/01/smartmake-redux-harder-better-faster-stronger/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Answering questions by looking at code</title>
		<link>http://www.joshmatthews.net/blog/2012/01/answering-questions/</link>
		<comments>http://www.joshmatthews.net/blog/2012/01/answering-questions/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 20:50:11 +0000</pubDate>
		<dc:creator>Josh Matthews</dc:creator>
				<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://www.joshmatthews.net/blog/?p=146</guid>
		<description><![CDATA[A contributor recently asked a question in #introduction that I couldn&#8217;t answer immediately, but I suspected that I could find the answer without too much work. I also decided to write down the steps I took and the reasons I took them, with the intent of creating a worked example of finding answers in the [...]]]></description>
				<content:encoded><![CDATA[<p>A contributor recently asked a question in #introduction that I couldn&#8217;t answer immediately, but I suspected that I could find the answer without too much work. I also decided to write down the steps I took and the reasons I took them, with the intent of creating a worked example of finding answers in the Firefox code.</p>
<p>The question: <b>how do I determine if a given URI pointing to an RSS feed is subscribed as a live bookmark?</b></p>
<p>My first instinct when looking for code I have never touched before is to start with the visible strings in the Firefox interface. In this case, I went to slashdot.org and clicked on the RSS feed button to take me to the RSS feed viewer. Under the options for possible subscriptions, there is the &#8220;Live Bookmarks&#8221; choice. I&#8217;m going to find the code that handles subscribing a live bookmark, which should lead me to the way to find out if a feed is currently subscribed.</p>
<p>So, off to MXR: <a href="http://mxr.mozilla.org/mozilla-central/search?string=Live+Bookmarks&#038;find=&#038;findi=&#038;filter=^[^\0]*%24&#038;hitlimit=&#038;tree=mozilla-central" title="http://mxr.mozilla.org/mozilla-central/search?string=Live+Bookmarks&#038;find=&#038;findi=&#038;filter=^[^\0]*%24&#038;hitlimit=&#038;tree=mozilla-central">http://mxr.mozilla.org/mozilla-central/search?string=Live+Bookmarks&#038;find=&#038;findi=&#038;filter=^[^\0]*%24&#038;hitlimit=&#038;tree=mozilla-central</a></p>
<p>Strings are usually stored in special localized files, where the actual string is referred to by a unique name. In this case, we&#8217;re looking at subscribe.properties, which shows us that some code should be using the name <code>liveBookmarks</code> to show the localized string in the feed viewer window.</p>
<p>Let&#8217;s look that up: <a href="http://mxr.mozilla.org/mozilla-central/search?string=livebookmarks&#038;find=&#038;findi=&#038;filter=^[^\0]*%24&#038;hitlimit=&#038;tree=mozilla-central<br />
">http://mxr.mozilla.org/mozilla-central/search?string=livebookmarks&#038;find=&#038;findi=&#038;filter=^[^\0]*%24&#038;hitlimit=&#038;tree=mozilla-central</a></p>
<p>Out of the results, <code>subscribe.xml</code> sounds like something I want to read: <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/content/subscribe.xml#53">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/content/subscribe.xml#53</a></p>
<p>Unfortunately, that line turns out to be not very interesting. However, let&#8217;s see what we can find for <code>liveBookmarksMenuItem</code>, which sounds like it might be the item for the live bookmarks option in the dropdown: <a href="http://mxr.mozilla.org/mozilla-central/ident?i=liveBookmarksMenuItem">http://mxr.mozilla.org/mozilla-central/ident?i=liveBookmarksMenuItem</a></p>
<p>Let&#8217;s look at FeedWriter.js from the results: <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js</a></p>
<p>Woah, that&#8217;s a lot of code!  Let&#8217;s take a step back &#8211; we care about the subscribing action right now. Going back to subscribe.xml (<a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/content/subscribe.xml">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/content/subscribe.xml</a>), notice that the button is called <code>subscribeButton</code>. That sounds really useful! Let&#8217;s look in feedwriter.js again for that (just a regular ctr+f operation): <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js#859">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js#859</a></p>
<p>Now, let&#8217;s find the function subscribe (ctr+f for <code>subscribe:</code>, as that&#8217;s commonly how member functions are defined in the Firefox source): <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js#1241">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js#1241</a></p>
<p>Reading the source of <code>subscribe()</code>, we come to<br />
<a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js#1293>http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedWriter.js#1293</a>. This is related to the <code>anonid</code> class in <code>subscribe.xml</code> that was saw, so we&#8217;re on the right track!</p>
<p>Ooh, further down, there&#8217;s something called a feed service &#8211; that sounds handy. We can find its definition by looking for <code>addToClientReader</code> (I just clicked the linked name): <a href="http://mxr.mozilla.org/mozilla-central/ident?i=addToClientReader>http://mxr.mozilla.org/mozilla-central/ident?i=addToClientReader</a></p>
<p>We can see the definition of <code>addToClientReader</code> at <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedConverter.js#390">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedConverter.js#390</a>. Let&#8217;s look at what else is defined here &#8211; this seems to be implementing the nsIFeedResultService interface, so we can look up the <code>nsIFeedResultService.idl</code> file in MXR: <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/public/nsIFeedResultService.idl">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/public/nsIFeedResultService.idl</a>.</p>
<p>Unfortunately, the service seems to be dealing with actual feed contents, and it doesn&#8217;t look like there&#8217;s a direct function to help us &#8211; let&#8217;s step back and see how <code>addToClientReader</code> is implemented.</p>
<p><a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedConverter.js#448">http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/FeedConverter.js#448</a> is an important line &#8211; let&#8217;s look at <code>addLiveBookmark</code> (I just clicked the name again): <a href="http://mxr.mozilla.org/mozilla-central/ident?i=addLiveBookmark">http://mxr.mozilla.org/mozilla-central/ident?i=addLiveBookmark</a></p>
<p>Take a look at <a href="http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-places.js#457">http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-places.js#457</a>.  This shows us how a bookmark dialog is created, but not the actual subscription process. However, the important part is line 471, which shows us the type <code>"livemark"</code>. Let&#8217;s search for that string and see what other code uses it: <a href="http://mxr.mozilla.org/mozilla-central/search?string=livemark">http://mxr.mozilla.org/mozilla-central/search?string=livemark</a></p>
<p>Woah! There are a lot of results! Since I&#8217;m not certain what I&#8217;m looking for at this point, I find the best thing to do here is to scan all the results quickly, looking for interesting snippets or filenames before opening any particular file. Partway down, there&#8217;s a file called <code>test_bug636917_isLivemark.js</code> (<a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js</a>) &#8211; that sounds like something interesting. Since it refers to the <code>PlacesUtils.livemarks.isLivemark</code> function, let&#8217;s find the PlacesUtils file: <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/PlacesUtils.jsm">http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/PlacesUtils.jsm</a></p>
<p>Searching for <code>livemarks</code> in this file, we find line 2234 which defines the <code>livemarks</code> object as the <code>nsILivemarkService</code> service. Let&#8217;s look that up!</p>
<p>First the idl definition, to see if this service will be useful: <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsILivemarkService.idl">http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsILivemarkService.idl</a>. There&#8217;s a method called <code>getLivemarkIdForFeedURI</code> (<a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsILivemarkService.idl#107">http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsILivemarkService.idl#107</a>), which looks to be exactly what we want &#8211; it gives us a -1 result for a non-registered feed and another number for a registered one.</p>
<p>So, to sum up &#8211; we have found a service that will take a URI and return a value that can be used to determine whether a given feed is a subscribed livemark, and we have learned that livemarks are the internal name for Live Bookmarks. The only bit remaining now is to get access to this service, but we can either use <code>PlacesUtils.livemarks</code> for that (if we import PlacesUtils.jsm), or just use a normal <code>getService</code> call. These are just details; the hard part of answering the original question is complete!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshmatthews.net/blog/2012/01/answering-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.454 seconds -->
<!-- Cached page served by WP-Cache -->
