<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://www.halotis.com/wp-atom.php">
	<title type="text">HalOtis Marketing</title>
	<subtitle type="text">Entrepreneurship in the 21st Centruy</subtitle>

	<updated>2010-02-16T02:25:28Z</updated>
	<generator uri="http://wordpress.org/" version="2.9.1">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://www.halotis.com" />
	<id>http://www.halotis.com/feed/atom/</id>
	

			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/HalotisBlog" /><feedburner:info uri="halotisblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Simple Web Deployment With Mercurial And Fabric]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/fiMMNSIIL-4/" />
		<id>http://www.halotis.com/2010/02/15/simple-web-deployment-with-mercurial-and-fabric/</id>
		<updated>2010-02-16T02:25:28Z</updated>
		<published>2010-02-16T02:24:23Z</published>
		<category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="Software" />		<summary type="html"><![CDATA[I have been doing a lot of web development work lately.  Mostly learning about how different people create their workflows and manage local development, testing, staging, and production deployment of code.
In the past I have used Apache Ant for deploying Java applications.  It is a bit cumbersome.  Apache Ant uses XML config [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/08/26/my-python-ftp-deploy-script/' rel='bookmark' title='Permanent Link: My Python FTP Deploy Script'>My Python FTP Deploy Script</a></li>
<li><a href='http://www.halotis.com/2009/08/16/finding-inlink-information-from-yahoo-in-python/' rel='bookmark' title='Permanent Link: Finding inlink information from Yahoo! in Python'>Finding inlink information from Yahoo! in Python</a></li>
<li><a href='http://www.halotis.com/2009/08/12/scrape-yahoo-search-results-page/' rel='bookmark' title='Permanent Link: Scrape Yahoo Search Results Page'>Scrape Yahoo Search Results Page</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2010/02/15/simple-web-deployment-with-mercurial-and-fabric/">&lt;p&gt;I have been doing a lot of web development work lately.  Mostly learning about how different people create their workflows and manage local development, testing, staging, and production deployment of code.&lt;/p&gt;
&lt;p&gt;In the past I have used Apache Ant for deploying Java applications.  It is a bit cumbersome.  Apache Ant uses XML config files which are kind of limiting once you try to do something non-standard and can sometimes require writing special Java code to create new directives.  The resulting XML is not always easy to read.&lt;/p&gt;
&lt;p&gt;For the last few days I have been using Fabric to write a few simple deploy scripts and I think this is a much nicer way of doing it.  You get the full power of Python but a very simple syntax and easy command line usage.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a very simple deploy script that I am using to deploy some static files to my web server.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; fabric.&lt;span style="color: black;"&gt;api&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #808080; font-style: italic;"&gt;#Fabric 0.9.0 compatible&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# usages: $ fab prod deploy&lt;/span&gt;
&amp;nbsp;
REMOTE_HG_PATH = &lt;span style="color: #483d8b;"&gt;'/home/halotis/bin/hg'&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; prod&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;Set the target to production.&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    env.&lt;span style="color: #dc143c;"&gt;user&lt;/span&gt; = &lt;span style="color: #483d8b;"&gt;'USERNAME'&lt;/span&gt;
    env.&lt;span style="color: black;"&gt;hosts&lt;/span&gt; = &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'USERNAME.webfactional.com'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
    env.&lt;span style="color: black;"&gt;remote_app_dir&lt;/span&gt; = &lt;span style="color: #483d8b;"&gt;'webapps/APPLICATION'&lt;/span&gt;
    env.&lt;span style="color: black;"&gt;remote_push_dest&lt;/span&gt; = &lt;span style="color: #483d8b;"&gt;'ssh://USERNAME@USERNAME.webfactional.com/%s'&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; env.&lt;span style="color: black;"&gt;remote_app_dir&lt;/span&gt;
    env.&lt;span style="color: black;"&gt;tag&lt;/span&gt; = &lt;span style="color: #483d8b;"&gt;'production'&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; deploy&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;Deploy the site.
&amp;nbsp;
    This will tag the repository, and push changes to the remote location.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    require&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'hosts'&lt;/span&gt;, provided_by=&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;prod, &lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    require&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'remote_app_dir'&lt;/span&gt;, provided_by=&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;prod, &lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    require&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'remote_push_dest'&lt;/span&gt;, provided_by=&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;prod, &lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    require&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'tag'&lt;/span&gt;, provided_by=&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;prod, &lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    local&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;hg tag --force %s&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; env.&lt;span style="color: black;"&gt;tag&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    local&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;hg push %s --remotecmd %s&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;env.&lt;span style="color: black;"&gt;remote_push_dest&lt;/span&gt;, REMOTE_HG_PATH&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    run&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;cd %s; hg update -C %s&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;env.&lt;span style="color: black;"&gt;remote_app_dir&lt;/span&gt;, env.&lt;span style="color: black;"&gt;tag&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For this to work though you need to have some things set up.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Need SSH access to the remote server&lt;/li&gt;
&lt;li&gt;Mercurial (hg) must be installed on the remote server, and development&lt;/li&gt;
&lt;li&gt;Need to bootstrap the remote repository &amp;#8211; FTP the .hg folder to the destination location&lt;/li&gt;
&lt;li&gt;Install Fabric on local development machine &amp;#8211; &lt;i&gt;$ pip install fabric&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Find out more about &lt;a href="http://docs.fabfile.org/0.9.0/"&gt;Fabric&lt;/a&gt; from the official site.
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/26/my-python-ftp-deploy-script/' rel='bookmark' title='Permanent Link: My Python FTP Deploy Script'&gt;My Python FTP Deploy Script&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/16/finding-inlink-information-from-yahoo-in-python/' rel='bookmark' title='Permanent Link: Finding inlink information from Yahoo! in Python'&gt;Finding inlink information from Yahoo! in Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/12/scrape-yahoo-search-results-page/' rel='bookmark' title='Permanent Link: Scrape Yahoo Search Results Page'&gt;Scrape Yahoo Search Results Page&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FAtzZy36vkihJWnxjjr583bfuzk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FAtzZy36vkihJWnxjjr583bfuzk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FAtzZy36vkihJWnxjjr583bfuzk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FAtzZy36vkihJWnxjjr583bfuzk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=fiMMNSIIL-4:QVPoldPezRA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=fiMMNSIIL-4:QVPoldPezRA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=fiMMNSIIL-4:QVPoldPezRA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=fiMMNSIIL-4:QVPoldPezRA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=fiMMNSIIL-4:QVPoldPezRA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=fiMMNSIIL-4:QVPoldPezRA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=fiMMNSIIL-4:QVPoldPezRA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=fiMMNSIIL-4:QVPoldPezRA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=fiMMNSIIL-4:QVPoldPezRA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/fiMMNSIIL-4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2010/02/15/simple-web-deployment-with-mercurial-and-fabric/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2010/02/15/simple-web-deployment-with-mercurial-and-fabric/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://www.halotis.com/2010/02/15/simple-web-deployment-with-mercurial-and-fabric/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Dynamic DNS With Your Own Domain Name And Webfaction]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/zSAXBpj3Ucc/" />
		<id>http://www.halotis.com/?p=805</id>
		<updated>2010-02-14T19:00:53Z</updated>
		<published>2010-02-14T19:00:53Z</published>
		<category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" />		<summary type="html"><![CDATA[I have been moving more of my websites hosting over to my Webfaction account.  It has been a good experience overall and the service there is much more powerful than what I get with my GoDaddy hosting account.
Yesterday I found in the support forums a nice little script that allows me to use one [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/09/09/amazon-browsenode-browser/' rel='bookmark' title='Permanent Link: Amazon BrowseNode Browser'>Amazon BrowseNode Browser</a></li>
<li><a href='http://www.halotis.com/2009/08/17/amazon-product-advertising-api-from-python/' rel='bookmark' title='Permanent Link: Amazon Product Advertising API From Python'>Amazon Product Advertising API From Python</a></li>
<li><a href='http://www.halotis.com/2009/08/06/automatically-respond-to-twitter-messages/' rel='bookmark' title='Permanent Link: Automatically Respond to Twitter Messages'>Automatically Respond to Twitter Messages</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2010/02/14/dynamic-dns-with-your-own-domain-name-and-webfaction/">&lt;p&gt;I have been moving more of my websites hosting over to my &lt;a href="http://www.halotis.com/go/webfaction"&gt;Webfaction&lt;/a&gt; account.  It has been a good experience overall and the service there is much more powerful than what I get with my GoDaddy hosting account.&lt;/p&gt;
&lt;p&gt;Yesterday I found in the support forums a nice little script that allows me to use one of my domain names (or subdomain) and re-direct the DNS settings to my local computer.  This way I can remotely connect to my home computer with SSH/HTTP/FTP etc. using a url that I will remember.&lt;/p&gt;
&lt;p&gt;This is going to be useful as I am writing some Python Django web applications.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s the script:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;urllib2&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;xmlrpclib&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;os&lt;/span&gt;
&amp;nbsp;
currentip = &lt;span style="color: #dc143c;"&gt;urllib2&lt;/span&gt;.&lt;span style="color: black;"&gt;urlopen&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'http://www.whatismyip.org'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;not&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;os&lt;/span&gt;.&lt;span style="color: black;"&gt;path&lt;/span&gt;.&lt;span style="color: black;"&gt;isfile&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'lastip'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    f = &lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'lastip'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'w'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    f.&lt;span style="color: black;"&gt;close&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;with&lt;/span&gt; &lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'lastip'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'r'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;as&lt;/span&gt; f:
    lastip = f.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; lastip &lt;span style="color: #66cc66;"&gt;!&lt;/span&gt;= currentip:
    server = &lt;span style="color: #dc143c;"&gt;xmlrpclib&lt;/span&gt;.&lt;span style="color: black;"&gt;ServerProxy&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'https://api.webfaction.com/'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    session_id, account = server.&lt;span style="color: black;"&gt;login&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'USERNAME'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'PASSWORD'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    server.&lt;span style="color: black;"&gt;delete_dns_override&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;session_id, &lt;span style="color: #483d8b;"&gt;'YOURDOMAIN.com'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    server.&lt;span style="color: black;"&gt;create_dns_override&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;session_id, &lt;span style="color: #483d8b;"&gt;'YOURDOMAIN.com'&lt;/span&gt;, currentip, &lt;span style="color: #483d8b;"&gt;''&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;''&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;''&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;''&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;with&lt;/span&gt; &lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'lastip'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'w'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;as&lt;/span&gt; f:
        f.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;currentip&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'IP updated to %s'&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; currentip&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;else&lt;/span&gt;:
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'IP not updated'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once this is run, I can update my router settings to forward the appropriate services to my computer and give the DNS servers enough time to propagate the new entry.&lt;/p&gt;
&lt;p&gt;I can now connect to my Home computer using my own domain name.  Pretty cool.
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/09/amazon-browsenode-browser/' rel='bookmark' title='Permanent Link: Amazon BrowseNode Browser'&gt;Amazon BrowseNode Browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/17/amazon-product-advertising-api-from-python/' rel='bookmark' title='Permanent Link: Amazon Product Advertising API From Python'&gt;Amazon Product Advertising API From Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/06/automatically-respond-to-twitter-messages/' rel='bookmark' title='Permanent Link: Automatically Respond to Twitter Messages'&gt;Automatically Respond to Twitter Messages&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yzjfWE1YlhvHGxHpBAwKVJpkJqM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yzjfWE1YlhvHGxHpBAwKVJpkJqM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yzjfWE1YlhvHGxHpBAwKVJpkJqM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yzjfWE1YlhvHGxHpBAwKVJpkJqM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=zSAXBpj3Ucc:-9BF6XcCjm4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=zSAXBpj3Ucc:-9BF6XcCjm4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=zSAXBpj3Ucc:-9BF6XcCjm4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=zSAXBpj3Ucc:-9BF6XcCjm4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=zSAXBpj3Ucc:-9BF6XcCjm4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=zSAXBpj3Ucc:-9BF6XcCjm4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=zSAXBpj3Ucc:-9BF6XcCjm4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=zSAXBpj3Ucc:-9BF6XcCjm4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=zSAXBpj3Ucc:-9BF6XcCjm4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/zSAXBpj3Ucc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2010/02/14/dynamic-dns-with-your-own-domain-name-and-webfaction/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2010/02/14/dynamic-dns-with-your-own-domain-name-and-webfaction/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://www.halotis.com/2010/02/14/dynamic-dns-with-your-own-domain-name-and-webfaction/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Reading and Writing Adwords Editor CSV files in Python]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/OxMarNBmrJ8/" />
		<id>http://www.halotis.com/?p=801</id>
		<updated>2009-11-06T21:36:57Z</updated>
		<published>2009-11-06T21:36:57Z</published>
		<category scheme="http://www.halotis.com" term="Business" /><category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="Software" /><category scheme="http://www.halotis.com" term="ppc" /><category scheme="http://www.halotis.com" term="adwords editor" /><category scheme="http://www.halotis.com" term="csv" /><category scheme="http://www.halotis.com" term="google" />		<summary type="html"><![CDATA[I have been hard at work testing out different approaches to Adwords.Â  One of the keys is that I&#8217;m scripting up a lot of the management of campaigns, ad groups, keywords, and ads.Â  The Adwords API could be used but there&#8217;s an expense to using it which would be a significant expense for the size [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/' rel='bookmark' title='Permanent Link: A Week of Adwords Testing &#8211; Recap'>A Week of Adwords Testing &#8211; Recap</a></li>
<li><a href='http://www.halotis.com/2009/07/20/translating-text-using-google-translate-and-python/' rel='bookmark' title='Permanent Link: Translating Text Using Google Translate and Python'>Translating Text Using Google Translate and Python</a></li>
<li><a href='http://www.halotis.com/2009/08/22/getting-cpa-statistics-from-neverblue/' rel='bookmark' title='Permanent Link: Getting CPA statistics from Neverblue'>Getting CPA statistics from Neverblue</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/">&lt;p&gt;I have been hard at work testing out different approaches to Adwords.Â  One of the keys is that I&amp;#8217;m scripting up a lot of the management of campaigns, ad groups, keywords, and ads.Â  The Adwords API could be used but there&amp;#8217;s an expense to using it which would be a significant expense for the size of my campaigns.Â  So I have been using the Adwords Editor to help manage everything.Â  What makes it excellent is that the tool has import and export to/from csv files.Â  This makes it pretty simple to play with the data.&lt;/p&gt;
&lt;p&gt;To get a file that this script will work with just go to the File menu in Google Adwords Editor and select &amp;#8220;Export to CSV&amp;#8221;Â  You can then select &amp;#8220;Export Selected Campaigns&amp;#8221;.Â  it will write out a csv file.&lt;/p&gt;
&lt;p&gt;This Python script will read those output csv files into a Python data structure which you can then manipulate and write back out to a file.&lt;/p&gt;
&lt;p&gt;With the file modified you can then use the Adwords Editor&amp;#8217;s &amp;#8220;Import CSV&amp;#8221; facility to get your changes back into the Editor and then uploaded to Adwords.&lt;/p&gt;
&lt;p&gt;Having this ability to pull this data into Python, modify it, and then get it back into Adwords means that I can do a lot of really neat things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create massive campaigns with a large number of targeted ads&lt;/li&gt;
&lt;li&gt;Invent bidding strategies that act individually at the keyword level&lt;/li&gt;
&lt;li&gt;automate some of the management&lt;/li&gt;
&lt;li&gt;pull in statistics from CPA networks to calculate ROIs&lt;/li&gt;
&lt;li&gt;convert text ads into image ads&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here&amp;#8217;s the script:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# coding=utf-8&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# (C) 2009 HalOtis Marketing&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# written by Matt Warren&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# http://halotis.com/&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;
read and write exported campaigns from Adwords Editor
&amp;nbsp;
&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;codecs&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;csv&lt;/span&gt;
&amp;nbsp;
FIELDS = &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Campaign Daily Budget'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Languages'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Geo Targeting'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Max CPC'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Max Content CPC'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Placement Max CPC'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Max CPM'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Max CPA'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Keyword'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Keyword Type'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'First Page CPC'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Quality Score'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Headline'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Description Line 1'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Description Line 2'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Display URL'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Destination URL'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Campaign Status'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'AdGroup Status'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Creative Status'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Keyword Status'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Suggested Changes'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Comment'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Impressions'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Clicks'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'CTR'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Avg CPC'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Avg CPM'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Cost'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Avg Position'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Conversions (1-per-click)'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Conversion Rate (1-per-click)'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Cost/Conversion (1-per-click)'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Conversions (many-per-click)'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Conversion Rate (many-per-click)'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'Cost/Conversion (many-per-click)'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; readAdwordsExport&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;filename&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
    campaigns = &lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    f = &lt;span style="color: #dc143c;"&gt;codecs&lt;/span&gt;.&lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;filename, &lt;span style="color: #483d8b;"&gt;'r'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'utf-16'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    reader = &lt;span style="color: #dc143c;"&gt;csv&lt;/span&gt;.&lt;span style="color: black;"&gt;DictReader&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;f, delimiter=&lt;span style="color: #483d8b;"&gt;'&lt;span style="color: #000099; font-weight: bold;"&gt;\t&lt;/span&gt;'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; row &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; reader:
        &lt;span style="color: #808080; font-style: italic;"&gt;#remove empty values from dict&lt;/span&gt;
        row = &lt;span style="color: #008000;"&gt;dict&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;i, j&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; i, j &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; row.&lt;span style="color: black;"&gt;items&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; j&lt;span style="color: #66cc66;"&gt;!&lt;/span&gt;=&lt;span style="color: #483d8b;"&gt;''&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;and&lt;/span&gt; j &lt;span style="color: #66cc66;"&gt;!&lt;/span&gt;= &lt;span style="color: #008000;"&gt;None&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; row.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign Daily Budget'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:  &lt;span style="color: #808080; font-style: italic;"&gt;# campain level settings&lt;/span&gt;
            campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; = &lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; k,v &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; row.&lt;span style="color: black;"&gt;items&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
                campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;k&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; = v
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; row.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Max Content CPC'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:  &lt;span style="color: #808080; font-style: italic;"&gt;# AdGroup level settings&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;not&lt;/span&gt; campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
                campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; = &lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt;
            campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; = row
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; row.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Keyword'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:  &lt;span style="color: #808080; font-style: italic;"&gt;# keyword level settings&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;not&lt;/span&gt; campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'keywords'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
                campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'keywords'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; = &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
            campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'keywords'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;append&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; row.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Headline'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:  &lt;span style="color: #808080; font-style: italic;"&gt;# ad level settings&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;not&lt;/span&gt; campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;has_key&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'ads'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
                campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'ads'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; = &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
            campaigns&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Campaign'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Group'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'ads'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;append&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;row&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; campaigns
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; writeAdwordsExport&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;data, filename&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    f = &lt;span style="color: #dc143c;"&gt;codecs&lt;/span&gt;.&lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;filename, &lt;span style="color: #483d8b;"&gt;'w'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'utf-16'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    writer = &lt;span style="color: #dc143c;"&gt;csv&lt;/span&gt;.&lt;span style="color: black;"&gt;DictWriter&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;f, FIELDS, delimiter=&lt;span style="color: #483d8b;"&gt;'&lt;span style="color: #000099; font-weight: bold;"&gt;\t&lt;/span&gt;'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    writer.&lt;span style="color: black;"&gt;writerow&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;dict&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;zip&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;FIELDS, FIELDS&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; campaign, d &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; data.&lt;span style="color: black;"&gt;items&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
        writer.&lt;span style="color: black;"&gt;writerow&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;dict&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;i,j&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; i, j &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; d.&lt;span style="color: black;"&gt;items&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; i &lt;span style="color: #66cc66;"&gt;!&lt;/span&gt;= &lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; adgroup, ag &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; d&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'Ad Groups'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;items&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
            writer.&lt;span style="color: black;"&gt;writerow&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;dict&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;i,j&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; i, j &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; ag.&lt;span style="color: black;"&gt;items&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; i &lt;span style="color: #66cc66;"&gt;!&lt;/span&gt;= &lt;span style="color: #483d8b;"&gt;'keywords'&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;and&lt;/span&gt; i &lt;span style="color: #66cc66;"&gt;!&lt;/span&gt;= &lt;span style="color: #483d8b;"&gt;'ads'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;keyword&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; ag&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'keywords'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;:
                writer.&lt;span style="color: black;"&gt;writerow&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;keyword&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;            
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; ad &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; ag&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'ads'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;:
                writer.&lt;span style="color: black;"&gt;writerow&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;ad&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    f.&lt;span style="color: black;"&gt;close&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; __name__==&lt;span style="color: #483d8b;"&gt;'__main__'&lt;/span&gt;:
    data = readAdwordsExport&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'export.csv'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'Campaigns:'&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; data.&lt;span style="color: black;"&gt;keys&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    writeAdwordsExport&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;data, &lt;span style="color: #483d8b;"&gt;'output.csv'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This code is available in my public repository: &lt;a href="http://bitbucket.org/halotis/halotis-collection/"&gt;http://bitbucket.org/halotis/halotis-collection/&lt;/a&gt;
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/adwords+editor' rel='tag' target='_self'&gt;adwords editor&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/csv' rel='tag' target='_self'&gt;csv&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/google' rel='tag' target='_self'&gt;google&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/ppc' rel='tag' target='_self'&gt;ppc&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/Python' rel='tag' target='_self'&gt;Python&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/' rel='bookmark' title='Permanent Link: A Week of Adwords Testing &amp;#8211; Recap'&gt;A Week of Adwords Testing &amp;#8211; Recap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/07/20/translating-text-using-google-translate-and-python/' rel='bookmark' title='Permanent Link: Translating Text Using Google Translate and Python'&gt;Translating Text Using Google Translate and Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/22/getting-cpa-statistics-from-neverblue/' rel='bookmark' title='Permanent Link: Getting CPA statistics from Neverblue'&gt;Getting CPA statistics from Neverblue&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WHJAxIKw8cFVbDauDMxG3HH6e3Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WHJAxIKw8cFVbDauDMxG3HH6e3Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WHJAxIKw8cFVbDauDMxG3HH6e3Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WHJAxIKw8cFVbDauDMxG3HH6e3Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=OxMarNBmrJ8:Mw69Fax4PHg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=OxMarNBmrJ8:Mw69Fax4PHg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=OxMarNBmrJ8:Mw69Fax4PHg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=OxMarNBmrJ8:Mw69Fax4PHg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=OxMarNBmrJ8:Mw69Fax4PHg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=OxMarNBmrJ8:Mw69Fax4PHg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=OxMarNBmrJ8:Mw69Fax4PHg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=OxMarNBmrJ8:Mw69Fax4PHg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=OxMarNBmrJ8:Mw69Fax4PHg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/OxMarNBmrJ8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[A Week of Adwords Testing &#8211; Recap]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/2Gg9PYOmR3g/" />
		<id>http://www.halotis.com/?p=796</id>
		<updated>2009-10-16T18:27:04Z</updated>
		<published>2009-10-16T18:27:04Z</published>
		<category scheme="http://www.halotis.com" term="Advice" /><category scheme="http://www.halotis.com" term="Business" /><category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="ppc" /><category scheme="http://www.halotis.com" term="adwords" /><category scheme="http://www.halotis.com" term="adwords api" /><category scheme="http://www.halotis.com" term="content network" /><category scheme="http://www.halotis.com" term="google" /><category scheme="http://www.halotis.com" term="make money" /><category scheme="http://www.halotis.com" term="Python" />		<summary type="html"><![CDATA[Last week I started testing some new concepts on Adwords.  A week has passed and I wanted to recap what has happened and some things that I have noticed and learned so far.
First off, the strategy that I&#8217;m testing is to use the content network exclusively.  As a result some of the standard [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/' rel='bookmark' title='Permanent Link: Reading and Writing Adwords Editor CSV files in Python'>Reading and Writing Adwords Editor CSV files in Python</a></li>
<li><a href='http://www.halotis.com/2009/07/20/translating-text-using-google-translate-and-python/' rel='bookmark' title='Permanent Link: Translating Text Using Google Translate and Python'>Translating Text Using Google Translate and Python</a></li>
<li><a href='http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/' rel='bookmark' title='Permanent Link: SEOCheck: Track Your Google Position Over Time'>SEOCheck: Track Your Google Position Over Time</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/">&lt;p&gt;&lt;a href="http://www.halotis.com/wp-content/uploads/2007/06/googleadwords.gif"&gt;&lt;img class="alignleft size-full wp-image-152" title="Google Adwords Logo" src="http://www.halotis.com/wp-content/uploads/2007/06/googleadwords.gif" alt="Google Adwords Logo" width="143" height="59" /&gt;&lt;/a&gt;Last week I started testing some new concepts on Adwords.  A week has passed and I wanted to recap what has happened and some things that I have noticed and learned so far.&lt;/p&gt;
&lt;p&gt;First off, the strategy that I&amp;#8217;m testing is to use the content network exclusively.  As a result some of the standard SEM practices don&amp;#8217;t really apply.  Click through rates are dramatically lower than on search and it takes some time to get used to 0.1% CTRs.  It takes a lot of impressions to get traffic at those levels.&lt;/p&gt;
&lt;p&gt;Luckily the inventory of ad space with people using Adsense is monstrous and as a result there is plenty opportunities for placements.  So for my limited week of testing I have had about 150,000 impressions on my ads resulting in 80 clicks.&lt;/p&gt;
&lt;p&gt;The other thing to note is that there is comparatively nobody running ads on the content network.  So the competition is almost non-existent.  That makes the price per click very low.  The total ad spend for the first week of testing was less than $10.&lt;/p&gt;
&lt;p&gt;I have run into a number of problems in my testing that I never expected.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It&amp;#8217;s not possible to use the Adwords API to build flash ads with the Display Ad Builder :(&lt;/li&gt;
&lt;li&gt;There seems to be a bug with the Adwords Editor when trying to upload a lot of image ads.&lt;/li&gt;
&lt;li&gt;It takes a long time for image ads to be approved and start running (none of my image ads have been approved yet)&lt;/li&gt;
&lt;li&gt;Paying to use the Adwords API works out to be very expensive for the scale I want to use it at.&lt;/li&gt;
&lt;li&gt;optimizing the price is time consuming since it can take days to see enough results.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With all those problems I&amp;#8217;m still optimistic that I can find a way to scale things up more radically. Â So far in the past week I have written a number of scripts that have helped me build out the campaigns, ad groups and ads. Â It has gotten to the point where I can now upload over 1000 text ads to new campaigns, ad groups and keywords in one evening.&lt;/p&gt;
&lt;p&gt;Since so far the testing has been inconclusive I&amp;#8217;m going to hold off sharing the scripts I have for this strategy. Â If it works out you can count on me recording some videos of the technique and the scripts to help.
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/adwords' rel='tag' target='_self'&gt;adwords&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/adwords+api' rel='tag' target='_self'&gt;adwords api&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/content+network' rel='tag' target='_self'&gt;content network&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/google' rel='tag' target='_self'&gt;google&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/make+money' rel='tag' target='_self'&gt;make money&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/ppc' rel='tag' target='_self'&gt;ppc&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/Python' rel='tag' target='_self'&gt;Python&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/' rel='bookmark' title='Permanent Link: Reading and Writing Adwords Editor CSV files in Python'&gt;Reading and Writing Adwords Editor CSV files in Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/07/20/translating-text-using-google-translate-and-python/' rel='bookmark' title='Permanent Link: Translating Text Using Google Translate and Python'&gt;Translating Text Using Google Translate and Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/' rel='bookmark' title='Permanent Link: SEOCheck: Track Your Google Position Over Time'&gt;SEOCheck: Track Your Google Position Over Time&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fp23TYAL69287csncNgNPNosHCQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fp23TYAL69287csncNgNPNosHCQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fp23TYAL69287csncNgNPNosHCQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fp23TYAL69287csncNgNPNosHCQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=2Gg9PYOmR3g:hcMjWbqQX68:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=2Gg9PYOmR3g:hcMjWbqQX68:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=2Gg9PYOmR3g:hcMjWbqQX68:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=2Gg9PYOmR3g:hcMjWbqQX68:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=2Gg9PYOmR3g:hcMjWbqQX68:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=2Gg9PYOmR3g:hcMjWbqQX68:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=2Gg9PYOmR3g:hcMjWbqQX68:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=2Gg9PYOmR3g:hcMjWbqQX68:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=2Gg9PYOmR3g:hcMjWbqQX68:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/2Gg9PYOmR3g" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Google Adwords &#8211; Another Try]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/B17gcGA3QKA/" />
		<id>http://www.halotis.com/?p=794</id>
		<updated>2009-10-08T16:38:03Z</updated>
		<published>2009-10-08T16:38:03Z</published>
		<category scheme="http://www.halotis.com" term="Business" /><category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Passive Income" /><category scheme="http://www.halotis.com" term="ppc" /><category scheme="http://www.halotis.com" term="google adwords" /><category scheme="http://www.halotis.com" term="scripting" /><category scheme="http://www.halotis.com" term="testing" />		<summary type="html"><![CDATA[Last night I had one of those sleepless nights.  I&#8217;m sure you have had one of these before &#8211; After hearing a great idea your mind starts spinning with the possibilities and there&#8217;s no way you&#8217;ll be able to sleep.  I got excited last night about a new approach to Google Adwords that [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/' rel='bookmark' title='Permanent Link: Reading and Writing Adwords Editor CSV files in Python'>Reading and Writing Adwords Editor CSV files in Python</a></li>
<li><a href='http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/' rel='bookmark' title='Permanent Link: A Week of Adwords Testing &#8211; Recap'>A Week of Adwords Testing &#8211; Recap</a></li>
<li><a href='http://www.halotis.com/2007/09/29/website-income-for-september-344/' rel='bookmark' title='Permanent Link: Website income for September: $3.44'>Website income for September: $3.44</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/10/08/google-adwords-testing/">&lt;p&gt;&lt;img src="http://www.halotis.com/wp-content/uploads/2007/06/googleadwords.gif" alt="Google Adwords Logo" title="Google Adwords Logo" width="143" height="59" class="alignleft size-full wp-image-152" /&gt;Last night I had one of those sleepless nights.  I&amp;#8217;m sure you have had one of these before &amp;#8211; After hearing a great idea your mind starts spinning with the possibilities and there&amp;#8217;s no way you&amp;#8217;ll be able to sleep.  I got excited last night about a new approach to Google Adwords that has just might have a lot of potential.&lt;/p&gt;
&lt;p&gt;Google Adwords has never really proven to be a profitable way to drive traffic for me (though Microsoft Adcenter has).  However several times a year for the past 4 years I have heard a little tip or seen someone use it successfully and have become intrigued enough to dive back in and test the waters again.  Each time my testing has been plagued with failure and I have lost thousands of dollars trying to find a system that works.&lt;/p&gt;
&lt;p&gt;Yesterday I got a tip, something new that I haven&amp;#8217;t yet tried but that sounded promising.  And so over the next few weeks I&amp;#8217;m going to be running some tests.  The problem with the approach I&amp;#8217;m testing is that it requires creating a &lt;strong&gt;MASSIVE &lt;/strong&gt;number of keyword targeted ads &amp;#8211; a total of &lt;strong&gt;over 100,000 ads per niche&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It took me 2.5 hours last night to manually create 400 of the 100,000 ads I need (for the &lt;strong&gt;one &lt;/strong&gt;niche I&amp;#8217;m going to test first).  There&amp;#8217;s no feasible way to create all those ads manually and I&amp;#8217;m not interested in spending yet more money on ebooks or software that claims to make money or magically do the work for me.  So I am going to program some scripts myself to test the techniques.  If it works or doesn&amp;#8217;t work I will let you know, and share the code right here on this blog.&lt;/p&gt;
&lt;p&gt;The testing started last night.  Check back next week for the preliminary results (and maybe a hint about what I&amp;#8217;m doing).
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/google+adwords' rel='tag' target='_self'&gt;google adwords&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/scripting' rel='tag' target='_self'&gt;scripting&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/testing' rel='tag' target='_self'&gt;testing&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/11/06/reading-and-writing-adwords-editor-csv-files-in-python/' rel='bookmark' title='Permanent Link: Reading and Writing Adwords Editor CSV files in Python'&gt;Reading and Writing Adwords Editor CSV files in Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/10/16/a-week-of-adwords-testing-recap/' rel='bookmark' title='Permanent Link: A Week of Adwords Testing &amp;#8211; Recap'&gt;A Week of Adwords Testing &amp;#8211; Recap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2007/09/29/website-income-for-september-344/' rel='bookmark' title='Permanent Link: Website income for September: $3.44'&gt;Website income for September: $3.44&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Jgq6mBZ0bJJBvhTVo2l341mgFn4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jgq6mBZ0bJJBvhTVo2l341mgFn4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Jgq6mBZ0bJJBvhTVo2l341mgFn4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jgq6mBZ0bJJBvhTVo2l341mgFn4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=B17gcGA3QKA:Ztgk9tw5mQ4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=B17gcGA3QKA:Ztgk9tw5mQ4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=B17gcGA3QKA:Ztgk9tw5mQ4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=B17gcGA3QKA:Ztgk9tw5mQ4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=B17gcGA3QKA:Ztgk9tw5mQ4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=B17gcGA3QKA:Ztgk9tw5mQ4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=B17gcGA3QKA:Ztgk9tw5mQ4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=B17gcGA3QKA:Ztgk9tw5mQ4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=B17gcGA3QKA:Ztgk9tw5mQ4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/B17gcGA3QKA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/10/08/google-adwords-testing/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/10/08/google-adwords-testing/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/10/08/google-adwords-testing/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Random User Agent String Python Script]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/x_aybOEMW8M/" />
		<id>http://www.halotis.com/?p=789</id>
		<updated>2009-10-05T18:29:25Z</updated>
		<published>2009-10-05T18:23:24Z</published>
		<category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="Software" /><category scheme="http://www.halotis.com" term="random" /><category scheme="http://www.halotis.com" term="scripting" /><category scheme="http://www.halotis.com" term="user agent" />		<summary type="html"><![CDATA[This is more of a helpful snippit than a useful program but it can sometimes be useful to have some user agent strings handy for web scraping.
Some websites check the user agent string and will filter the results of a request.  It&#8217;s a very simple way to prevent automated scraping.  But it is [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/09/16/python-web-crawler-script/' rel='bookmark' title='Permanent Link: Python Web Crawler Script'>Python Web Crawler Script</a></li>
<li><a href='http://www.halotis.com/2009/07/23/wordpress-blog-posting-robot/' rel='bookmark' title='Permanent Link: Wordpress Blog Posting Robot'>Wordpress Blog Posting Robot</a></li>
<li><a href='http://www.halotis.com/2009/07/21/getting-ezine-article-content-automatically-with-python/' rel='bookmark' title='Permanent Link: Getting Ezine Article Content Automatically with Python'>Getting Ezine Article Content Automatically with Python</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/10/05/random-user-agent-string-python-script/">&lt;p&gt;This is more of a helpful snippit than a useful program but it can sometimes be useful to have some user agent strings handy for web scraping.&lt;/p&gt;
&lt;p&gt;Some websites check the user agent string and will filter the results of a request.  It&amp;#8217;s a very simple way to prevent automated scraping.  But it is very easy to get around.  The user agent can also be checked by spam filters to help detect automated posting. &lt;/p&gt;
&lt;p&gt;A great resource for finding and understanding what user agent strings mean is &lt;a href="http://www.useragentstring.com/"&gt;UserAgentString.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This simple snippit uses a file containing the list of user agent strings that you want to use.  It can very simply source that file and return a random one from the list.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s my source file UserAgents.txt:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="text" style="font-family:monospace;"&gt;Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3
Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)
Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here is the python code that makes getting a random agent very simple:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# -*- coding: utf-8 -*-&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# (C) 2009 HalOtis Marketing&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# written by Matt Warren&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# http://halotis.com/&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;random&lt;/span&gt;
&amp;nbsp;
SOURCE_FILE=&lt;span style="color: #483d8b;"&gt;'UserAgents.txt'&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; get&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    f = &lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;SOURCE_FILE&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    agents = f.&lt;span style="color: black;"&gt;readlines&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;random&lt;/span&gt;.&lt;span style="color: black;"&gt;choice&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;agents&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;.&lt;span style="color: black;"&gt;strip&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; getAll&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    f = &lt;span style="color: #008000;"&gt;open&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;SOURCE_FILE&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    agents = f.&lt;span style="color: black;"&gt;readlines&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;a.&lt;span style="color: black;"&gt;strip&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; a &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; agents&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; __name__==&lt;span style="color: #483d8b;"&gt;'__main__'&lt;/span&gt;:
    agents = getAll&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; agent &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; agents:
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; agent&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can grab the source code for this along with my other scripts from the &lt;a href="http://bitbucket.org/halotis/halotis-collection/overview/"&gt;bitbucket repository&lt;/a&gt;.
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/Python' rel='tag' target='_self'&gt;Python&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/random' rel='tag' target='_self'&gt;random&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/scripting' rel='tag' target='_self'&gt;scripting&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/user+agent' rel='tag' target='_self'&gt;user agent&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/16/python-web-crawler-script/' rel='bookmark' title='Permanent Link: Python Web Crawler Script'&gt;Python Web Crawler Script&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/07/23/wordpress-blog-posting-robot/' rel='bookmark' title='Permanent Link: Wordpress Blog Posting Robot'&gt;Wordpress Blog Posting Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/07/21/getting-ezine-article-content-automatically-with-python/' rel='bookmark' title='Permanent Link: Getting Ezine Article Content Automatically with Python'&gt;Getting Ezine Article Content Automatically with Python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MQqk48q-J0S1DUFzsoyHjgJxYsY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MQqk48q-J0S1DUFzsoyHjgJxYsY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MQqk48q-J0S1DUFzsoyHjgJxYsY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MQqk48q-J0S1DUFzsoyHjgJxYsY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=x_aybOEMW8M:a6CGtyeY57k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=x_aybOEMW8M:a6CGtyeY57k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=x_aybOEMW8M:a6CGtyeY57k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=x_aybOEMW8M:a6CGtyeY57k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=x_aybOEMW8M:a6CGtyeY57k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=x_aybOEMW8M:a6CGtyeY57k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=x_aybOEMW8M:a6CGtyeY57k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=x_aybOEMW8M:a6CGtyeY57k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=x_aybOEMW8M:a6CGtyeY57k:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/x_aybOEMW8M" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/10/05/random-user-agent-string-python-script/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/10/05/random-user-agent-string-python-script/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/10/05/random-user-agent-string-python-script/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Scrape Digg Search Results Python Script]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/FWk1qQ6_sMA/" />
		<id>http://www.halotis.com/?p=780</id>
		<updated>2009-09-30T20:49:11Z</updated>
		<published>2009-09-30T10:40:35Z</published>
		<category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="Software" /><category scheme="http://www.halotis.com" term="beautifulsoup" /><category scheme="http://www.halotis.com" term="digg" /><category scheme="http://www.halotis.com" term="scrape" /><category scheme="http://www.halotis.com" term="script" /><category scheme="http://www.halotis.com" term="search" /><category scheme="http://www.halotis.com" term="web" />		<summary type="html"><![CDATA[Digg is by far the most popular social news site on the internet.  With it&#8217;s simple &#8220;thumbs up&#8221; system the users of the site promote the most interesting and high quality stores and the best of those make it to the front page.  What you end up with is a filtered view of [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/' rel='bookmark' title='Permanent Link: SEOCheck: Track Your Google Position Over Time'>SEOCheck: Track Your Google Position Over Time</a></li>
<li><a href='http://www.halotis.com/2009/09/08/download-images-from-flickr-with-python/' rel='bookmark' title='Permanent Link: Download Images From Flickr With Python'>Download Images From Flickr With Python</a></li>
<li><a href='http://www.halotis.com/2009/08/12/scrape-yahoo-search-results-page/' rel='bookmark' title='Permanent Link: Scrape Yahoo Search Results Page'>Scrape Yahoo Search Results Page</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/">&lt;p&gt;&lt;a href="http://digg.com"&gt;Digg&lt;/a&gt; is by far the most popular social news site on the internet.  With it&amp;#8217;s simple &amp;#8220;thumbs up&amp;#8221; system the users of the site promote the most interesting and high quality stores and the best of those make it to the front page.  What you end up with is a filtered view of the most interesting stuff.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s a great site and one that I visit every day.&lt;/p&gt;
&lt;p&gt;I wanted to write a script that makes use of the search feature on Digg so that I could scrape out and re-purpose the best stuff to use elsewhere.  The first step in writing that larger (top secret) program was to start with a scraper for &lt;a href="http://digg.com/search?s=Search+Digg..."&gt;Digg search&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The short python script I came up with will return the search results from Digg in a standard python data structure so it&amp;#8217;s simple to use.  It &lt;strong&gt;parses out the title, destination, comment count, digg link, digg count, and summary for the top 100 search results&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can perform advanced searches on digg by using a number of different flags:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;+b&lt;/strong&gt; Add to see buried stories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;+p&lt;/strong&gt; Add to see only promoted stories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;+np&lt;/strong&gt; Add to see only unpromoted stories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;+u&lt;/strong&gt; Add to see only upcoming stories&lt;/li&gt;
&lt;li&gt;Put terms in&lt;strong&gt; &amp;#8220;quotes&amp;#8221;&lt;/strong&gt; for an exact search&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-d&lt;/strong&gt; Remove the domain from the search&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;-term&lt;/strong&gt; to exclude a term from your query (e.g. apple -iphone)&lt;/li&gt;
&lt;li&gt;Begin your query with &lt;strong&gt;site:&lt;/strong&gt; to only display stories from that URL.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This script also allows the search results to be sorted:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; DiggSearch &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; digg_search
digg_search&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'twitter'&lt;/span&gt;, sort=&lt;span style="color: #483d8b;"&gt;'newest'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;  &lt;span style="color: #808080; font-style: italic;"&gt;#sort by newest first&lt;/span&gt;
digg_search&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'twitter'&lt;/span&gt;, sort=&lt;span style="color: #483d8b;"&gt;'digg'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;  &lt;span style="color: #808080; font-style: italic;"&gt;# sort by number of diggs&lt;/span&gt;
digg_search&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'twitter -d'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;  &lt;span style="color: #808080; font-style: italic;"&gt;# sort by best match&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here&amp;#8217;s the Python code:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# -*- coding: utf-8 -*-&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# (C) 2009 HalOtis Marketing&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# written by Matt Warren&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# http://halotis.com/&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;urllib&lt;/span&gt;,&lt;span style="color: #dc143c;"&gt;urllib2&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;re&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; BeautifulSoup &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; BeautifulSoup
&amp;nbsp;
USER_AGENT = &lt;span style="color: #483d8b;"&gt;'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; remove_extra_spaces&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;data&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    p = &lt;span style="color: #dc143c;"&gt;re&lt;/span&gt;.&lt;span style="color: #008000;"&gt;compile&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;r&lt;span style="color: #483d8b;"&gt;'&lt;span style="color: #000099; font-weight: bold;"&gt;\s&lt;/span&gt;+'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; p.&lt;span style="color: black;"&gt;sub&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;' '&lt;/span&gt;, data&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; digg_search&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;query, sort=&lt;span style="color: #008000;"&gt;None&lt;/span&gt;, pages=&lt;span style="color: #ff4500;"&gt;10&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;Returns a list of the information I need from a digg query
    sort can be one of [None, 'digg', 'newest']
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&amp;nbsp;
    digg_results = &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; page &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #008000;"&gt;range&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;,pages&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
&amp;nbsp;
        &lt;span style="color: #808080; font-style: italic;"&gt;#create the URL&lt;/span&gt;
        address = &lt;span style="color: #483d8b;"&gt;&amp;quot;http://digg.com/search?s=%s&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;urllib&lt;/span&gt;.&lt;span style="color: black;"&gt;quote_plus&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;query&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; sort:
            address = address + &lt;span style="color: #483d8b;"&gt;'&amp;amp;sort='&lt;/span&gt; + sort
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; page &lt;span style="color: #66cc66;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;:
            address = address + &lt;span style="color: #483d8b;"&gt;'&amp;amp;page='&lt;/span&gt; + &lt;span style="color: #008000;"&gt;str&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;page&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span style="color: #808080; font-style: italic;"&gt;#GET the page&lt;/span&gt;
        request = &lt;span style="color: #dc143c;"&gt;urllib2&lt;/span&gt;.&lt;span style="color: black;"&gt;Request&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;address, &lt;span style="color: #008000;"&gt;None&lt;/span&gt;, &lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'User-Agent'&lt;/span&gt;:USER_AGENT&lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        urlfile = &lt;span style="color: #dc143c;"&gt;urllib2&lt;/span&gt;.&lt;span style="color: black;"&gt;urlopen&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;request&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        page = urlfile.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;200000&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        urlfile.&lt;span style="color: black;"&gt;close&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span style="color: #808080; font-style: italic;"&gt;#scrape it&lt;/span&gt;
        soup = BeautifulSoup&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;page&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        links = soup.&lt;span style="color: black;"&gt;findAll&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'h3'&lt;/span&gt;, &lt;span style="color: #008000;"&gt;id&lt;/span&gt;=&lt;span style="color: #dc143c;"&gt;re&lt;/span&gt;.&lt;span style="color: #008000;"&gt;compile&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;title&lt;span style="color: #000099; font-weight: bold;"&gt;\d&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        comments = soup.&lt;span style="color: black;"&gt;findAll&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'a'&lt;/span&gt;, attrs=&lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'class'&lt;/span&gt;:&lt;span style="color: #483d8b;"&gt;'tool comments'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        diggs = soup.&lt;span style="color: black;"&gt;findAll&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'strong'&lt;/span&gt;, &lt;span style="color: #008000;"&gt;id&lt;/span&gt;=&lt;span style="color: #dc143c;"&gt;re&lt;/span&gt;.&lt;span style="color: #008000;"&gt;compile&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;diggs-strong-&lt;span style="color: #000099; font-weight: bold;"&gt;\d&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        body = soup.&lt;span style="color: black;"&gt;findAll&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'a'&lt;/span&gt;, attrs=&lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'class'&lt;/span&gt;:&lt;span style="color: #483d8b;"&gt;'body'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; i &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #008000;"&gt;range&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;0&lt;/span&gt;,&lt;span style="color: #008000;"&gt;len&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;links&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
            item = &lt;span style="color: black;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'title'&lt;/span&gt;:remove_extra_spaces&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;' '&lt;/span&gt;.&lt;span style="color: black;"&gt;join&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;links&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;findAll&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;text=&lt;span style="color: #008000;"&gt;True&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;.&lt;span style="color: black;"&gt;strip&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;, 
                    &lt;span style="color: #483d8b;"&gt;'destination'&lt;/span&gt;:links&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;find&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'a'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'href'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;,
                    &lt;span style="color: #483d8b;"&gt;'comment_count'&lt;/span&gt;:&lt;span style="color: #008000;"&gt;int&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;comments&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: #dc143c;"&gt;string&lt;/span&gt;.&lt;span style="color: black;"&gt;split&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;,
                    &lt;span style="color: #483d8b;"&gt;'digg_link'&lt;/span&gt;:comments&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'href'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;,
                    &lt;span style="color: #483d8b;"&gt;'digg_count'&lt;/span&gt;:diggs&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: #dc143c;"&gt;string&lt;/span&gt;,
                    &lt;span style="color: #483d8b;"&gt;'summary'&lt;/span&gt;:body&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: black;"&gt;find&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;text=&lt;span style="color: #008000;"&gt;True&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
                    &lt;span style="color: black;"&gt;&amp;#125;&lt;/span&gt;
            digg_results.&lt;span style="color: black;"&gt;append&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;item&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
        &lt;span style="color: #808080; font-style: italic;"&gt;#last page early exit&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #008000;"&gt;len&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;links&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color: #ff4500;"&gt;10&lt;/span&gt;:
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; digg_results
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; __name__==&lt;span style="color: #483d8b;"&gt;'__main__'&lt;/span&gt;:
    &lt;span style="color: #808080; font-style: italic;"&gt;#for testing&lt;/span&gt;
    results = digg_search&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'twitter -d'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'digg'&lt;/span&gt;, &lt;span style="color: #ff4500;"&gt;2&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; r &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; results:
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; r&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can grab the source code from the &lt;a href="http://bitbucket.org/halotis/halotis-collection/"&gt;bitbucket repository&lt;/a&gt;.&lt;/pre&gt;
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/beautifulsoup' rel='tag' target='_self'&gt;beautifulsoup&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/digg' rel='tag' target='_self'&gt;digg&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/Python' rel='tag' target='_self'&gt;Python&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/scrape' rel='tag' target='_self'&gt;scrape&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/script' rel='tag' target='_self'&gt;script&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/search' rel='tag' target='_self'&gt;search&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/web' rel='tag' target='_self'&gt;web&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/' rel='bookmark' title='Permanent Link: SEOCheck: Track Your Google Position Over Time'&gt;SEOCheck: Track Your Google Position Over Time&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/08/download-images-from-flickr-with-python/' rel='bookmark' title='Permanent Link: Download Images From Flickr With Python'&gt;Download Images From Flickr With Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/12/scrape-yahoo-search-results-page/' rel='bookmark' title='Permanent Link: Scrape Yahoo Search Results Page'&gt;Scrape Yahoo Search Results Page&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RNlmgHyrTA8YbpbeC-VKFsbjgH0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RNlmgHyrTA8YbpbeC-VKFsbjgH0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RNlmgHyrTA8YbpbeC-VKFsbjgH0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RNlmgHyrTA8YbpbeC-VKFsbjgH0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=FWk1qQ6_sMA:XHpeu6FP8DE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=FWk1qQ6_sMA:XHpeu6FP8DE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=FWk1qQ6_sMA:XHpeu6FP8DE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=FWk1qQ6_sMA:XHpeu6FP8DE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=FWk1qQ6_sMA:XHpeu6FP8DE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=FWk1qQ6_sMA:XHpeu6FP8DE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=FWk1qQ6_sMA:XHpeu6FP8DE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=FWk1qQ6_sMA:XHpeu6FP8DE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=FWk1qQ6_sMA:XHpeu6FP8DE:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/FWk1qQ6_sMA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/#comments" thr:count="5" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/feed/atom/" thr:count="5" />
		<thr:total>5</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[SEOCheck: Track Your Google Position Over Time]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/TqVydGoDbf4/" />
		<id>http://www.halotis.com/?p=768</id>
		<updated>2009-09-29T20:56:36Z</updated>
		<published>2009-09-28T17:47:54Z</published>
		<category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="Software" /><category scheme="http://www.halotis.com" term="beautifulsoup" /><category scheme="http://www.halotis.com" term="google" /><category scheme="http://www.halotis.com" term="matplotlib" /><category scheme="http://www.halotis.com" term="scrape" /><category scheme="http://www.halotis.com" term="seo" /><category scheme="http://www.halotis.com" term="sqlalchemy" /><category scheme="http://www.halotis.com" term="urllib" />		<summary type="html"><![CDATA[Have you ever wanted to track and assess your SEO efforts by seeing how they change your position in Google&#8217;s organic SERP?  With this script you can now track and chart your position for any number of search queries and find the position of the site/page you are trying to rank.
This will allow you [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/08/08/scrape-google-search-results-page/' rel='bookmark' title='Permanent Link: Scrape Google Search Results Page'>Scrape Google Search Results Page</a></li>
<li><a href='http://www.halotis.com/2009/07/20/translating-text-using-google-translate-and-python/' rel='bookmark' title='Permanent Link: Translating Text Using Google Translate and Python'>Translating Text Using Google Translate and Python</a></li>
<li><a href='http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/' rel='bookmark' title='Permanent Link: Scrape Digg Search Results Python Script'>Scrape Digg Search Results Python Script</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/">&lt;p&gt;Have you ever wanted to track and assess your SEO efforts by seeing how they change your position in Google&amp;#8217;s organic SERP?  With this script you can now &lt;strong&gt;track and chart your position&lt;/strong&gt; for any number of search queries and find the position of the site/page you are trying to rank.&lt;/p&gt;
&lt;p&gt;This will allow you to visually identify any target keyword phrases that are doing well, and which ones may need some more SEO work.&lt;/p&gt;
&lt;p&gt;This python script has a number of different components.  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SEOCheckConfig.py&lt;/strong&gt; script is used to add new target search queries to the database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SEOCheck.py&lt;/strong&gt; searches Google and saves the best position (in the top 100 results)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SEOCheckCharting.py&lt;/strong&gt; graph all the results&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The charts produced look like this:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.halotis.com/wp-content/uploads/2009/09/seocheck.png"&gt;&lt;img src="http://www.halotis.com/wp-content/uploads/2009/09/seocheck-300x226.png" alt="seocheck" title="seocheck" width="300" height="226" class="size-medium wp-image-771" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The main part of the script is SEOCheck.py.  This script should be scheduled to run regularly (I have mine running 3 times per day on my &lt;a href="http://www.halotis.com/go/webfaction"&gt;webfaction&lt;/a&gt; hosting account).&lt;/p&gt;
&lt;p&gt;For a small SEO consultancy business this type of application generates the feedback and reports that you should be using to communicate with your clients.  It identifies where the efforts should go and how successful you have been.&lt;/p&gt;
&lt;p&gt;To use this set of script you first will need to edit and run the SEOCheckConfig.py file.  Add your own queries and domains that you&amp;#8217;d like to check to the SETTINGS variable then run the script to load those into the database.&lt;/p&gt;
&lt;p&gt;Then schedule SEOCheck.py to run periodically.  On Windows you can do that using Scheduled Tasks:&lt;br /&gt;
&lt;a href="http://www.halotis.com/wp-content/uploads/2009/09/schedTask.png"&gt;&lt;img src="http://www.halotis.com/wp-content/uploads/2009/09/schedTask-267x300.png" alt="Scheduled Task Dialog" title="Scheduled Task Dialog" width="267" height="300" class="alignnone size-medium wp-image-775" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On either Mac OSX or Linux you can use &lt;strong&gt;crontab &lt;/strong&gt;to schedule it.&lt;/p&gt;
&lt;p&gt;To generate the Chart simply run the SEOCheckCharting.py script.  It will plot all the results on one graph.&lt;/p&gt;
&lt;p&gt;You can find and download all the source code for this in the &lt;a href="http://bitbucket.org/halotis/halotis-collection/src/"&gt;HalOtis-Collection&lt;/a&gt; on bitbucket.  It requires BeautifulSoup, matplotlib, and sqlalchemy libraries to be installed.&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/beautifulsoup' rel='tag' target='_self'&gt;beautifulsoup&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/google' rel='tag' target='_self'&gt;google&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/matplotlib' rel='tag' target='_self'&gt;matplotlib&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/Python' rel='tag' target='_self'&gt;Python&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/scrape' rel='tag' target='_self'&gt;scrape&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/seo' rel='tag' target='_self'&gt;seo&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/sqlalchemy' rel='tag' target='_self'&gt;sqlalchemy&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/urllib' rel='tag' target='_self'&gt;urllib&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/08/scrape-google-search-results-page/' rel='bookmark' title='Permanent Link: Scrape Google Search Results Page'&gt;Scrape Google Search Results Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/07/20/translating-text-using-google-translate-and-python/' rel='bookmark' title='Permanent Link: Translating Text Using Google Translate and Python'&gt;Translating Text Using Google Translate and Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/' rel='bookmark' title='Permanent Link: Scrape Digg Search Results Python Script'&gt;Scrape Digg Search Results Python Script&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NxQHWmhZGorkp-dQRwsEEiDgQ4U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NxQHWmhZGorkp-dQRwsEEiDgQ4U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NxQHWmhZGorkp-dQRwsEEiDgQ4U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NxQHWmhZGorkp-dQRwsEEiDgQ4U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=TqVydGoDbf4:_JjVQP572CY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=TqVydGoDbf4:_JjVQP572CY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=TqVydGoDbf4:_JjVQP572CY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=TqVydGoDbf4:_JjVQP572CY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=TqVydGoDbf4:_JjVQP572CY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=TqVydGoDbf4:_JjVQP572CY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=TqVydGoDbf4:_JjVQP572CY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=TqVydGoDbf4:_JjVQP572CY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=TqVydGoDbf4:_JjVQP572CY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/TqVydGoDbf4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/#comments" thr:count="6" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/feed/atom/" thr:count="6" />
		<thr:total>6</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/09/28/seocheck-track-your-google-position-over-time/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Python Twitter API Library Reviews and Samples]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/7CJ77iIBQwM/" />
		<id>http://www.halotis.com/2009/09/19/python-twitter-api-libraries-reviews-and-samples/</id>
		<updated>2009-09-18T20:51:59Z</updated>
		<published>2009-09-19T12:28:00Z</published>
		<category scheme="http://www.halotis.com" term="Internet" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="Software" /><category scheme="http://www.halotis.com" term="programming" /><category scheme="http://www.halotis.com" term="python twitter api" /><category scheme="http://www.halotis.com" term="python-twitter" /><category scheme="http://www.halotis.com" term="tweep" /><category scheme="http://www.halotis.com" term="twyt" /><category scheme="http://www.halotis.com" term="twython" />		<summary type="html"><![CDATA[There are many Twitter API libraries available for Python. I wanted to find out which one was the best and what the strengths and weaknesses of each are.  However there are too many out there to find and review all of them.  Instead here&#8217;s a bunch of the most popular Python Twitter API [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/08/06/automatically-respond-to-twitter-messages/' rel='bookmark' title='Permanent Link: Automatically Respond to Twitter Messages'>Automatically Respond to Twitter Messages</a></li>
<li><a href='http://www.halotis.com/2009/09/15/google-translate-api-python-script/' rel='bookmark' title='Permanent Link: Google Translate API Python Script'>Google Translate API Python Script</a></li>
<li><a href='http://www.halotis.com/2009/08/17/amazon-product-advertising-api-from-python/' rel='bookmark' title='Permanent Link: Amazon Product Advertising API From Python'>Amazon Product Advertising API From Python</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/09/19/python-twitter-api-library-reviews-and-samples/">&lt;p&gt;There are many Twitter API libraries available for Python. I wanted to find out which one was the best and what the strengths and weaknesses of each are.  However there are too many out there to find and review all of them.  Instead here&amp;#8217;s a bunch of the most popular &lt;strong&gt;Python Twitter API&lt;/strong&gt; wrappers with a small review of each one, and some sample code showing off the syntax.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://code.google.com/p/python-twitter/"&gt;Python Twitter&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is the library that I personally use in most of my Twitter scripts.  It&amp;#8217;s very simple to use, but is not up to date with the latest developments at Twitter.  It was written by DeWitt Clinton and available on Google Code.  If you just want the basic API functionality this does a pretty decent job.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; twitter
api = twitter.&lt;span style="color: black;"&gt;Api&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'username'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'password'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
statuses = api.&lt;span style="color: black;"&gt;GetPublicTimeline&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;s.&lt;span style="color: #dc143c;"&gt;user&lt;/span&gt;.&lt;span style="color: black;"&gt;name&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; s &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; statuses&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
users = api.&lt;span style="color: black;"&gt;GetFriends&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;u.&lt;span style="color: black;"&gt;name&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; u &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; users&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
statuses = api.&lt;span style="color: black;"&gt;GetUserTimeline&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;user&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;s.&lt;span style="color: black;"&gt;text&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; s &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; statuses&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
api.&lt;span style="color: black;"&gt;PostUpdate&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;username, password, &lt;span style="color: #483d8b;"&gt;'I love python-twitter!'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a href="http://andrewprice.me.uk/projects/twyt/"&gt;twyt&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Twyt is a pretty comprehensive library that seems to be pretty solid and well organized.  In some cases there is added complexity to parse the return json objects from the Python Twitter API.  It is written and maintained by Andrew Price.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; twyt &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; twitter, data
t = twitter.&lt;span style="color: black;"&gt;Twitter&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
t.&lt;span style="color: black;"&gt;set_auth&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;username&amp;quot;&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;&amp;quot;password&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; t.&lt;span style="color: black;"&gt;status_friends_timeline&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; t.&lt;span style="color: black;"&gt;user_friends&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
return_val = t.&lt;span style="color: black;"&gt;status_update&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;Testing 123&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
s = data.&lt;span style="color: black;"&gt;Status&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
s.&lt;span style="color: black;"&gt;load_json&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;return_val&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; s
t.&lt;span style="color: black;"&gt;status_destroy&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;s.&lt;span style="color: #008000;"&gt;id&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a href="http://github.com/ryanmcgrath/twython"&gt;Twython&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;An up to date, Python wrapper for the Twitter API. Supports Twitter&amp;#8217;s main API, Twitter&amp;#8217;s search API, and (soon) using OAuth with Twitter/Streaming API.  It is based on the Python Twitter library and is actively maintained by Ryan Mcgrath.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; twython
twitter = twython.&lt;span style="color: black;"&gt;setup&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;authtype=&lt;span style="color: #483d8b;"&gt;&amp;quot;Basic&amp;quot;&lt;/span&gt;, username=&lt;span style="color: #483d8b;"&gt;&amp;quot;example&amp;quot;&lt;/span&gt;, password=&lt;span style="color: #483d8b;"&gt;&amp;quot;example&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
twitter.&lt;span style="color: black;"&gt;updateStatus&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;See how easy this was?&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
friends_timeline = twitter.&lt;span style="color: black;"&gt;getFriendsTimeline&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;count=&lt;span style="color: #483d8b;"&gt;&amp;quot;150&amp;quot;&lt;/span&gt;, page=&lt;span style="color: #483d8b;"&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;tweet&lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; tweet &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; friends_timeline&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a href="http://github.com/joshthecoder/tweepy"&gt;Tweepy&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Tweepy is a pretty compelling Python Twitter API library.  It&amp;#8217;s up to date with the latest features of Twitter and actively being developed by Joshua Roesslein.  It features OAuth support, Python 3 support, streaming API support and it&amp;#8217;s own cache system.  Retweet streaming was recently added.  If you want to use the most up to date features of the Twitter API on Python, or use Python 3, then you should definitely check out Tweepy.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; tweepy
api = tweepy.&lt;span style="color: black;"&gt;API&lt;/span&gt;.&lt;span style="color: #dc143c;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'basic'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'username'&lt;/span&gt;, &lt;span style="color: #483d8b;"&gt;'password'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
public_timeline = api.&lt;span style="color: black;"&gt;public_timeline&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;tweet.&lt;span style="color: black;"&gt;text&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; tweet &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; public_timeline&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
friends_timeline = api.&lt;span style="color: black;"&gt;friends_timeline&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;tweet.&lt;span style="color: black;"&gt;text&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; tweet &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; friends_timeline&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
u = tweepy.&lt;span style="color: black;"&gt;api&lt;/span&gt;.&lt;span style="color: black;"&gt;get_user&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'username'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
friends = u.&lt;span style="color: black;"&gt;friends&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#91;&lt;/span&gt;tweet.&lt;span style="color: black;"&gt;screen_name&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;for&lt;/span&gt; f &lt;span style="color: #ff7700;font-weight:bold;"&gt;in&lt;/span&gt; friends&lt;span style="color: black;"&gt;&amp;#93;&lt;/span&gt;
api.&lt;span style="color: black;"&gt;update_status&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'tweeting with tweepy'&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It&amp;#8217;s pretty clear from the syntax samples that there&amp;#8217;s not much difference between any of these Python Twitter API libraries when just getting the basics done.  The difference only start to show up when you get into the latest features.  OAuth, Streaming, and the retweet functions really differentiate these libraries.  I hope this overview helps you find and choose the library that&amp;#8217;s right for your project.
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/programming' rel='tag' target='_self'&gt;programming&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/python+twitter+api' rel='tag' target='_self'&gt;python twitter api&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/python-twitter' rel='tag' target='_self'&gt;python-twitter&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/tweep' rel='tag' target='_self'&gt;tweep&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/twyt' rel='tag' target='_self'&gt;twyt&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/twython' rel='tag' target='_self'&gt;twython&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/06/automatically-respond-to-twitter-messages/' rel='bookmark' title='Permanent Link: Automatically Respond to Twitter Messages'&gt;Automatically Respond to Twitter Messages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/15/google-translate-api-python-script/' rel='bookmark' title='Permanent Link: Google Translate API Python Script'&gt;Google Translate API Python Script&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/17/amazon-product-advertising-api-from-python/' rel='bookmark' title='Permanent Link: Amazon Product Advertising API From Python'&gt;Amazon Product Advertising API From Python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4hOpHd33ywRY8_QberEwsx4WkkY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4hOpHd33ywRY8_QberEwsx4WkkY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4hOpHd33ywRY8_QberEwsx4WkkY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4hOpHd33ywRY8_QberEwsx4WkkY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=7CJ77iIBQwM:C6pY1tQndp4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=7CJ77iIBQwM:C6pY1tQndp4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=7CJ77iIBQwM:C6pY1tQndp4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=7CJ77iIBQwM:C6pY1tQndp4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=7CJ77iIBQwM:C6pY1tQndp4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=7CJ77iIBQwM:C6pY1tQndp4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=7CJ77iIBQwM:C6pY1tQndp4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=7CJ77iIBQwM:C6pY1tQndp4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=7CJ77iIBQwM:C6pY1tQndp4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/7CJ77iIBQwM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/09/19/python-twitter-api-library-reviews-and-samples/#comments" thr:count="6" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/09/19/python-twitter-api-library-reviews-and-samples/feed/atom/" thr:count="6" />
		<thr:total>6</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/09/19/python-twitter-api-library-reviews-and-samples/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Matt Warren</name>
						<uri>http://www.mattwarren.name</uri>
					</author>
		<title type="html"><![CDATA[Source Code Available on Bitbucket]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HalotisBlog/~3/_LR5EzIVqHU/" />
		<id>http://www.halotis.com/?p=755</id>
		<updated>2009-09-18T17:02:39Z</updated>
		<published>2009-09-18T16:47:24Z</published>
		<category scheme="http://www.halotis.com" term="Software" /><category scheme="http://www.halotis.com" term="bitbucket" /><category scheme="http://www.halotis.com" term="hg" /><category scheme="http://www.halotis.com" term="mercurial" /><category scheme="http://www.halotis.com" term="Python" /><category scheme="http://www.halotis.com" term="source code" />		<summary type="html"><![CDATA[Someone asked me to make the source code available in a repository somewhere.  One place to grab all the scripts I&#8217;ve shared on this blog.  Well I&#8217;m starting to make them available on bitbucket.org.  So far thirteen scripts have been published to the repository and are available using Mercurial (hg) or through [...]


Related posts:<ol><li><a href='http://www.halotis.com/2009/01/27/blog-auto-posting-robot-interested/' rel='bookmark' title='Permanent Link: Blog Auto-Posting Robot&#8230; Interested?'>Blog Auto-Posting Robot&#8230; Interested?</a></li>
<li><a href='http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/' rel='bookmark' title='Permanent Link: Scrape Digg Search Results Python Script'>Scrape Digg Search Results Python Script</a></li>
<li><a href='http://www.halotis.com/2009/08/14/get-your-clickbank-transactions-into-sqlite-with-python/' rel='bookmark' title='Permanent Link: Get Your ClickBank Transactions Into Sqlite With Python'>Get Your ClickBank Transactions Into Sqlite With Python</a></li>
</ol>]]></summary>
		<content type="html" xml:base="http://www.halotis.com/2009/09/18/source-code-available-on-bitbucket/">&lt;p&gt;&lt;img src="http://www.halotis.com/wp-content/uploads/2009/09/logo_myriad.png" alt="bitbucket logo" title="bitbucket" width="150" height="39" align="left" class="size-full wp-image-757" /&gt;Someone asked me to make the source code available in a repository somewhere.  One place to grab all the scripts I&amp;#8217;ve shared on this blog.  Well I&amp;#8217;m starting to make them available on &lt;a href="http://bitbucket.org"&gt;bitbucket.org&lt;/a&gt;.  So far thirteen scripts have been published to the repository and are available using Mercurial (hg) or through the web interface.&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href="http://bitbucket.org/halotis/halotis-collection/overview/"&gt;halotis-collection repository&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As time permits I&amp;#8217;ll be updating and adding more scripts to the repository. Going forward all the new scripts will be added to the repository, and I&amp;#8217;ll link to the source code from the post which will make it easier to get the files and play with them yourself.
&lt;p&gt;&lt;script src="http://feeds.feedburner.com/~s/HalotisBlog?i=&lt;?php the_permalink() ?&gt;" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;!-- start wp-tags-to-technorati 1.01 --&gt;

&lt;p class='technorati-tags'&gt;Technorati Tags: &lt;a class='technorati-link' href='http://technorati.com/tag/bitbucket' rel='tag' target='_self'&gt;bitbucket&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/hg' rel='tag' target='_self'&gt;hg&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/mercurial' rel='tag' target='_self'&gt;mercurial&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/Python' rel='tag' target='_self'&gt;Python&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/Software' rel='tag' target='_self'&gt;Software&lt;/a&gt;, &lt;a class='technorati-link' href='http://technorati.com/tag/source+code' rel='tag' target='_self'&gt;source code&lt;/a&gt;&lt;/p&gt;

&lt;!-- end wp-tags-to-technorati --&gt;


&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a href='http://www.halotis.com/2009/01/27/blog-auto-posting-robot-interested/' rel='bookmark' title='Permanent Link: Blog Auto-Posting Robot&amp;#8230; Interested?'&gt;Blog Auto-Posting Robot&amp;#8230; Interested?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/09/30/scrape-digg-search-results-python-script/' rel='bookmark' title='Permanent Link: Scrape Digg Search Results Python Script'&gt;Scrape Digg Search Results Python Script&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='http://www.halotis.com/2009/08/14/get-your-clickbank-transactions-into-sqlite-with-python/' rel='bookmark' title='Permanent Link: Get Your ClickBank Transactions Into Sqlite With Python'&gt;Get Your ClickBank Transactions Into Sqlite With Python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xmPMi0BzbqBzIzJ5F6nqInunvUU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xmPMi0BzbqBzIzJ5F6nqInunvUU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xmPMi0BzbqBzIzJ5F6nqInunvUU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xmPMi0BzbqBzIzJ5F6nqInunvUU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=_LR5EzIVqHU:nzFBmlqMNIU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=_LR5EzIVqHU:nzFBmlqMNIU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=_LR5EzIVqHU:nzFBmlqMNIU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=_LR5EzIVqHU:nzFBmlqMNIU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=_LR5EzIVqHU:nzFBmlqMNIU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=_LR5EzIVqHU:nzFBmlqMNIU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=_LR5EzIVqHU:nzFBmlqMNIU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?i=_LR5EzIVqHU:nzFBmlqMNIU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HalotisBlog?a=_LR5EzIVqHU:nzFBmlqMNIU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HalotisBlog?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HalotisBlog/~4/_LR5EzIVqHU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.halotis.com/2009/09/18/source-code-available-on-bitbucket/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://www.halotis.com/2009/09/18/source-code-available-on-bitbucket/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://www.halotis.com/2009/09/18/source-code-available-on-bitbucket/</feedburner:origLink></entry>
	</feed>
