forked from mrepol742/mrepol742.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IndexNow.java
25 lines (22 loc) · 1002 Bytes
/
IndexNow.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.net.*;
import java.util.*;
import java.io.*;
class IndexNow {
private static String[] sg = new String[]{"/","/webvium/", "/webviumbeta", "/webviumdev/", "/webviumvpn/", "/rss.xml", "/sitemap.xml", "/link-tree/", "/project-orion/", "/search/", "/project-orion/chat/"};
private static String format = "https://bing.com/indexnow?url=https://mrepol742.github.io%1$s&key=f20756182df645f9b8cf6254654dd5da";
public static void main(String[] sga) throws IOException {
for (String da: sg) {
url(String.format(format, da));
System.out.println(String.format(format, da));
}
}
private static void url(String url) throws IOException {
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
int responseCode = con.getResponseCode();
System.out.println("POST Response Code :: " + responseCode);
if (responseCode != HttpURLConnection.HTTP_OK) {
System.out.println("Request not worked");
}
}
}