Pages

Showing posts with label gmail. Show all posts
Showing posts with label gmail. Show all posts

Monday, October 24, 2011

Hide right side ads in Gmail


A simple chrome extension to hide the ads showed in the right side of emails. The ads will still be there (someone will still search through emails to generate suitable ads), but will be hidden using CSS.
Nice tutorials on building extension for chrome at [5] and [4].
The source code and packed .crx extension are uploaded to google code.
Compilations of references (thanks):

  1.   Getting started
  2.   Content scripts
  3.   Extensions FAQ
  4.   Extensions dev guide
  5.   Creating a chrome extension tutorial
  6.   IconFinder 

Friday, January 8, 2010

Another brick in the (corporate) wall

When trying to open GMail, Google Reader or other Google sites that require authentication, I got the following error:


              Error 107 (net::ERR_SSL_PROTOCOL_ERROR): Unknown error.


I am behind a proxy, that authenticates itself with certificate to GMail. So the traffic goes encrypted to the proxy and only then the proxy encrypts it with the certificate from Google. Anyway, to pass this I added  the --use-system-ssl option for the Chrome shortcut, in the Target field, like: 


"C:\Documents and Settings\\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --use-system-ssl


I found too little information on the issue and also on what this parameter does, so any information is welcomed. 


Some links:
Chromium Issue 30689,  and one from Chrome support forum.

Monday, September 7, 2009

Programmatic Gmail authentication with urllib2

   The python urllib2 library can be used to automate login to sites requiring authentication. Below I used it to authenticate to Gmail, get the atom mails feed, and parse the feed with feedparser library from M. Pilgrim.  References contain lot of examples and documentation. 
import urllib2
import logging
import feedparser

def auth(user, passwd):
 auth_handler = urllib2.HTTPBasicAuthHandler()
 auth_handler.add_password(
  realm='New mail feed',
  uri='https://mail.google.com',
  user='%s@gmail.com' % user,
  passwd=passwd
 )
 opener = urllib2.build_opener(auth_handler)
 urllib2.install_opener(opener)  
 
    try:
  feed = urllib2.urlopen('https://mail.google.com/mail/feed/atom')
 except urllib2.HTTPError, e:
  logging.error('The server couldn\'t fulfill the request.')
  logging.error('Error code: %s ', e.code)
  exit(1)
 except urllib2.URLError, e:
  logging.error('We failed to reach a server.')
  logging.error('Reason: %s .', e.reason)
  exit(2)
 except DownloadError, e:
  logging.error('Download error: %s.', e)
  exit(3)
 except Exception, e:
  logging.error('Other exception in urlopen: %s', e)
  exit(4)
  
 logging.info('Feed opened')
 return feed.read()

 def read_mail(feed):
  # Parse the Atom feed
  atom = feedparser.parse(feed)
  
  num_email = len(atom.entries)

  for i in range(num_email):
   mail = atom.entries[i]
            . . . . . .


References: