salam every one, this is a topic from google web master centrale blog:
Recently we mentioned some updates in the Webmaster Tools GData API: we've just launched a whole new API, the Message Center GData API, as part of the Webmaster Tools API. The Message Center is the way that Google communicates to webmasters important issues regarding their sites—for example, if there's a problem crawling your site, or if someone has requested a change in crawl rate. Until now it was only possible to access these messages through the Message Center section of Webmaster Tools; but now you can also use GData to access it as a feed. This way you don't need to continually check your messages in Webmaster Tools, you can retrieve the messages feed automatically and be informed as soon as possible of any critical issues regarding your site. this is a topic published in 2013... to get contents for your blog or your forum, just contact me at: devnasser@gmail.com
What can I do? The Message Center GData API lets you retrieve all messages, mark the messages as read or unread, and delete messages. You can do these tasks using the provided Java client libraries, or you can create your own client code based on the protocol information.
You can download code samples in Java for all these new features. These samples provide simple ways to use the messages feed. The following snippet shows how to retrieve the messages feed in a supported language and print all the messages: // Connect with the service and authenticate WebmasterToolsService service = new WebmasterToolsService("exampleCo-exampleApp-1"); try { service.setUserCredentials(USERNAME, PASSWORD); } catch (AuthenticationException e) { System.out.println("Username or password invalid"); return; } // Retrieve messages feed MessagesFeed messages; try { URL feedUrl; if (USER_LANGUAGE == null) { feedUrl = new URL(MESSAGES_FEED_URI); } else { feedUrl = new URL(MESSAGES_FEED_URI + "?hl=" + USER_LANGUAGE); } messages = service.getFeed(feedUrl, MessagesFeed.class); } catch (IOException e) { System.out.println("There was a network error."); return; } catch (ServiceException e) { System.out.println("The service is not available."); return; } // Print the messages feed System.out.println(messages.getTitle().getPlainText()); for (MessageEntry entry : messages.getEntries()) { if (entry.getRead()) { System.out.print(" \t"); } else { System.out.print("new\t"); } System.out.print(entry.getDate().toUiString() + "\t"); System.out.println(entry.getSubject()); } Where do I get it? If you want to know more about GData, you may want to start by checking out the GData website. The homepage of the Webmaster Tools GData API contains a section on the messages feed, with details about the protocol. You can also download the sample Message Center client form the GData download site. It will show you how to use all the Message Center GData API features. |
Labels: