Models a Google Alert.
You should not create Alert objects explicitly; the GAlertsManager will create them for you. You can then access alert objects via GAlertsManager.alerts to e.g. update their attributes and pass them back to the manager for saving. To create a new alert, use GAlertsManager.create, and when you next access GAlertsManager.alerts you’ll find an Alert object there for the alert you just created.
The delivery method for this alert.
Raises: | ValueError if value is not in DELIVER_TYPES (DELIVER_FEED, DELIVER_EMAIL) |
---|
For feed alerts, returns the url of the feed results are delivered to. For email alerts, returns None.
Note: If you change an Alert object from a feed alert to an email alert (or vice versa) via Alert.deliver, the value of Alert.feedurl is not updated. You must pass the alert to GAlertsManager.update to save the changes and then get a fresh Alert object from GAlertsManager.alerts to get the up-to-date feed url.
The frequency with which results are delivered for this alert.
Raises: | ValueError if value is not in ALERT_FREQS, (FREQ_AS_IT_HAPPENS, FREQ_ONCE_A_DAY, FREQ_ONCE_A_WEEK) |
---|
The search terms this alert will match.
Raises: | ValueError if value is not unicode or unicode(value) fails, or if its length exceeds QUERY_MAXLEN |
---|
The type of the results this alert delivers.
Raises: | ValueError if value is not in ALERT_TYPES (TYPE_NEWS, TYPE_BLOGS, TYPE_WEB, TYPE_COMPREHENSIVE, TYPE_VIDEO, TYPE_GROUPS) |
---|
Manages creation, modification, and deletion of Google Alerts for the Google account associated with email.
Resorts to html scraping because no public API has been released.
Note: multiple email addresses can be associated with a single Google account, and if a user with multiple email addresses associated with her Google account signs into the web interface, it will allow her to set the delivery of email alerts to any of her associated email addresses. However, for now, GAlertsManager always uses the email address it’s instantiated with when creating new email alerts or changing feed alerts to email alerts.
Parameters: |
|
---|---|
Raises: | SignInError if Google responds with “403 Forbidden” to our request to sign in |
Raises: | UnexpectedResponseError if the status code of Google’s response is unrecognized (neither 403 nor 200) |
Raises: | socket.error e.g. if there is no network connection |
Creates a new alert.
Parameters: |
|
---|