{ "info": { "author": "Josh Bronson", "author_email": "jabronson@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary", "Topic :: Internet :: WWW/HTTP :: Indexing/Search" ], "description": "galerts\n=======\n\n-----\nIntro\n-----\n\ngalerts is a Python client for managing `Google Alerts\n`_. Currently it resorts to scraping html from\nGoogle's web interface since there is as of yet no public API. If they ever\ndecide to publish one, galerts will switch to using it.\n\nPlease find `galerts on github `_\nif you have any questions or would like to collaborate.\n\n-----\nUsage\n-----\n\nFirst create an alerts manager for a given account::\n\n >>> import galerts\n >>> gam = galerts.GAlertsManager('cornelius@gmail.com', 'p4ssw0rd')\n\n(Note: The plaintext password is used only to get a session cookie, i.e. it's\nsent over a secure connection and then discarded.)\n\nNow you can access the existing alerts for that account via the ``alerts``\nproperty, which provides a generator you can use to iterate over corresponding\n``Alert`` objects::\n\n >>> list(gam.alerts)\n []\n\nLooks like we have one existing alert, but it has a typo. Let's fix it::\n\n >>> alert = next(gam.alerts)\n >>> alert.query\n u'Corner Confectionary'\n >>> alert.query = 'Corner Confectionery'\n >>> alert\n \n\nSo far we've only changed the value in memory; as far as Google knows, the\nalert still has the old value::\n\n >>> list(gam.alerts)\n []\n\nTo save the result to Google, do::\n\n >>> gam.update(alert)\n\nAnd now it should be updated::\n\n >>> list(gam.alerts)\n []\n\nYou may have noticed that the ``Alert.query`` property returns a ``unicode``\nvalue. Google allows alert queries with non-ASCII characters, so we support\nthis via unicode. For convenience, you can set ``Alert.query`` to a ``string``\ninstead of a ``unicode`` as we did above and it will be transformed to a\n``unicode`` automatically; just be sure that ``unicode(yourstring)`` doesn't\nfail.\n\nAs we see above, every time you access ``gam.alerts``, ``GAlertsManager`` asks\nGoogle for your alerts and creates new ``Alert`` objects with the information\nGoogle returned. It's okay (and desirable) that we may have one object\nrepresenting an alert which we can hold onto and manipulate while the manager\ncontinues to create new objects representing the same alert every time we\naccess ``gam.alerts``. The alerts returned by ``gam.alerts`` should be taken as\na snapshot of the information Google has at the time it was requested, rather\nthan as canonical representations of the data which are kept up-to-date.\n``Alert`` objects are disposable; they're used merely to wrap some string\nattributes. As such, you can pass any old ``Alert`` object to ``gam.update``\nand the manager will tell Google to update its information to match the object\npassed in. ``Alert.__eq__`` has been overridden so that two different\n``Alert`` objects with the same attribute values compare equal.\n\nKeeping this in mind, let's return to our old ``Alert`` object. Let's say we'd\nlike to change some other attributes::\n\n >>> alert.type\n 'Blogs'\n >>> alert.deliver\n 'Email'\n >>> alert.feedurl # we expect this to be None since it's an email alert\n None\n >>> alert.freq\n 'once a week'\n >>> alert.type = galerts.TYPE_COMPREHENSIVE\n >>> alert.deliver = galerts.DELIVER_FEED\n\nWe've just changed the type of results the alert delivers from only blog\nupdates to a comprehensive mix, and we changed the delivery method so that\nresults will now be delivered via feed rather than via email.\n\nAfter we pass this ``Alert`` object to ``gam.update``, our changes should stick,\nbut we'll have to grab a fresh ``Alert`` object if we want to know the url\nof the alert's feed::\n\n >>> gam.update(alert)\n >>> alert.feedurl # this is now stale\n None\n >>> oldalert = alert # so get a fresh one\n >>> alert = next(gam.alerts)\n >>> alert.feedurl # and now it's up-to-date:\n 'http://www.google.com/alerts/feed/...'\n >>> alert == oldalert # feedurls don't match\n False\n\nThe other properties are as we left them::\n\n >>> alert.query\n u'Corner Confectionery'\n >>> alert.type\n 'Comprehensive'\n >>> alert.deliver\n 'feed'\n\nExcept that when we change an email alert to a feed alert, Google automatically\nchanges the alert frequency to \"as-it-happens\", since new results are added to\nthe feed in real time as they are found. The new alert object's ``freq``\nproperty reflects this::\n\n >>> alert.freq\n 'as-it-happens'\n >>> oldalert.freq # stale\n 'once a week'\n\nLet's say we no longer want this alert. To delete it, do::\n\n >>> gam.delete(alert)\n >>> list(gam.alerts)\n []\n\nAnd to create a new alert::\n\n >>> query = 'Cake Man Cornelius'\n >>> type = galerts.TYPE_COMPREHENSIVE\n >>> gam.create(query, type)\n >>> list(gam.alerts)\n []\n\nNotice that we didn't specify whether we wanted an email alert or a feed alert.\nIn this case, ``GAlertsManager`` defaults to creating a feed alert. If we had\nwanted to create an email alert, we could have passed the additional keyword\nargument *feed=False* and an optional delivery frequency *freq* if we wanted\nsomething other than the default \"as-it-happens\".\n\nLet's demonstrate changing the feed alert we created to an email alert::\n\n >>> alert = next(gam.alerts)\n >>> str(alert)\n ''\n >>> alert.feedurl\n 'http://www.google.com/alerts/feed/...'\n >>> alert.deliver = galerts.DELIVER_EMAIL\n >>> alert.freq = galerts.FREQ_ONCE_A_DAY\n >>> gam.update(alert)\n\nAnd now::\n\n >>> alert = next(gam.alerts)\n >>> str(alert)\n ''\n >>> alert.feedurl\n None", "description_content_type": null, "docs_url": "https://pythonhosted.org/galerts/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://jab.github.com/galerts/", "keywords": "google,alerts,google alerts,news", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "galerts", "package_url": "https://pypi.org/project/galerts/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/galerts/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://jab.github.com/galerts/" }, "release_url": "https://pypi.org/project/galerts/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Python libary for managing Google Alerts", "version": "0.1.5" }, "last_serial": 1622936, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "69a793aba56a8edc063846088e958631", "sha256": "faf005a5f0eaf3854d505f215873290af6abf2abca554567af3baa000428d0d1" }, "downloads": -1, "filename": "galerts-0.1.4.tar.gz", "has_sig": false, "md5_digest": "69a793aba56a8edc063846088e958631", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14627, "upload_time": "2009-12-01T17:37:16", "url": "https://files.pythonhosted.org/packages/30/d0/e9d05a25e7b70f098cdcfbbcc8062178bcc4be99e8a76580683abc2b268e/galerts-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "db0a480c3b6c0cb31de75950cc9a94c9", "sha256": "bd7f7bf8078b7e3892aac97a4c187450572da5100d8ce83c2cea63d7fed93053" }, "downloads": -1, "filename": "galerts-0.1.5.tar.gz", "has_sig": false, "md5_digest": "db0a480c3b6c0cb31de75950cc9a94c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 99701, "upload_time": "2009-12-10T23:53:11", "url": "https://files.pythonhosted.org/packages/6c/dc/54111a4ee454b1ad1cbdbf72829716de58c98c1c747592efec6cd682d360/galerts-0.1.5.tar.gz" } ], "0.2.0dev": [ { "comment_text": "", "digests": { "md5": "456098b3ea33355f7b427d0a28ebaa93", "sha256": "3359bd8b29cd039eded0a0b6a101c99e30966ccf68416e372fc229b91f7470ac" }, "downloads": -1, "filename": "galerts-0.2.0dev.tar.gz", "has_sig": false, "md5_digest": "456098b3ea33355f7b427d0a28ebaa93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 116197, "upload_time": "2011-01-05T23:30:18", "url": "https://files.pythonhosted.org/packages/40/4f/b451096c234f3dcf642fd6df11d4c0677b2a3b8be56974ef0ee166129768/galerts-0.2.0dev.tar.gz" } ], "0.2.1dev": [ { "comment_text": "", "digests": { "md5": "09e4dd9b818ef93dbca2b9570acc43e7", "sha256": "f6750a236343070e656c31f7beedda4b8ffaa2cc7f92e6dbe0c333940f150801" }, "downloads": -1, "filename": "galerts-0.2.1dev.tar.gz", "has_sig": false, "md5_digest": "09e4dd9b818ef93dbca2b9570acc43e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15647, "upload_time": "2011-01-24T21:39:28", "url": "https://files.pythonhosted.org/packages/5a/d3/e89a7b86b6d943f97cc30e1cc989fbcece75854bda76f9f2c4c8a02c9138/galerts-0.2.1dev.tar.gz" } ], "0.2.2dev": [ { "comment_text": "", "digests": { "md5": "8e8dedf565ff00be96d3077fdf335be4", "sha256": "c7b4bb354c77c6aec2b65c254655123a881dd26f8bb8207ef4bea6f5de0bdc04" }, "downloads": -1, "filename": "galerts-0.2.2dev.tar.gz", "has_sig": false, "md5_digest": "8e8dedf565ff00be96d3077fdf335be4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15674, "upload_time": "2011-02-24T03:06:48", "url": "https://files.pythonhosted.org/packages/ef/33/dbade65be7cddd82f37d9017bc8d89e0b28a45a72df5702df62b89dab867/galerts-0.2.2dev.tar.gz" } ], "0.2.3dev": [ { "comment_text": "", "digests": { "md5": "d84ea7e53641abf130b439323c1dba67", "sha256": "2eda3f1235553f71e38e7e8a9eb3d3654f099e67a4b3de210567e9bc810d62d6" }, "downloads": -1, "filename": "galerts-0.2.3dev.tar.gz", "has_sig": false, "md5_digest": "d84ea7e53641abf130b439323c1dba67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15641, "upload_time": "2011-04-14T20:02:37", "url": "https://files.pythonhosted.org/packages/7a/80/20eec644d2b3c2aa10e90fac9e7c9391bb9d8842010ed774cd31ff4342b8/galerts-0.2.3dev.tar.gz" } ], "0.2.4dev": [ { "comment_text": "", "digests": { "md5": "88e2a4b32abe5b0a592931f0d1c40ebe", "sha256": "62182af20471889f0b3983f625fb64743eaf954fb405dbc9cbb85538a569c1dd" }, "downloads": -1, "filename": "galerts-0.2.4dev.tar.gz", "has_sig": false, "md5_digest": "88e2a4b32abe5b0a592931f0d1c40ebe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15659, "upload_time": "2011-10-07T01:51:21", "url": "https://files.pythonhosted.org/packages/18/75/4dd90f0f4c84e9682d6f587e7bde18f37fab3096878043a1c7cf460eee47/galerts-0.2.4dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db0a480c3b6c0cb31de75950cc9a94c9", "sha256": "bd7f7bf8078b7e3892aac97a4c187450572da5100d8ce83c2cea63d7fed93053" }, "downloads": -1, "filename": "galerts-0.1.5.tar.gz", "has_sig": false, "md5_digest": "db0a480c3b6c0cb31de75950cc9a94c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 99701, "upload_time": "2009-12-10T23:53:11", "url": "https://files.pythonhosted.org/packages/6c/dc/54111a4ee454b1ad1cbdbf72829716de58c98c1c747592efec6cd682d360/galerts-0.1.5.tar.gz" } ] }