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

<channel>
	<title>Lee Newton &#187; verification</title>
	<atom:link href="http://www.blogmeetsworld.com/tag/verification/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blogmeetsworld.com</link>
	<description>all the splinters of my mind</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:38:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Webmaster Tools Site Verification via Gdata-Python</title>
		<link>http://www.blogmeetsworld.com/webmaster-tools-site-verification-via-gdata-python/</link>
		<comments>http://www.blogmeetsworld.com/webmaster-tools-site-verification-via-gdata-python/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 23:14:55 +0000</pubDate>
		<dc:creator>LRN</dc:creator>
				<category><![CDATA[b5media]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[gdata]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[verification]]></category>
		<category><![CDATA[webmaster tools]]></category>

		<guid isPermaLink="false">http://www.blogmeetsworld.com/?p=173</guid>
		<description><![CDATA[<p>Been trying to get site verification scripted for google webmaster tools from a php script and running into walls? Try the gdata-python-client library and these easy changes to get a working script for api based site verification.</p><p><a href="http://www.blogmeetsworld.com/webmaster-tools-site-verification-via-gdata-python/">Webmaster Tools Site Verification via Gdata-Python</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure I&#8217;ll have some fun later messing with the Zend Gdata classes in PHP, it looks to be great for interfacing with practically every google api except the one I wanted, webmaster tools. I could get authenticated to the webmaster tools scope using zend, and even pull a full sites feed for my account, but after that the included classes just aren&#8217;t built to handle the flavor of atom feed returned by the webmaster api.I couldn&#8217;t pull an individual site&#8217;s feed, and I couldn&#8217;t request a site verification, which was my primary goal.</p>
<p>After messing with it for probably too long, I decided to try a different approach. The <a style="text-decoration: none; color: #000000;" title="gdata-python-client" href="http://code.google.com/p/gdata-python-client/" target="_blank">gdata-python-client</a> library is where I should&#8217;ve started all along. The out of the box sample apps for webmaster tools work flawlessly, and use the client auth type to hook you in to the api.</p>
<p>I did need to modify the code in version 1.2.3 of the library a tiny bit to make the VerifySite() function work, luckily it&#8217;s an easy fix.  Below is a snippet from src/gdata/webmastertools/__init__.py line 126. My changes are in red.</p>
<blockquote><p>class VerificationMethod(atom.AtomBase):<br />
_tag = &#8216;verification-method&#8217;<br />
_namespace = GWEBMASTERTOOLS_NAMESPACE<br />
_children = atom.Text._children.copy()<br />
_attributes = atom.Text._attributes.copy()<br />
_children['{%s}meta' % atom.ATOM_NAMESPACE] = (<br />
&#8216;meta&#8217;, VerificationMethodMeta)<br />
_attributes['in-use'] = &#8216;in_use&#8217;<br />
<strong><span style="color: #ff0000;">_attributes['type'] = &#8216;type&#8217;</span></strong><br />
def __init__(self, text=None, in_use=None, <span style="color: #ff0000;"><strong>type=None</strong>,</span> meta=None,<br />
extension_elements=None, extension_attributes=None):<br />
self.text = text<br />
self.in_use = in_use<br />
<strong><span style="color: #ff0000;">self.type = type</span></strong><br />
self.meta = meta<br />
self.extension_elements = extension_elements or []<br />
self.extension_attributes = extension_attributes or {}</p></blockquote>
<p>And a snippet from src/gdata/webmastertools/service.py line 153. Again, the change is in red.</p>
<blockquote><p>site_entry = webmastertools.SitesEntry(<br />
atom_id=atom.Id(text=site_uri),<br />
category=atom.Category(<br />
scheme=&#8217;http://schemas.google.com/g/2005#kind&#8217;,<br />
term=&#8217;http://schemas.google.com/webmasters/tools/2007#sites-info&#8217;),<br />
verification_method=webmastertools.VerificationMethod(<br />
type=verification_method, <strong><span style="color: #ff0000;">in_use=&#8217;true&#8217;</span></strong>)<br />
)</p></blockquote>
<p>Don&#8217;t forget to recompile the libs with a <strong>python ./setup.py install</strong> after making these changes, and you&#8217;ll be able to script all the site verifications you want. Next step is throwing together a set of scripts to allow for complete site management in webmaster tools, looks like Python&#8217;s gonna make it a snap!</p>
<p><a href="http://www.blogmeetsworld.com/webmaster-tools-site-verification-via-gdata-python/">Webmaster Tools Site Verification via Gdata-Python</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blogmeetsworld.com/webmaster-tools-site-verification-via-gdata-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/11 queries in 0.104 seconds using disk: basic
Object Caching 415/441 objects using disk: basic

Served from: www.blogmeetsworld.com @ 2012-02-07 06:36:33 -->
