Skip to content

Commit

Permalink
Merge pull request #72 from mattwright324/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mattwright324 authored Jan 24, 2021
2 parents aeabc82 + 3e2c0e2 commit 61a4548
Show file tree
Hide file tree
Showing 67 changed files with 3,284 additions and 1,627 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ commentsuite.sqlite3
thumbs/
target/
*.sqlite3-journal
exports/
exports/
*.~vsdx
47 changes: 47 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Build Documentation
=

This project is configured to be built with Maven.

### Building youtube-comment-suite

Get a copy of the repository

```
git clone https://github.com/mattwright324/youtube-comment-suite.git
```

Install [Java Development Kit 8](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)
if it isn't installed already.

Open the cloned project folder with your IDE of choice that supports Maven.
Make sure the workspace and/or project is configured to use JDK8.
Depending on the IDE, you may need to wait for dependencies to download and things to index.

To perform a project build, run the `mvn package` command.

- **IntelliJ** In the Maven tab, double click the `package` option under Lifecycle.
- **Eclipse** Right click `pom.xml` -> `Run as...` -> Choose `Maven build...` -> Type `package` in the Goals textfield -> Run

The build files will appear in folder `target/package/` and contains the following:

- `lib/` folder containing dependency jars
- `LICENSE`
- `README.md`
- `youtube-comment-suite-#.#.#.jar`

This is what gets zipped up for a release.

The project version and year is configured in `pom.xml` with properties `project.version` and `current.year`.
Maven will use the version in the built jar name.
Maven will also insert these values into `Settings.fxml` during the build.

### Running youtube-comment-suite

There are two ways to run this application from your IDE

1. **From in IDE** Right click on file and run `src/main/java/io.mattw.youtube.commentsuite/FXMLSuite.java`
2. **From package** Double click the jar at `target/package/youtube-comment-suite-#.#.#.jar`

*Note: My YouTube API key provided in the application is not restricted at all given it isn't a website.
Access should work for all local development. Please do not abuse it such that it uses up the daily quota.*
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Contributing Documentation
=

Contributions are certainly welcome and encouraged.

Pull requests should generally describe the changes being made or the issue being addressed.
Pull requests should be merged into the `develop` branch so that I may make any additional tweaks or adjustments before
merging into `master` for the future release.

