Fixed up some gitignore. Added readme info

This commit is contained in:
William Lewis 2024-11-21 19:05:05 -06:00
parent 68ec9d52ed
commit f2c8aff951
14 changed files with 31 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
target/
.vscode/
tomcat-binaries/
src/main/amazon-scrapi/WEB-INF/classes/
src/main/amazon-scrapi/WEB-INF/lib/

View File

@ -2,6 +2,9 @@
An API interface with Amazon, that uses webscraping
# Development Resources
- [Intro to servlets](https://dev.to/dilanka-rathnasiri/introduction-to-java-servlets-32oc)
# Development Environment Setup
## VSCode / VSCodium

View File

@ -42,8 +42,9 @@
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<webappDirectory>src/main/webapp</webappDirectory>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
<webappDirectory>src/main/amazon-scrapi</webappDirectory>
<webXml>src/main/amazon-scrapi/WEB-INF/web.xml</webXml>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>

View File

@ -1,6 +1,7 @@
package com.veritablevalor.blizliam;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@ -12,6 +13,10 @@ import com.microsoft.playwright.Browser;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
@WebServlet(
value = "/hello",
name = "hello"
)
public class App extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
@ -24,10 +29,20 @@ public class App extends HttpServlet {
Page page = browser.newPage();
page.navigate(url);
page.
boolean loggedIn = page.getByText("Hello, sign in").count() <= 0;
System.out.println(page.title());
out.println("Here is the page.title: " + page.title());
if (loggedIn)
{
out.println("Logged in");
}
else
{
out.println("Logged out");
}
}
out.close();

View File

@ -0,0 +1,5 @@
package com.veritablevalor.blizliam;
public class Login {
}