/[schmitzm]/trunk/src/skrueger/Sitemap.java
ViewVC logotype

Diff of /trunk/src/skrueger/Sitemap.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1319 by alfonx, Wed Dec 1 01:09:52 2010 UTC revision 1320 by alfonx, Wed Dec 1 01:14:59 2010 UTC
# Line 33  import org.w3c.dom.Element; Line 33  import org.w3c.dom.Element;
33   */   */
34  public class Sitemap {  public class Sitemap {
35    
36          static String[] SEARCHENGINES = new String[] { "http://www.sitemapwriter.com/notify.php?crawler=all&url=" };          static String[] SEARCHENGINES = new String[] {
37                            "http://www.sitemapwriter.com/notify.php?crawler=all&url=",
38                            "http://submissions.ask.com/ping?sitemap=",
39                            "http://www.google.com/webmasters/tools/ping?sitemap=",
40                            "http://api.moreover.com/ping?u=",
41                            "http://www.bing.com/webmaster/ping.aspx?siteMap=",
42                            "http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=" };
43    
44          final static Logger log = Logger.getLogger(Sitemap.class);          final static Logger log = Logger.getLogger(Sitemap.class);
45    
# Line 181  public class Sitemap { Line 187  public class Sitemap {
187                  return size;                  return size;
188          }          }
189    
190          public static void submitToSearchEngines(String urlToSitemap)  {          public static void submitToSearchEngines(String urlToSitemap) {
191                  for (String se : SEARCHENGINES) {                  for (String se : SEARCHENGINES) {
192                          log.info("Submitting " + urlToSitemap + " to " + se);                          log.info("Submitting " + urlToSitemap + " to " + se);
193                          try {                          try {
194                                  URL url = new URL(se + urlToSitemap);                                  URL url = new URL(se + urlToSitemap);
195                                    
196                                  url.openConnection().connect();                                  url.openConnection().connect();
197                                    
198                          } catch (Exception e) {                          } catch (Exception e) {
199                                  log.error("failed to submit " + urlToSitemap + " to " + se, e);                                  log.error("failed to submit " + urlToSitemap + " to " + se, e);
200                          }                          }

Legend:
Removed from v.1319  
changed lines
  Added in v.1320

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26