Make the pull request from your own fork of the project.
It is recommended to base it off the `develop` branch.
However, depending how involved you would like to be, I can consider adding you to the main project if asked.
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
![GitHub release](https://img.shields.io/github/release/mattwright324/youtube-comment-suite.svg?style=flat-square)
![Github Releases](https://img.shields.io/github/downloads/mattwright324/youtube-comment-suite/latest/total.svg?style=flat-square)

YouTube Comment Suite lets you aggregate YouTube comments from numerous videos, playlists, and channels for archiving, general search, and showing activity.
Achieve the functionality of the *Community > Comments* tool that is provided to YouTube creators and more.
YouTube Comment Suite lets you aggregate YouTube comments from numerous videos, playlists, and channels for archiving,
general search, and showing activity. Achieve the functionality of the *Community > Comments* tool that is provided to
YouTube creators and more.

![Examples](https://i.imgur.com/s742FqW.png)

Expand All @@ -15,6 +16,7 @@ Achieve the functionality of the *Community > Comments* tool that is provided to
* Want to see a user's comment history over an entire channel or channels?

## Features

* Cross-platform using Java 8 and JavaFX
* Include multiple channels, playlists, and videos in a single group.
* Search for comments by video, type, username, keyword, length, and date.
Expand All @@ -26,27 +28,42 @@ Achieve the functionality of the *Community > Comments* tool that is provided to
* View video context when selecting a comment.

## Install

[![GitHub Releases](https://img.shields.io/badge/downloads-releases-brightgreen.svg?maxAge=60&style=flat-square)](https://github.com/mattwright324/youtube-comment-suite/releases)

### Windows
Extract the latest release zip file and run `youtube-comment-suite-v#.#.#.jar`.

* Be sure that you have Java 8 installed, if not you can get it [here from Oracle](https://www.java.com/en/download/).
Extract the latest release zip file and run `youtube-comment-suite-#.#.#.jar`.

* Be sure that you have Java 8 installed, if not you can get it
[here from Oracle](https://www.java.com/en/download/).
* If you want to use Java 11 or higher, there is a workaround in the wiki here:
[Installation - Java 11+](https://github.com/mattwright324/youtube-comment-suite/wiki/Installation---Java-11-)

### Linux / Ubuntu

Instructions on how to get this running in Ubuntu 16, 17, 18, 19, or 20 can be found in the wiki here:

* [Installation - Ubuntu 16 17 18 19 20](https://github.com/mattwright324/youtube-comment-suite/wiki/Installation---Ubuntu-16-17-18-19-20)

### Extracting the zip

When extracting the latest release zip, be sure to include the `lib` folder alongside the jar otherwise it will not run.

Simply extracting all zip contents to a folder will do this.

## Getting Started
### Getting Started

Want to know more about how to use this
program? [Check out the Wiki!](https://github.com/mattwright324/youtube-comment-suite/wiki/Overview-of-the-interface)

### Building

Want to know more about how to use this program? [Check out the Wiki!](https://github.com/mattwright324/youtube-comment-suite/wiki/Overview-of-the-interface)
Refer to [BUILD.md](https://github.com/mattwright324/youtube-comment-suite/blob/master/BUILD.md)
for instructions on how to build and run `youtube-comment-suite` from source.

## Donate
### Contributing

If you'd like to support future development or just thank me, you can send donations @ [paypal.me/mattwright324](https://www.paypal.me/mattwright324)
Contributions are welcome, refer
to [CONTRIBUTING.md](https://github.com/mattwright324/youtube-comment-suite/blob/master/CONTRIBUTING.md)
for more detail.
146 changes: 104 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,102 @@

<groupId>io.mattw.youtube</groupId>
<artifactId>youtube-comment-suite</artifactId>
<version>1.4.1</version>
<version>1.4.4</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

<current.year>2021</current.year>
</properties>

<build>
<!-- Use Maven property values in build -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<!-- Create jar, MANIFEST -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/package</outputDirectory>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>io.mattw.youtube.commentsuite.FXMLSuite</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<!-- Copy dependency jars to lib/ folder -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>compile</includeScope>
<outputDirectory>${project.build.directory}/package/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Copy additional files -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resource-one</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/package</outputDirectory>
<resources>
<resource>
<directory>/</directory>
<includes>
<include>README.md</include>
<include>LICENSE</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<!-- Maven JUnit 5 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>8</release>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -67,7 +153,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<version>30.1-jre</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
Expand All @@ -77,60 +163,36 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.32.3.2</version>
<version>3.34.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.3</version>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
<version>2.14.0</version>
</dependency>

<!-- JUnit -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.9.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.9.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<artifactId>mockito-core</artifactId>
<version>3.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>2.23.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Binary file added resources/GroupRefresh.vsdx
Binary file not shown.
13 changes: 13 additions & 0 deletions src/main/java/io/mattw/youtube/commentsuite/ConfigData.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.mattw.youtube.commentsuite;

import io.mattw.youtube.commentsuite.refresh.RefreshOptions;
import javafx.beans.property.ReadOnlyIntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;

Expand Down Expand Up @@ -27,6 +28,7 @@ public class ConfigData implements Serializable {
private boolean filterDuplicatesOnCopy = true;
private List<YouTubeAccount> accounts = new ArrayList<>();
private String youtubeApiKey = defaultApiKey;
private RefreshOptions refreshOptions = new RefreshOptions();

public ConfigData() {
// empty constructor
Expand Down Expand Up @@ -65,6 +67,10 @@ public void removeAccount(YouTubeAccount account) {
}
}

public boolean isSignedIn(String channelId) {
return accounts.stream().anyMatch(acc -> channelId.equals(acc.getChannelId()));
}

public ReadOnlyIntegerProperty accountListChangedProperty() {
return accountListChanged;
}
Expand Down Expand Up @@ -121,4 +127,11 @@ public void setFilterDuplicatesOnCopy(boolean filterDuplicatesOnCopy) {
this.filterDuplicatesOnCopy = filterDuplicatesOnCopy;
}

public RefreshOptions getRefreshOptions() {
return refreshOptions;
}

public void setRefreshOptions(RefreshOptions refreshOptions) {
this.refreshOptions = refreshOptions;
}
}
11 changes: 5 additions & 6 deletions src/main/java/io/mattw/youtube/commentsuite/ConfigFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.*;
import java.nio.charset.StandardCharsets;

/**
* Saves and loads a data object to the specified JSON file.
Expand Down Expand Up @@ -62,8 +60,9 @@ public void load() {

public void save() {
logger.debug("Saving Config File");
try (FileWriter fw = new FileWriter(file)) {
fw.write(gson.toJson(dataObject));
try (FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(fos, StandardCharsets.UTF_8)) {
writer.write(gson.toJson(dataObject));
} catch (Exception e) {
logger.error(e);
}
Expand Down
Loading

0 comments on commit 61a4548

Please sign in to comment.