Re: GAlerts Module

124 views
Skip to first unread message

Joshua Bronson

unread,
Jan 5, 2011, 6:05:32 PM1/5/11
to Peter Sanchez, lais...@gmail.com, gal...@googlegroups.com
Hi Peter,

I had some spare cycles today and gave Galerts some attention.

First off, thanks so much for the updates to make things work with Google's new auth. Your patches are good and I've pulled those changes. I've also added you as a committer to http://github.com/jab/galerts, so you can commit to my repo directly.

Laiso's change should not have been pulled. Google merely changed the wording of one of the results types from "comprehensive" to "everything", but they're still using the value "7" to represent it internally. It looks like Laiso didn't realize this and added TYPE_EVERYTHING alongside TYPE_COMPREHENSIVE, and gave it an arbitrary value of "10". To see what Google uses to represent things internally, you can use something like HTTPFox (https://addons.mozilla.org/en-US/firefox/addon/6647/) to view the POST data the browser sends back to Google when you submit the form at http://www.google.com/alerts or http://www.google.com/alerts/manage.

I added support for the new "volume" setting Google has added.

I released these changes to PyPI as 0.2.0dev (see http://pypi.python.org/pypi/galerts). If you tell me your PyPI username, I'll add you as a package manager. I built up-to-date documentation via sphinx and then used the spinx-pypi-upload package to upload it to http://packages.python.org/galerts with the "python setup.py upload_sphinx" command.

I've created a Google Groups mailing list (copied) for Galerts-related discussion going forward (see http://groups.google.com/group/galerts). I took the liberty of adding you to the group with the "no email" subscription setting, and making you a group manager. Change your settings if you'd like to receive emails from the group rather than having to use the web interface.

If you have any further questions about taking over maintenance of the package, don't hesitate to ask.

Thanks,
Josh

On Tue, Jan 4, 2011 at 8:42 PM, Peter Sanchez <peters...@gmail.com> wrote:
Hi Josh,

So I forked the project, pulled in the change from Laiso and added all my changes to the repo. What would really be helpful is if I can take over the pypi app so it's easily to be installed with pip. I can always reference the git repo in pip, but it would be nice to be able to just pull the source from Pypi.

Let me know if that's cool with you dude.

Peter

On Tue, Jan 4, 2011 at 1:31 PM, Joshua Bronson <jabr...@gmail.com> wrote:
Hi Peter,

Thanks for the bug report, and sorry for the delay in getting back to you. I no longer have use for GAlerts and unfortunately don't have time to maintain it. But if you or someone you know would be interested in taking over its maintenance, I'd be thrilled to facilitate that. Sorry I can't be of more help at the moment.

Best,
Josh


On Wed, Dec 29, 2010 at 6:17 PM, Peter Sanchez <peters...@gmail.com> wrote:
Hi Joshua (and Laiso),

I'm writing about the GAlerts Module...

I just opened this ticket:


Sorry for the markdown formatting. For some reason, I just can't stand Markdown.. So I decided I'd also email, hope you guys don't mind.

Here is the screwed up formatting from the ticket:

Python 2.6.4 (r264:75706, Nov 24 2009, 00:57:38) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> import galerts
>>> g = galerts.GAlertsManager('peters...@gmail.com', 'XXXXXX')
>>> list(g.alerts)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "galerts.py", line 362, in alerts
    raise UnexpectedResponseError(response.status, response.getheaders(), body)
UnexpectedResponseError
>>> try:
...   list(g.alerts)
... except galerts.UnexpectedResponseError, e:
...   pass
...
>>> e.resp_body
'<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\n<TITLE>302 Moved</TITLE></HEAD><BODY>\n<H1>302 Moved</H1>\nThe document has moved\n<A HREF="https://www.google.com/accounts/ServiceLogin?service=alerts&amp;hl=en&amp;gl=us&amp;continue=http://www.google.com/alerts/manage%3Fhl%3Den%26gl%3Dus">here</A>.\r\n</BODY></HTML>\r\n'
>>> e.resp_status
302
>>> e.resp_headers
[('content-length', '345'),
 ('x-xss-protection', '1; mode=block'),
 ('x-content-type-options', 'nosniff'),
 ('set-cookie',
  'PREF=ID=bd7e943ae66acc6c:TM=1293663972:LM=1293663972:S=giOCiZeepOAVG4Mm; expires=Fri, 28-Dec-2012 23:06:12 GMT; path=/; domain=.google.com'),
 ('expires', 'Fri, 01 Jan 1990 00:00:00 GMT'),
 ('server', 'psfe'),
 ('location',
 ('pragma', 'no-cache'),
 ('cache-control', 'no-cache, must-revalidate'),
 ('date', 'Wed, 29 Dec 2010 23:06:12 GMT'),
 ('content-type', 'text/html; charset=UTF-8')]
>>>

Any ideas? It seems as if Google changed the way the login works. Looks like it's trying to force me to login first, even though I've already initialized the GAlertsManager (which calls _signin).

Thanks guys,

Peter



Peter Sanchez

unread,
Jan 5, 2011, 6:26:02 PM1/5/11
to Joshua Bronson, lais...@gmail.com, gal...@googlegroups.com
Hi Josh,

Awesome, that works for me. Thanks for taking the time to make the updates. I plan on making heavy use of this module for a new project I'm getting ready to launch. So when something goes wrong, I should notice it pretty quickly and hopefully find the cause and fix it!

My PyPi username is 'petersanchez'

Thanks again for everything!

Peter

Joshua Bronson

unread,
Jan 5, 2011, 6:38:04 PM1/5/11
to Peter Sanchez, lais...@gmail.com, gal...@googlegroups.com
On Wed, Jan 5, 2011 at 6:26 PM, Peter Sanchez <peters...@gmail.com> wrote:
Hi Josh,

Awesome, that works for me. Thanks for taking the time to make the updates.

Sure thing. :-)

I plan on making heavy use of this module for a new project I'm getting ready to launch. So when something goes wrong, I should notice it pretty quickly and hopefully find the cause and fix it!

Awesome. I just created a couple issues at https://github.com/jab/galerts/issues, one of which is "Add Automated Tests". Being able to exercise the whole API automatically to quickly be able to tell if Google has made any breaking changes would be a great improvement.

My PyPi username is 'petersanchez'

Added you as package maintainer. Let me know if you have any trouble with PyPI.

Best,
Josh
Reply all
Reply to author
Forward
0 new messages