diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..6373a52
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+BreakingNews.iml
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 69557e6..346e3c9 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -3,8 +3,6 @@
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 84b02df..b0c6b25 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,9 +4,13 @@
-
\ No newline at end of file
+
diff --git a/BreakingNews/.gradle/8.10/checksums/checksums.lock b/BreakingNews/.gradle/8.10/checksums/checksums.lock
new file mode 100644
index 0000000..8b6f9a1
Binary files /dev/null and b/BreakingNews/.gradle/8.10/checksums/checksums.lock differ
diff --git a/BreakingNews/.gradle/8.10/dependencies-accessors/gc.properties b/BreakingNews/.gradle/8.10/dependencies-accessors/gc.properties
new file mode 100644
index 0000000..e69de29
diff --git a/BreakingNews/.gradle/8.10/fileChanges/last-build.bin b/BreakingNews/.gradle/8.10/fileChanges/last-build.bin
new file mode 100644
index 0000000..f76dd23
Binary files /dev/null and b/BreakingNews/.gradle/8.10/fileChanges/last-build.bin differ
diff --git a/BreakingNews/.gradle/8.10/fileHashes/fileHashes.lock b/BreakingNews/.gradle/8.10/fileHashes/fileHashes.lock
new file mode 100644
index 0000000..e2dc5a1
Binary files /dev/null and b/BreakingNews/.gradle/8.10/fileHashes/fileHashes.lock differ
diff --git a/BreakingNews/.gradle/8.10/gc.properties b/BreakingNews/.gradle/8.10/gc.properties
new file mode 100644
index 0000000..e69de29
diff --git a/BreakingNews/.gradle/8.13/checksums/checksums.lock b/BreakingNews/.gradle/8.13/checksums/checksums.lock
new file mode 100644
index 0000000..5bb7bc6
Binary files /dev/null and b/BreakingNews/.gradle/8.13/checksums/checksums.lock differ
diff --git a/BreakingNews/.gradle/8.13/checksums/md5-checksums.bin b/BreakingNews/.gradle/8.13/checksums/md5-checksums.bin
new file mode 100644
index 0000000..21cf028
Binary files /dev/null and b/BreakingNews/.gradle/8.13/checksums/md5-checksums.bin differ
diff --git a/BreakingNews/.gradle/8.13/checksums/sha1-checksums.bin b/BreakingNews/.gradle/8.13/checksums/sha1-checksums.bin
new file mode 100644
index 0000000..21b87d7
Binary files /dev/null and b/BreakingNews/.gradle/8.13/checksums/sha1-checksums.bin differ
diff --git a/BreakingNews/.gradle/8.13/executionHistory/executionHistory.bin b/BreakingNews/.gradle/8.13/executionHistory/executionHistory.bin
new file mode 100644
index 0000000..f4a6641
Binary files /dev/null and b/BreakingNews/.gradle/8.13/executionHistory/executionHistory.bin differ
diff --git a/BreakingNews/.gradle/8.13/executionHistory/executionHistory.lock b/BreakingNews/.gradle/8.13/executionHistory/executionHistory.lock
new file mode 100644
index 0000000..c0521b7
Binary files /dev/null and b/BreakingNews/.gradle/8.13/executionHistory/executionHistory.lock differ
diff --git a/BreakingNews/.gradle/8.13/fileChanges/last-build.bin b/BreakingNews/.gradle/8.13/fileChanges/last-build.bin
new file mode 100644
index 0000000..f76dd23
Binary files /dev/null and b/BreakingNews/.gradle/8.13/fileChanges/last-build.bin differ
diff --git a/BreakingNews/.gradle/8.13/fileHashes/fileHashes.bin b/BreakingNews/.gradle/8.13/fileHashes/fileHashes.bin
new file mode 100644
index 0000000..00890d0
Binary files /dev/null and b/BreakingNews/.gradle/8.13/fileHashes/fileHashes.bin differ
diff --git a/BreakingNews/.gradle/8.13/fileHashes/fileHashes.lock b/BreakingNews/.gradle/8.13/fileHashes/fileHashes.lock
new file mode 100644
index 0000000..7d2b658
Binary files /dev/null and b/BreakingNews/.gradle/8.13/fileHashes/fileHashes.lock differ
diff --git a/BreakingNews/.gradle/8.13/fileHashes/resourceHashesCache.bin b/BreakingNews/.gradle/8.13/fileHashes/resourceHashesCache.bin
new file mode 100644
index 0000000..82c7bc3
Binary files /dev/null and b/BreakingNews/.gradle/8.13/fileHashes/resourceHashesCache.bin differ
diff --git a/BreakingNews/.gradle/8.13/gc.properties b/BreakingNews/.gradle/8.13/gc.properties
new file mode 100644
index 0000000..e69de29
diff --git a/BreakingNews/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/BreakingNews/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index 7fb0b08..180f554 100644
Binary files a/BreakingNews/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/BreakingNews/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/BreakingNews/.gradle/buildOutputCleanup/cache.properties b/BreakingNews/.gradle/buildOutputCleanup/cache.properties
index 7aea9a3..8f0f0f7 100644
--- a/BreakingNews/.gradle/buildOutputCleanup/cache.properties
+++ b/BreakingNews/.gradle/buildOutputCleanup/cache.properties
@@ -1,2 +1,2 @@
-#Sat Mar 01 16:55:21 GMT+03:30 2025
-gradle.version=8.12.1
+#Sat Mar 15 15:28:19 GMT+03:30 2025
+gradle.version=8.13
diff --git a/BreakingNews/.gradle/buildOutputCleanup/outputFiles.bin b/BreakingNews/.gradle/buildOutputCleanup/outputFiles.bin
index d80c6b9..92cef8c 100644
Binary files a/BreakingNews/.gradle/buildOutputCleanup/outputFiles.bin and b/BreakingNews/.gradle/buildOutputCleanup/outputFiles.bin differ
diff --git a/BreakingNews/.gradle/file-system.probe b/BreakingNews/.gradle/file-system.probe
index 06b60db..fccebc0 100644
Binary files a/BreakingNews/.gradle/file-system.probe and b/BreakingNews/.gradle/file-system.probe differ
diff --git a/BreakingNews/build.gradle b/BreakingNews/build.gradle
index ef49406..375cc15 100644
--- a/BreakingNews/build.gradle
+++ b/BreakingNews/build.gradle
@@ -1,5 +1,6 @@
plugins {
id 'java'
+ id 'application'
}
group = 'AP'
@@ -12,8 +13,18 @@ repositories {
dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
+ implementation 'com.google.code.gson:gson:2.8.9'
}
test {
useJUnitPlatform()
+}
+
+application {
+ mainClass = 'AP.Main'
+}
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_23
+ targetCompatibility = JavaVersion.VERSION_23
}
\ No newline at end of file
diff --git a/BreakingNews/build/classes/java/main/AP/Infrastructure.class b/BreakingNews/build/classes/java/main/AP/Infrastructure.class
new file mode 100644
index 0000000..e30c1a7
Binary files /dev/null and b/BreakingNews/build/classes/java/main/AP/Infrastructure.class differ
diff --git a/BreakingNews/build/classes/java/main/AP/Main.class b/BreakingNews/build/classes/java/main/AP/Main.class
index 9bdff65..3ce705b 100644
Binary files a/BreakingNews/build/classes/java/main/AP/Main.class and b/BreakingNews/build/classes/java/main/AP/Main.class differ
diff --git a/BreakingNews/build/classes/java/main/AP/News.class b/BreakingNews/build/classes/java/main/AP/News.class
new file mode 100644
index 0000000..ba63fbb
Binary files /dev/null and b/BreakingNews/build/classes/java/main/AP/News.class differ
diff --git a/BreakingNews/build/distributions/BreakingNews-1.0-SNAPSHOT.tar b/BreakingNews/build/distributions/BreakingNews-1.0-SNAPSHOT.tar
new file mode 100644
index 0000000..446d989
Binary files /dev/null and b/BreakingNews/build/distributions/BreakingNews-1.0-SNAPSHOT.tar differ
diff --git a/BreakingNews/build/distributions/BreakingNews-1.0-SNAPSHOT.zip b/BreakingNews/build/distributions/BreakingNews-1.0-SNAPSHOT.zip
new file mode 100644
index 0000000..56a9634
Binary files /dev/null and b/BreakingNews/build/distributions/BreakingNews-1.0-SNAPSHOT.zip differ
diff --git a/BreakingNews/build/libs/BreakingNews-1.0-SNAPSHOT.jar b/BreakingNews/build/libs/BreakingNews-1.0-SNAPSHOT.jar
new file mode 100644
index 0000000..33fac13
Binary files /dev/null and b/BreakingNews/build/libs/BreakingNews-1.0-SNAPSHOT.jar differ
diff --git a/BreakingNews/build/reports/problems/problems-report.html b/BreakingNews/build/reports/problems/problems-report.html
index 063921e..a2d58a5 100644
--- a/BreakingNews/build/reports/problems/problems-report.html
+++ b/BreakingNews/build/reports/problems/problems-report.html
@@ -650,12 +650,12 @@
diff --git a/BreakingNews/build/scripts/BreakingNews b/BreakingNews/build/scripts/BreakingNews
new file mode 100644
index 0000000..89f0bc3
--- /dev/null
+++ b/BreakingNews/build/scripts/BreakingNews
@@ -0,0 +1,250 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# BreakingNews start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh BreakingNews
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and BREAKING_NEWS_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}.." > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/lib/BreakingNews-1.0-SNAPSHOT.jar:$APP_HOME/lib/gson-2.8.9.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and BREAKING_NEWS_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and BREAKING_NEWS_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ -classpath "$CLASSPATH" \
+ AP.Main \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $BREAKING_NEWS_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/BreakingNews/build/scripts/BreakingNews.bat b/BreakingNews/build/scripts/BreakingNews.bat
new file mode 100644
index 0000000..7e4c927
--- /dev/null
+++ b/BreakingNews/build/scripts/BreakingNews.bat
@@ -0,0 +1,94 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem BreakingNews startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%..
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and BREAKING_NEWS_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\lib\BreakingNews-1.0-SNAPSHOT.jar;%APP_HOME%\lib\gson-2.8.9.jar
+
+
+@rem Execute BreakingNews
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %BREAKING_NEWS_OPTS% -classpath "%CLASSPATH%" AP.Main %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable BREAKING_NEWS_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%BREAKING_NEWS_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/Infrastructure.class.uniqueId2 b/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/Infrastructure.class.uniqueId2
new file mode 100644
index 0000000..2443b02
Binary files /dev/null and b/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/Infrastructure.class.uniqueId2 differ
diff --git a/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/Main.class.uniqueId0 b/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/Main.class.uniqueId0
new file mode 100644
index 0000000..3ce705b
Binary files /dev/null and b/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/Main.class.uniqueId0 differ
diff --git a/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/News.class.uniqueId1 b/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/News.class.uniqueId1
new file mode 100644
index 0000000..5dfd346
Binary files /dev/null and b/BreakingNews/build/tmp/compileJava/compileTransaction/stash-dir/News.class.uniqueId1 differ
diff --git a/BreakingNews/build/tmp/compileJava/previous-compilation-data.bin b/BreakingNews/build/tmp/compileJava/previous-compilation-data.bin
index 820d55a..c10e6dc 100644
Binary files a/BreakingNews/build/tmp/compileJava/previous-compilation-data.bin and b/BreakingNews/build/tmp/compileJava/previous-compilation-data.bin differ
diff --git a/BreakingNews/build/tmp/jar/MANIFEST.MF b/BreakingNews/build/tmp/jar/MANIFEST.MF
new file mode 100644
index 0000000..59499bc
--- /dev/null
+++ b/BreakingNews/build/tmp/jar/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
diff --git a/BreakingNews/gradle.bat b/BreakingNews/gradle.bat
new file mode 100644
index 0000000..e69de29
diff --git a/BreakingNews/src/main/java/AP/Infrastructure.java b/BreakingNews/src/main/java/AP/Infrastructure.java
index 84d4e6f..9bf00cb 100644
--- a/BreakingNews/src/main/java/AP/Infrastructure.java
+++ b/BreakingNews/src/main/java/AP/Infrastructure.java
@@ -1,11 +1,17 @@
package AP;
+import com.google.gson.Gson ;
+import com.google.gson.JsonArray ;
+import com.google.gson.JsonObject;
+
+import java.time.LocalDate;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
+import java.util.Scanner ;
public class Infrastructure {
@@ -17,8 +23,10 @@ public class Infrastructure {
public Infrastructure(String APIKEY) {
this.APIKEY = APIKEY;
- this.URL = "https://newsapi.org/v2/everything?q=tesla&from=2025-02-05&sortBy=publishedAt&apiKey=";
+ this.URL = "https://newsapi.org/v2/everything?q=tesla&from=" + LocalDate.now().minusDays(1) + "&sortBy=publishedAt&apiKey=";
this.JSONRESULT = getInformation();
+ this.newsList = new ArrayList<>();
+ parseInformation();
}
public ArrayList getNewsList() {
@@ -31,6 +39,9 @@ private String getInformation() {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(URL + APIKEY))
+// .header("User-Agent", "Java NewsAggregatorApp")
+// .header("Accept" , "application/json")
+// .header("Connection" , "keep-alive")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
@@ -49,12 +60,78 @@ private void parseInformation() {
// TODO: Get the first 20 news from the articles array of the json result
// and parse the information of each on of them to be mapped to News class
// finally add them to newsList in this class to display them in the output
+ try {
+ Gson gson = new Gson();
+ JsonObject jsonObject = gson.fromJson(JSONRESULT, JsonObject.class);
+ JsonArray articles = jsonObject.getAsJsonArray("articles");
+ for (int i = 0; i < Math.min(20, articles.size()); i++) {
+ JsonObject article = articles.get(i).getAsJsonObject();
+ News news = new News(
+ article.get("title").getAsString(),
+ article.get("description").getAsString(),
+ article.get("source").getAsJsonObject().get("name").getAsString(),
+ article.get("author") != null ? article.get("author").getAsString() : "Unknown",
+ article.get("url").getAsString(),
+ article.get("publishedAt").getAsString()
+ );
+ newsList.add(news);
+ }
+ } catch (Exception e) {
+ System.out.println("Error while parsing information: " + e.getMessage());
+ }
}
public void displayNewsList() {
// TODO: Display titles of the news you got from api
// and print them in a way that user can choose one
// to see the full information of the news
- }
+ for (int i = 0; i < newsList.size(); i++) {
+ System.out.println((i + 1) + ". " + newsList.get(i).getTitle());
+ }
+// Scanner scanner = new Scanner(System.in);
+// System.out.println("Enter the number of the news you want to see:");
+ int choice ;
+ for ( choice = 1; choice <= newsList.size(); choice++) {
+// if (choice > 0 && choice <= newsList.size()) {
+ newsList.get(choice - 1).displayNews();
+// } else {
+// System.out.println("Invalid choice");
+// }
+ }
+ }
}
+
+
+class News {
+
+ private String title ;
+ private String description ;
+ private String sourceName ;
+ private String author ;
+ private String url ;
+ private String publishedAt ;
+
+ public News(String title, String description, String sourceName, String author, String url, String publishedAt) {
+ this.title = title;
+ this.description = description;
+ this.sourceName = sourceName;
+ this.author = author;
+ this.url = url;
+ this.publishedAt = publishedAt;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void displayNews () {
+
+ System.out.println ("title: " + title) ;
+ System.out.println ("description: " + description) ;
+ System.out.println ("sourceName: " + sourceName) ;
+ System.out.println ("author: " + author) ;
+ System.out.println ("publishedAt: " + publishedAt);
+ }
+
+}
\ No newline at end of file
diff --git a/BreakingNews/src/main/java/AP/Main.java b/BreakingNews/src/main/java/AP/Main.java
index ae51d7d..b772413 100644
--- a/BreakingNews/src/main/java/AP/Main.java
+++ b/BreakingNews/src/main/java/AP/Main.java
@@ -1,7 +1,20 @@
package AP;
+import java.util.Scanner;
+
public class Main {
public static void main(String[] args) {
+// Scanner scanner = new Scanner(System.in);
+
+ // گرفتن API Key از کاربر
+// System.out.print("Please enter your API Key: ");
+ String apiKey = "0c2d4b40c8604ffe82df18376edcfcc8";
+
+ // ساخت نمونهای از کلاس Infrastructure
+ Infrastructure infrastructure = new Infrastructure(apiKey);
+ // نمایش لیست اخبار
+ System.out.println("Fetching news...");
+ infrastructure.displayNewsList();
}
}
\ No newline at end of file
diff --git a/d b/d
new file mode 100644
index 0000000..aa0c36c
--- /dev/null
+++ b/d
@@ -0,0 +1,153 @@
+[33mcommit 33fbbfb0b1123e6b69deb3ff6ebccecee35e9c22[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mdevelopment[m[33m, [m[1;31morigin/main[m[33m, [m[1;31morigin/HEAD[m[33m, [m[1;32mmain[m[33m)[m
+Author: Ali Taherzadeh
+Date: Thu Mar 6 12:37:35 2025 +0330
+
+ some dependencies added
+
+[33mcommit 3243039d512e9d2e9246fb89950d7e2630b9d500[m
+Author: Farid Karimi <118434072+Farid-Karimi@users.noreply.github.com>
+Date: Wed Mar 5 10:18:19 2025 +0330
+
+ Update README.md
+
+ changed criteria
+
+[33mcommit 542b84234da621061a9fdb21c50c78893d81d2ff[m
+Merge: 58d35d1 c158b62
+Author: Ali Taherzadeh <85833410+AliThz@users.noreply.github.com>
+Date: Wed Mar 5 10:04:20 2025 +0330
+
+ Merge pull request #1 from Advanced-Programming-1403/development
+
+[33mcommit c158b62f797bb6ca1ab383f3347b3dab1034c55d[m
+Author: Ali Taherzadeh
+Date: Wed Mar 5 09:58:13 2025 +0330
+
+ constructor overload removed
+
+[33mcommit f2c72ad766abcdd6c1b285f1ca302d7c1c359e11[m
+Author: Ali Taherzadeh
+Date: Wed Mar 5 09:51:11 2025 +0330
+
+ Report files merged
+
+[33mcommit 6a4d706c98dae9f300549db14a997d7154533e65[m
+Author: Ali Taherzadeh
+Date: Wed Mar 5 09:46:37 2025 +0330
+
+ Update url(news date) Infrastructure.java
+
+[33mcommit 1dab56ecf113bcab096602c2a9f5dca022aeb4c9[m
+Author: Ali Taherzadeh
+Date: Wed Mar 5 09:41:14 2025 +0330
+
+ Update Infrastructure.java
+
+[33mcommit fcc52a698b5053a8daaa3f28e655ad9124dc3f25[m
+Author: Ali Taherzadeh
+Date: Mon Mar 3 17:32:36 2025 +0330
+
+ Update README.md
+
+[33mcommit 3dda9857e8b8c178dce760ddf545910ade50ef03[m
+Author: Ali Taherzadeh
+Date: Mon Mar 3 17:16:02 2025 +0330
+
+ getNewsList method added Infrastructure.java
+
+[33mcommit b0f59b73c13773de6e3d9af713c20e2829158469[m
+Author: Ali Taherzadeh
+Date: Mon Mar 3 17:06:37 2025 +0330
+
+ Update README.md
+
+[33mcommit c7217fbe97654758e402fbe749aab26c1335f31f[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Mon Mar 3 08:47:14 2025 +0330
+
+ Update README.md
+
+[33mcommit 713672c8be36dd66312cb08c224a558f942528f6[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Mon Mar 3 08:44:49 2025 +0330
+
+ Update README.md
+
+[33mcommit 88ac52001f0f03a42c1318a1a03c69ed603ec74f[m
+Merge: ce36781 7fc55ab
+Author: Ali Taherzadeh
+Date: Mon Mar 3 08:36:13 2025 +0330
+
+ Merge remote-tracking branch 'origin/development' into development
+
+[33mcommit ce36781b9c434203cfbdde9c34183c0544c17cdc[m
+Author: Ali Taherzadeh
+Date: Mon Mar 3 08:31:01 2025 +0330
+
+ Infrastructure: displayNewsList method added
+
+[33mcommit 7bf05261f87af4e563260cbdc67f99bd64bbc516[m
+Author: Ali Taherzadeh
+Date: Mon Mar 3 08:30:34 2025 +0330
+
+ Infrastructure: parseInformation method added
+
+[33mcommit 213e85f64143c226c2508bb07a707b24835b2d63[m
+Author: Ali Taherzadeh
+Date: Mon Mar 3 08:30:03 2025 +0330
+
+ Infrastructure: constructor overloaded for getting url
+
+[33mcommit 7fc55ab5e8d4adb535e2d670ab89af20a4e7b00a[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Sun Mar 2 10:10:15 2025 +0330
+
+ Update README.md
+
+[33mcommit 5ed140acd322a2caaa7affdf7f889354b4744a66[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Sun Mar 2 09:00:39 2025 +0330
+
+ Update README.md
+
+[33mcommit 6e7eee4ff3f59f18a38fd0f8158817bd6d52b4d7[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Sun Mar 2 08:55:24 2025 +0330
+
+ Create Report-Template.md
+
+[33mcommit 511b310465e710a5f3747a6898dea3d2551c0079[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Sun Mar 2 08:52:18 2025 +0330
+
+ Update README.md
+
+[33mcommit 5daaf63165854723a0124243ad311f27c0da32e6[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Sun Mar 2 08:50:09 2025 +0330
+
+ Update README.md
+
+[33mcommit fbcf2d1d777dc99b8715bbdcbaae6c09a5219bbd[m
+Author: Daniel <160715078+TheDanielTp@users.noreply.github.com>
+Date: Sun Mar 2 08:49:48 2025 +0330
+
+ Update README.md
+
+[33mcommit 1ea1b4e23b98dec953974ecd4e3b4bd5b4d5fdb3[m
+Author: Ali Taherzadeh
+Date: Sun Mar 2 08:47:24 2025 +0330
+
+ project structure added
+
+[33mcommit 58d35d1ac470f791c3ea28d87b19c474e958b107[m
+Author: Ali Taherzadeh
+Date: Sat Mar 1 17:05:39 2025 +0330
+
+ initial commit
+
+[33mcommit 9e09dc6df84622fb20b40cf2fe6e6ebce3a42047[m
+Author: Ali Taherzadeh
+Date: Sat Mar 1 17:04:55 2025 +0330
+
+ initial commit