0.0.1.6bis
This commit is contained in:
1 parent
c6c7b99334
commit
97649d73eb
135 files changed
+2283
-6075
No files matched your search
@@ -1,4 +1,4 @@
|
||||
#Thu Sep 10 12:58:40 CEST 2026
|
||||
#Tue Sep 29 23:22:28 CEST 2026
|
||||
display=\:0
|
||||
process-id=7
|
||||
user=kotama
|
||||
+552
@@ -1567,3 +1567,555 @@ Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not know
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-10 12:58:41.272
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-10 21:57:38.860 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-10 21:57:42.766
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-10 21:57:45.609
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-10 21:57:45.610
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-10 21:57:46.239
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-11 11:39:55.169 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-11 11:40:00.350
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-11 11:40:37.371
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-11 11:40:37.371
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-11 11:40:38.326
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-14 14:55:55.714 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-14 14:56:00.844
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-14 14:56:04.427
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-14 14:56:04.428
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-14 14:56:05.322
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-14 21:37:05.431 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-14 21:37:10.798
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-14 21:37:14.777
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-14 21:37:14.777
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-14 21:37:15.772
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-17 09:20:49.551 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-17 09:20:54.024
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-17 09:20:59.575
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-17 09:20:59.576
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-17 09:21:00.421
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-17 09:26:55.154 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-17 09:26:59.718
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-17 09:27:02.788
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-17 09:27:02.788
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-17 09:27:03.593
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-21 09:08:00.914 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-21 09:08:05.459
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-21 09:08:18.507
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-21 09:08:18.507
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-21 09:08:19.552
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-21 12:25:51.646 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-21 12:25:55.509
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-21 12:26:06.489
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-21 12:26:06.490
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-21 12:26:07.112
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-22 08:09:23.825 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-22 08:09:28.354
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-22 08:09:33.010
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-22 08:09:33.010
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-22 08:09:33.837
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-22 16:37:04.308 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-22 16:37:08.882
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-22 16:37:12.115
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-22 16:37:12.115
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-22 16:37:12.964
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-25 09:23:19.150 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-25 09:23:23.039
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-25 09:23:35.898
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-25 09:23:35.898
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-25 09:23:36.546
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
!SESSION 2026-09-29 23:22:14.979 -----------------------------------------------
|
||||
eclipse.buildId=4.40.0.20260604-0652
|
||||
java.version=21.0.11
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
|
||||
Framework arguments: -product org.eclipse.epp.package.java.product
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-29 23:22:18.801
|
||||
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-29 23:22:28.187
|
||||
!MESSAGE Failed to read host name.
|
||||
|
||||
!ENTRY org.eclipse.ui.ide 4 0 2026-09-29 23:22:28.187
|
||||
!MESSAGE Failed to read host name.
|
||||
!STACK 0
|
||||
java.net.UnknownHostException: CelesteKC-PC: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1936)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.getHostName(IDEApplication.java:493)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:434)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:375)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:179)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1387)
|
||||
Caused by: java.net.UnknownHostException: CelesteKC-PC: Name or service not known
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
|
||||
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
|
||||
at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)
|
||||
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)
|
||||
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)
|
||||
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)
|
||||
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1931)
|
||||
... 15 more
|
||||
|
||||
!ENTRY ch.qos.logback.classic 1 0 2026-09-29 23:22:28.792
|
||||
!MESSAGE Logback config file: /home/kotama/Silly-Jirafe/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.101.20251017-1242.xml
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray();
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodeBergApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "CadeBergApi";
|
||||
}
|
||||
|
||||
public String getURL(int page) {
|
||||
return "https://codeberg.org/api/v1/repos/search?page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "codeberg", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public static Map<String, String> read()
|
||||
{
|
||||
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
Map<String, String> ApiKeys = new HashMap();
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
ApiKeys.put(bind, password);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?per_page=200&page=" + page + "&key=" + apikey;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("hits");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = "CC0";
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("full_name");
|
||||
String password = key.getString("key");
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
public class ApiKeys {
|
||||
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1,
|
||||
rnd TEXT NOT NULL DEFAULT 'a'
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName());
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public int getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1,
|
||||
rnd TEXT NOT NULL DEFAULT 'a'
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
public static String NextLetter(String actual) {
|
||||
char lettre = actual.charAt(0);
|
||||
|
||||
if (lettre >= 'z') {
|
||||
return "a";
|
||||
}
|
||||
|
||||
char suivante = (char) (lettre + 1);
|
||||
return String.valueOf(suivante);
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read()
|
||||
{
|
||||
File file = new File("ApiKeys.json");
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read()
|
||||
{
|
||||
File myObj = new File("ApiKeys.json");
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("example.txt");
|
||||
try {
|
||||
List<String> lines = Files.readString(filePath);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
Map<String, String> ApiKeys = new;
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
Apis.add(new CodeBergApi()));
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class GitHubLGPLApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "GitHubLGPLApi";
|
||||
}
|
||||
|
||||
public String getURL(int page) {
|
||||
return "https://api.github.com/search/repositories?q=license:lgpl-3.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
Map<String, String> ApiKeys = new HashMap();
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
-29
@@ -1,29 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.json.JSONML;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read()
|
||||
{
|
||||
List<String> lines = Files.readAllLines(Paths.get("filename.txt"));
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class GitHubLGPLApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "GitHubLGPLApi";
|
||||
}
|
||||
|
||||
public String getURL(int page) {
|
||||
return "https://api.github.com/search/repositories?q=license:lgpl-3.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();8
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.*;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
Apis.add(new PixabayImagesApi());
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodeBergApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "CadeBergApi";
|
||||
}
|
||||
|
||||
public String getURL(int page) {
|
||||
return "https://codeberg.org/api/v1/repos/search?page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
public class ApiKeys {
|
||||
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
public class ApiKeys {
|
||||
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public int getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("rnd");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
|
||||
public class ApiKeys {
|
||||
public void read()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
-127
@@ -1,127 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1,
|
||||
rnd TEXT NOT NULL DEFAULT 'a'
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName, int maxPage) throws SQLException {
|
||||
int pageActuelle = getPage(bindName);
|
||||
String rndActuel = getRND(bindName);
|
||||
|
||||
int nouvellePage;
|
||||
String nouveauRnd;
|
||||
|
||||
if (pageActuelle >= maxPage) {
|
||||
nouvellePage = 1;
|
||||
nouveauRnd = NextLetter(rndActuel);
|
||||
} else {
|
||||
nouvellePage = pageActuelle + 1;
|
||||
nouveauRnd = rndActuel;
|
||||
}
|
||||
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = ?, rnd = ?
|
||||
""";
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.setInt(2, nouvellePage);
|
||||
ps.setString(3, nouveauRnd);
|
||||
ps.setInt(4, nouvellePage);
|
||||
ps.setString(5, nouveauRnd);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
public static String NextLetter(String actual) {
|
||||
char[] lettres = actual.toCharArray();
|
||||
int i = lettres.length - 1;
|
||||
|
||||
while (i >= 0) {
|
||||
if (lettres[i] < 'z') {
|
||||
lettres[i]++;
|
||||
return new String(lettres);
|
||||
}
|
||||
lettres[i] = 'a';
|
||||
i--;
|
||||
}
|
||||
|
||||
return "a" + new String(lettres);
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
String jsonraw = Files.readString(filePath);
|
||||
}
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodeBergApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "GitHubMITApi";
|
||||
}
|
||||
|
||||
public String getURL(int page) {
|
||||
return "https://api.github.com/search/repositories?q=license:mit&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("example.txt");
|
||||
try {
|
||||
List<String> lines = Files.readAllLines(filePath);
|
||||
for (String line : lines) {
|
||||
System.out.println(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public int getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?per_page=200&page=" + page + "&key=" + apikey;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = "CC0";
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
public class ApiKeys {
|
||||
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1,
|
||||
rnd TEXT NOT NULL DEFAULT 'a'
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1,
|
||||
rnd TEXT NOT NULL DEFAULT 'a'
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
public static String lettreSuivante(String actuelle) {
|
||||
char lettre = actuelle.charAt(0);
|
||||
|
||||
if (lettre >= 'z') {
|
||||
return "a";
|
||||
}
|
||||
|
||||
char suivante = (char) (lettre + 1);
|
||||
return String.valueOf(suivante);
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String Jsonraw = Files.readString(filePath);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject(Jsonraw);
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?page=" + page + "key=" + apikey;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.CodeBergApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
Apis.add(new CodeBergApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
File file = new File("ApiKeys.json");
|
||||
try (Scanner Reader = new Scanner(file)) {
|
||||
Reader.all
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("pageURL");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject keys = items.getJSONObject(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesApi";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?per_page=200&page=" + page + "&key=" + apikey;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("hits");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = "CC0";
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("example.txt");
|
||||
try {
|
||||
List<String> lines = Files.readString(filePath)
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
Map<String, String> ApiKeys = new HashMap();
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public int getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.json.JSONML;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Map<String, String> ApiKeys = new HashMap();
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public static Map<String, String> read()
|
||||
{
|
||||
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
Map<String, String> ApiKeys = new HashMap();
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
ApiKeys.put(bind, password);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()))
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-80
@@ -1,80 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read()
|
||||
{
|
||||
File file = new File("ApiKeys.json");
|
||||
try (Scanner myReader = new Scanner(myObj)) {
|
||||
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.*;
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
Apis.add(new PixabayImagesApi());
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?page=" + page + "key=" + apikey;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = "CC0";
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.CodeBergApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public static Map<String, String> read()
|
||||
{
|
||||
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
Map<String, String> ApiKeys = new HashMap();
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
ApiKeys.put(bind, password);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.*;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
import org.sillyjirafe.uoapi.binds.PixabayImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
Apis.add(new PixabayImagesApi());
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class OpenVerseAudiosApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "OpenVerseAudiosApi";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.openverse.org/v1/audio/?format=json&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("results");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject image = items.getJSONObject(i);
|
||||
|
||||
String titre = image.getString("title");
|
||||
String url = image.getString("url");
|
||||
String licence = image.getString("license");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "openverse", "audio"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?page=" + page + "key=" + apikey;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Map<String, String> ApiKeys = new();
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
JSONArray items = json.getJSONArray("keys");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject key = items.getJSONObject(i);
|
||||
String bind = key.getString("bind");
|
||||
String password = key.getString("key");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
File file = new File("ApiKeys.json");
|
||||
try (Scanner Reader = new Scanner(file)) {
|
||||
Reader.all
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodeBergApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "CadeBergApi";
|
||||
}
|
||||
|
||||
public String getURL(int page) {
|
||||
return "https://codeberg.org/api/v1/repos/search?page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("data");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "codeberg", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class OpenVerseAudiosApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "OpenVerseAudiosApi";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.openverse.org/v1/audio/?format=json&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("results");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject image = items.getJSONObject(i);
|
||||
|
||||
String titre = image.getString("title");
|
||||
String url = image.getString("url");
|
||||
String licence = image.getString("license");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "openverse", "audio"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package org.sillyjirafe.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Crawl_StateDB
|
||||
{
|
||||
String URL = new String();
|
||||
String insertSql = "INSERT OR IGNORE INTO crawlstates (bind_name, last_page, rnd) VALUES (?, ?, ?)";
|
||||
Connection connection;
|
||||
|
||||
public Crawl_StateDB(String BDstr) throws SQLException
|
||||
{
|
||||
URL = BDstr;
|
||||
connection = DriverManager.getConnection(URL);
|
||||
}
|
||||
|
||||
public void LinkToDB() throws SQLException
|
||||
{
|
||||
try (Statement stmt = connection.createStatement())
|
||||
{
|
||||
stmt.execute("""
|
||||
CREATE TABLE IF NOT EXISTS crawlstates (
|
||||
bind_name TEXT PRIMARY KEY,
|
||||
last_page INTEGER NOT NULL DEFAULT 1,
|
||||
rnd TEXT NOT NULL DEFAULT a
|
||||
)
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEllement(String bind, int lastpage) throws SQLException
|
||||
{
|
||||
try (PreparedStatement ps = connection.prepareStatement(insertSql))
|
||||
{
|
||||
ps.setString(1, bind);
|
||||
ps.setInt(2, lastpage);
|
||||
ps.executeUpdate();
|
||||
System.out.printf("%s is now page %d \n", bind, lastpage);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPage(String bindName) throws SQLException {
|
||||
String sql = "SELECT last_page FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getInt("last_page");
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getRND(String bindName) throws SQLException {
|
||||
String sql = "SELECT rnd FROM crawlstates WHERE bind_name = ?";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
if (rs.next()) {
|
||||
return rs.getString("rnd");
|
||||
} else {
|
||||
return "a";
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updatePage(String bindName) throws SQLException {
|
||||
String sql = """
|
||||
INSERT INTO crawlstates (bind_name, last_page) VALUES (?, 2)
|
||||
ON CONFLICT(bind_name) DO UPDATE SET last_page = last_page + 1
|
||||
""";
|
||||
|
||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||
ps.setString(1, bindName);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() throws SQLException
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
}
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GitHubMITApi implements Api
|
||||
{
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "GitHubMITApi";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:mit&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public void read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "GitHubApacheApi";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://pixabay.com/api/?page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("pageURL");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()),ApiKeys.get(Apis.get(i).getName());
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()),ApiKeys.get(Apis.get(i).getName();
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read() throws FileNotFoundException
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package org.sillyjirafe.json;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ApiKeys {
|
||||
public Map<String, String> read()
|
||||
{
|
||||
Path filePath = Paths.get("ApiKeys.json");
|
||||
try {
|
||||
String jsonraw = Files.readString(filePath);
|
||||
JSONObject json = new JSONObject(jsonraw);
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("I/O error: " + e.getMessage());
|
||||
} catch (SecurityException e) {
|
||||
System.err.println("Access denied: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "github", "code"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package org.sillyjirafe.uoapi.binds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.sillyjirafe.uoapi.Api;
|
||||
import org.sillyjirafe.uoapi.element;
|
||||
|
||||
public class PixabayImagesApi implements Api
|
||||
{
|
||||
public String getName()
|
||||
{
|
||||
return "PixabayImagesAPI";
|
||||
}
|
||||
|
||||
public String getURL(int page, String apikey) {
|
||||
return "https://api.github.com/search/repositories?q=license:apache-2.0&page=" + page;
|
||||
}
|
||||
|
||||
public List<element> Parse(String jsonRaw) {
|
||||
List<element> resultats = new ArrayList<>();
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(jsonRaw);
|
||||
JSONArray items = json.getJSONArray("items");
|
||||
|
||||
for (int i = 0; i < items.length(); i++) {
|
||||
JSONObject repo = items.getJSONObject(i);
|
||||
|
||||
String titre = repo.getString("full_name");
|
||||
String url = repo.getString("html_url");
|
||||
String licence = repo.getJSONObject("license").getString("spdx_id");
|
||||
|
||||
resultats.add(new element(titre, url, licence, "pixabay", "image"));
|
||||
}
|
||||
} catch (org.json.JSONException e) {
|
||||
System.out.println("error but continue : " + e.getMessage());
|
||||
}
|
||||
|
||||
return resultats;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package org.sillyjirafe.uoapi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sillyjirafe.uoapi.binds.GitHubApacheApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubLGPLApi;
|
||||
import org.sillyjirafe.uoapi.binds.GitHubMITApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseAudiosApi;
|
||||
import org.sillyjirafe.uoapi.binds.OpenVerseImagesApi;
|
||||
|
||||
public class Out {
|
||||
List<Api> Apis = new ArrayList<>();
|
||||
|
||||
public List<String> PreOut()
|
||||
{
|
||||
Apis.add(new GitHubMITApi());
|
||||
Apis.add(new GitHubLGPLApi());
|
||||
Apis.add(new GitHubApacheApi());
|
||||
Apis.add(new OpenVerseImagesApi());
|
||||
Apis.add(new OpenVerseAudiosApi());
|
||||
Apis.add(new PixabayImagesApi());
|
||||
List<String> bindnames = new ArrayList<>();
|
||||
|
||||
for (Api api : Apis)
|
||||
{
|
||||
bindnames.add(api.getName());
|
||||
}
|
||||
|
||||
return bindnames;
|
||||
}
|
||||
|
||||
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
||||
{
|
||||
List<element> Elements = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < Apis.size(); i++)
|
||||
{
|
||||
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName()));
|
||||
for (int j = 0; j < currentapi.size(); j++)
|
||||
{
|
||||
Elements.add(currentapi.get(j));
|
||||
}
|
||||
}
|
||||
return Elements;
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Loaded 100 of 135 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user