<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fetching Android Market Stats with Python, MozRepl, and BeautifulSoup</title>
	<atom:link href="http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/</link>
	<description>In which I write mostly about programming and that sort of thing</description>
	<lastBuildDate>Thu, 12 Aug 2010 23:40:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: craiget</title>
		<link>http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/comment-page-1/#comment-748</link>
		<dc:creator>craiget</dc:creator>
		<pubDate>Sat, 16 Jan 2010 02:51:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.craigethomas.com/blog/?p=65#comment-748</guid>
		<description>Oops.. I may have mangled the script when copying it between blogs. The 2nd profile thing is not strictly necessary. I have two Google accounts, so I am using two profiles here so they don&#039;t stomp on each other. You can probably drop the &quot;-P profile&quot; flag altogether without any problem. There&#039;s more info about setting up a second profile here: &lt;a href=&quot;http://support.mozilla.com/en-US/kb/Managing+profiles&quot; rel=&quot;nofollow&quot;&gt;http://support.mozilla.com/en-US/kb/Managing+profiles&lt;/a&gt;.

There was another typo on that line too - both should be fixed now.</description>
		<content:encoded><![CDATA[<p>Oops.. I may have mangled the script when copying it between blogs. The 2nd profile thing is not strictly necessary. I have two Google accounts, so I am using two profiles here so they don&#8217;t stomp on each other. You can probably drop the &#8220;-P profile&#8221; flag altogether without any problem. There&#8217;s more info about setting up a second profile here: <a href="http://support.mozilla.com/en-US/kb/Managing+profiles" rel="nofollow">http://support.mozilla.com/en-US/kb/Managing+profiles</a>.</p>
<p>There was another typo on that line too &#8211; both should be fixed now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henrik</title>
		<link>http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/comment-page-1/#comment-747</link>
		<dc:creator>Henrik</dc:creator>
		<pubDate>Sat, 16 Jan 2010 01:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.craigethomas.com/blog/?p=65#comment-747</guid>
		<description>Hi there,

You&#039;ll have to excuse me, but I get this:

    os.system(&quot;firefox -no-remote -P %s &amp;&quot; % (profile, url))
NameError: name &#039;profile&#039; is not defined

I don&#039;t think I understand how to handle that profile?

Henrik</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>You&#8217;ll have to excuse me, but I get this:</p>
<p>    os.system(&#8220;firefox -no-remote -P %s &amp;&#8221; % (profile, url))<br />
NameError: name &#8216;profile&#8217; is not defined</p>
<p>I don&#8217;t think I understand how to handle that profile?</p>
<p>Henrik</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will</title>
		<link>http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/comment-page-1/#comment-678</link>
		<dc:creator>Will</dc:creator>
		<pubDate>Wed, 01 Jul 2009 05:53:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.craigethomas.com/blog/?p=65#comment-678</guid>
		<description>The free version of the iMacros Firefox addon doesn&#039;t allow you to scrape webpages so isn&#039;t a choice for some.

MozRepl works or at least it did for an AJAX-heavy website that seemed otherwise impossible to scrape with mechanize. 

There doesn&#039;t seem to be a convenient way to check the &#039;readyState&#039; of a AJAX request so the automation can be flaky - I had several time.sleep&#039;s interspersed in the code.</description>
		<content:encoded><![CDATA[<p>The free version of the iMacros Firefox addon doesn&#8217;t allow you to scrape webpages so isn&#8217;t a choice for some.</p>
<p>MozRepl works or at least it did for an AJAX-heavy website that seemed otherwise impossible to scrape with mechanize. </p>
<p>There doesn&#8217;t seem to be a convenient way to check the &#8216;readyState&#8217; of a AJAX request so the automation can be flaky &#8211; I had several time.sleep&#8217;s interspersed in the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/comment-page-1/#comment-652</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 26 May 2009 20:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.craigethomas.com/blog/?p=65#comment-652</guid>
		<description>nice, but wouldn&#039;t that be easier with the iMacros Firefox addon?</description>
		<content:encoded><![CDATA[<p>nice, but wouldn&#8217;t that be easier with the iMacros Firefox addon?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Grafton</title>
		<link>http://www.craiget.com/2009/04/get-android-market-stats-with-python-mozrepl-and-beautifulsoup/comment-page-1/#comment-649</link>
		<dc:creator>James Grafton</dc:creator>
		<pubDate>Fri, 15 May 2009 14:19:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.craigethomas.com/blog/?p=65#comment-649</guid>
		<description>I have recently been attempting this, using a Python module called mechanize. Thus far I have manged to authenticate with the marketplace server and grab the marketplace webpage contents.....however the actual stats are generated via a JSON post request which I am having difficulty emulating...Feel free to try and get it working:

def gatherMarketplace():
	print &quot;gathering marketplace stats for &quot;+product.product_name
	##Initialise cookies
       	cookiejar = cookielib.LWPCookieJar()
        cookiejar = urllib2.HTTPCookieProcessor(cookiejar)
        opener = urllib2.build_opener(cookiejar)
        urllib2.install_opener(opener)
 
        #Create browser object
	br = Browser()
	br.set_handle_robots(False)
	response = br.open(&quot;https://www.google.com/accounts/ServiceLogin?service=androiddeveloper&amp;passive=true&amp;nui=1&amp;continue=http%3A%2F%2Fmarket.android.com%3A80%2Fpublish&amp;followup=http%3A%2F%2Fmarket.android.com%3A80%2Fpublish&quot;)
	responseBody = response.read()
	form = br.select_form(nr=0)
	br[&quot;Email&quot;] = &quot;gbjgandroid&quot;
        br[&quot;Passwd&quot;] = &quot;********&quot;
	response2 = br.submit()
       #At this point response2.read() will be you android market home page

This is the post request that I am trying to emulate:

5&#124;0&#124;4&#124;http://market.android.com/publish/gwt/&#124;20D26AAE72C63DE79F3EE065E818E545&#124;com.google.wireless.android
.vending.developer.shared.AppEditorService&#124;getFullAssetInfosForUser&#124;1&#124;2&#124;3&#124;4&#124;0&#124;</description>
		<content:encoded><![CDATA[<p>I have recently been attempting this, using a Python module called mechanize. Thus far I have manged to authenticate with the marketplace server and grab the marketplace webpage contents&#8230;..however the actual stats are generated via a JSON post request which I am having difficulty emulating&#8230;Feel free to try and get it working:</p>
<p>def gatherMarketplace():<br />
	print &#8220;gathering marketplace stats for &#8220;+product.product_name<br />
	##Initialise cookies<br />
       	cookiejar = cookielib.LWPCookieJar()<br />
        cookiejar = urllib2.HTTPCookieProcessor(cookiejar)<br />
        opener = urllib2.build_opener(cookiejar)<br />
        urllib2.install_opener(opener)</p>
<p>        #Create browser object<br />
	br = Browser()<br />
	br.set_handle_robots(False)<br />
	response = br.open(&#8220;https://www.google.com/accounts/ServiceLogin?service=androiddeveloper&amp;passive=true&amp;nui=1&amp;continue=http%3A%2F%2Fmarket.android.com%3A80%2Fpublish&amp;followup=http%3A%2F%2Fmarket.android.com%3A80%2Fpublish&#8221;)<br />
	responseBody = response.read()<br />
	form = br.select_form(nr=0)<br />
	br["Email"] = &#8220;gbjgandroid&#8221;<br />
        br["Passwd"] = &#8220;********&#8221;<br />
	response2 = br.submit()<br />
       #At this point response2.read() will be you android market home page</p>
<p>This is the post request that I am trying to emulate:</p>
<p>5|0|4|http://market.android.com/publish/gwt/|20D26AAE72C63DE79F3EE065E818E545|com.google.wireless.android<br />
.vending.developer.shared.AppEditorService|getFullAssetInfosForUser|1|2|3|4|0|</p>
]]></content:encoded>
	</item>
</channel>
</rss>
