<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: mutt and your gmail contacts</title>
	<atom:link href="http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/</link>
	<description>Words and ideas from a mildly misanthropic technologist.</description>
	<lastBuildDate>Fri, 13 Aug 2010 01:07:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
		<item>
		<title>By: mernisse</title>
		<link>http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/comment-page-1/#comment-10344</link>
		<dc:creator>mernisse</dc:creator>
		<pubDate>Wed, 30 Dec 2009 20:42:08 +0000</pubDate>
		<guid isPermaLink="false">http://ub3rgeek.net/wp/?p=347#comment-10344</guid>
		<description>It looks like wordpress mangled the patch pretty hard, I tried to clean it up but alas it seems to be a losing battle.  If you would be so kind as to drop a copy of the patch to mernisse at ub3rgeek.net that would be awesome and I&#039;ll happily merge it.  Thanks!</description>
		<content:encoded><![CDATA[<p>It looks like wordpress mangled the patch pretty hard, I tried to clean it up but alas it seems to be a losing battle.  If you would be so kind as to drop a copy of the patch to mernisse at ub3rgeek.net that would be awesome and I&#8217;ll happily merge it.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/comment-page-1/#comment-9925</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Wed, 25 Nov 2009 22:36:35 +0000</pubDate>
		<guid isPermaLink="false">http://ub3rgeek.net/wp/?p=347#comment-9925</guid>
		<description>This patch looks if there is a group which is equal to the search argument and returns all addresses in that group. I like it since I use groups a lot.
I hope indentation stays ok.

+++ mutt-gcontact2.py	2009-11-25 23:27:54.831775946 +0100
@@ -1,4 +1,4 @@
-#!/usr/local/bin/python -tt
+#!/usr/bin/python -tt
 
 &quot;&quot;&quot; mutt-gcontacts.py (c) 2008 Matthew John Ernisse 
 
@@ -68,6 +68,7 @@
     username = &quot;&quot;
     password = &quot;&quot;
     search = &quot;&quot;
+    group_name = &quot;&quot;
 
     for o, a in opts:
         if o == &quot;-u&quot;:
@@ -97,8 +98,16 @@
     # fetch the user&#039;s contacts.
     contacts = []
     offset = 1
+    groups = {}
+    group_feed = g.GetGroupsFeed()
+    for i in group_feed.entry:
+        groups[i.title.text] = i.id.text
     while True:
-        q = gdata.contacts.service.ContactsQuery()
+        try:
+            q = gdata.contacts.service.ContactsQuery(group=groups[search])
+            search = &quot;@&quot;
+        except:
+            q = gdata.contacts.service.ContactsQuery()
         q.max_results = 20
         q.start_index = offset
         c = 0
@@ -111,6 +120,7 @@
                   
             c += 1
 
+
         if c == 20:
             offset += 20
         else:</description>
		<content:encoded><![CDATA[<p>This patch looks if there is a group which is equal to the search argument and returns all addresses in that group. I like it since I use groups a lot.<br />
I hope indentation stays ok.</p>
<p>+++ mutt-gcontact2.py	2009-11-25 23:27:54.831775946 +0100<br />
@@ -1,4 +1,4 @@<br />
-#!/usr/local/bin/python -tt<br />
+#!/usr/bin/python -tt</p>
<p> &#8220;&#8221;" mutt-gcontacts.py (c) 2008 Matthew John Ernisse </p>
<p>@@ -68,6 +68,7 @@<br />
     username = &#8220;&#8221;<br />
     password = &#8220;&#8221;<br />
     search = &#8220;&#8221;<br />
+    group_name = &#8220;&#8221;</p>
<p>     for o, a in opts:<br />
         if o == &#8220;-u&#8221;:<br />
@@ -97,8 +98,16 @@<br />
     # fetch the user&#8217;s contacts.<br />
     contacts = []<br />
     offset = 1<br />
+    groups = {}<br />
+    group_feed = g.GetGroupsFeed()<br />
+    for i in group_feed.entry:<br />
+        groups[i.title.text] = i.id.text<br />
     while True:<br />
-        q = gdata.contacts.service.ContactsQuery()<br />
+        try:<br />
+            q = gdata.contacts.service.ContactsQuery(group=groups[search])<br />
+            search = &#8220;@&#8221;<br />
+        except:<br />
+            q = gdata.contacts.service.ContactsQuery()<br />
         q.max_results = 20<br />
         q.start_index = offset<br />
         c = 0<br />
@@ -111,6 +120,7 @@</p>
<p>             c += 1</p>
<p>+<br />
         if c == 20:<br />
             offset += 20<br />
         else:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/comment-page-1/#comment-9815</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Wed, 18 Nov 2009 06:36:04 +0000</pubDate>
		<guid isPermaLink="false">http://ub3rgeek.net/wp/?p=347#comment-9815</guid>
		<description>Nevermind, the max_results thing was a red herring.  There was actually an indentation issue. I&#039;ve emailed you a patch that fixes this. I also sent you another patch that will make the script return all matches to the query, rather than just ones that are the primary email address for a given contact.</description>
		<content:encoded><![CDATA[<p>Nevermind, the max_results thing was a red herring.  There was actually an indentation issue. I&#8217;ve emailed you a patch that fixes this. I also sent you another patch that will make the script return all matches to the query, rather than just ones that are the primary email address for a given contact.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/comment-page-1/#comment-9814</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Wed, 18 Nov 2009 04:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://ub3rgeek.net/wp/?p=347#comment-9814</guid>
		<description>Looks like I solved this by editing the max_results. However, contacts with multiple email addresses don&#039;t seem to be handled properly. The script only seems to return the primary email address for each contact, which is not as useful if you have contacts with multiple addresses.</description>
		<content:encoded><![CDATA[<p>Looks like I solved this by editing the max_results. However, contacts with multiple email addresses don&#8217;t seem to be handled properly. The script only seems to return the primary email address for each contact, which is not as useful if you have contacts with multiple addresses.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://blog.ub3rgeek.net/2008/12/14/mutt-and-your-gmail-contacts/comment-page-1/#comment-9813</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Wed, 18 Nov 2009 04:35:10 +0000</pubDate>
		<guid isPermaLink="false">http://ub3rgeek.net/wp/?p=347#comment-9813</guid>
		<description>I set up your script but each query I submit returns &quot;No Contacts Found&quot;.</description>
		<content:encoded><![CDATA[<p>I set up your script but each query I submit returns &#8220;No Contacts Found&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

