Skip to content

Commit

Permalink
Issue #91: Updated sitemap.jsp after number API change.
Browse files Browse the repository at this point in the history
  • Loading branch information
haumacher committed Nov 30, 2024
1 parent 8cd015f commit 4cf4f0e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions phoneblock/src/main/webapp/sitemap.jsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<%@page import="de.haumacher.phoneblock.db.model.NumberInfo"%>
<%@page pageEncoding="UTF-8" contentType="application/xml; charset=UTF-8" session="false"
%><%@page import="java.util.Calendar"
%><%@page import="java.util.GregorianCalendar"
Expand Down Expand Up @@ -81,14 +82,14 @@
String count = request.getParameter("count");
int pages = count == null ? 2000 : Integer.parseInt(count);
long now = System.currentTimeMillis();
List<? extends SpamReport> reports = db.getAll(pages);
List<? extends NumberInfo> reports = db.getAll(pages);
long oneWeekBefore = now - 1000L*60*60*24*7;
for (SpamReport report : reports) {
for (NumberInfo report : reports) {
%>
<url>
<loc>https://phoneblock.net/phoneblock/nums/<%=report.getPhone() %></loc>
<lastmod><%= format.format(new Date(report.getLastUpdate())) %></lastmod>
<changefreq><%= report.getLastUpdate() < oneWeekBefore ? "weekly" : "daily" %></changefreq>
<lastmod><%= format.format(new Date(report.getUpdated())) %></lastmod>
<changefreq><%= report.getUpdated() < oneWeekBefore ? "weekly" : "daily" %></changefreq>
<priority>0.3</priority>
</url>
<%
Expand Down

0 comments on commit 4cf4f0e

Please sign in to comment.