~davidc3/onehundredscopes/youporn-precise

« back to all changes in this revision

Viewing changes to src/unity-scope-youporn

  • Committer: David Callé
  • Date: 2012-02-15 08:44:01 UTC
  • Revision ID: davidc@framli.eu-20120215084401-7zpyfdap3bgpifc3
Create an age verif cookie at startup, fixing some unexplained reported bugs. 
Thanks for the patch Max!

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                self.scope.connect ("filters-changed", lambda scope : self.scope.queue_search_changed(Unity.SearchType.DEFAULT))
35
35
                self.scope.connect ("activate-uri", self.on_activate_uri)
36
36
                self.scope.export()
 
37
                self.opener = urllib2.build_opener()
 
38
                self.opener.addheaders.append(('Cookie', 'age_verified=1'))
 
39
                urllib2.install_opener(self.opener)
37
40
 
38
41
        def on_activate_uri (self, scope, uri):
39
42
                print uri