Code Monkey home page Code Monkey logo

google-alert-api's Introduction

google-alert-api v2

A java library allow user get, create, delete, update google alert.

Compiled with java version 1.7

Updated Date:

11/08/2016 (Version 2) - UTC +08:00 - Singapore Time

Issues:

Fixed language issue, the language result is incorrect;

Notes:

Please see the email that your Google Alert using (may be the alert is using uppercase or lowercase) So GAService("[email protected]", "pass") will different with GAService("[email protected]", "pass")

Required libraries

No required

Usage

// First of all, we have to login. return true string if login successful else return false

GAService service = new GAService("yourGmail", "yourPassword");
service.doLogin();

-- // Get all alerts.

List lstAlert = service.getAlerts();

-- // Get alert by delivery.

List lstAlert = service.getAlertByDelivery(DeliveryTo.FEED);

-- // Get alert by id.

Alert alert = service.getAlertById(alertId);

-- // Get alert by search query.

List lstAlert = service.getAlertsByQuery("Your Query");

-- // Create alert. return an alert id if created successful else return an error string // Default deliver is email

Alert alert = new Alert();
alert.setHowMany(HowMany.ONLY_THE_BEST_RESULTS);
alert.setHowOften(HowOften.ONCE_A_DAY);
alert.setResultType(ResultType.EVERYTHING);
alert.setSearchQuery("Your Query");
alert.setDeliveryTo(DeliverTo.FEED);
String id = service.createAlert(alert);

-- // Delete an alert.

service.deleteAlert(alertId);

-- // Delete list of alerts.

List lstAlertId = new ArrayList();
lstAlertId.add(alertId);
service.deleteAlert(lstAlertId);

-- // Update alert. return empty string if updated successful else return an error string

AlertBean alert = new AlertBean();
alert.setId(editAlertId);
alert.setHowMany(HowMany.ONLY_THE_BEST_RESULTS);
alert.setHowOften(HowOften.ONCE_A_DAY);
alert.setSearchQuery("your new query");
alert.setDeliverTo(DeliverTo.FEED);
service.updateAlert(alert);

-- Please contact me at [email protected] if you found any issues.

Happy coding.

google-alert-api's People

Contributors

nnhiti avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.