mirror of
https://github.com/Sheldan/abstracto-templates.git
synced 2026-01-08 18:34:03 +00:00
[AB-82] adding webservices module with youtube search and urban dictionary
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
<module>repost-detection</module>
|
||||
<module>starboard</module>
|
||||
<module>suggestion</module>
|
||||
<module>webservices</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
38
abstracto-modules/webservices/pom.xml
Normal file
38
abstracto-modules/webservices/pom.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>abstracto-modules</artifactId>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<version>1.2.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>webservices</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>webservices-templates-${project.version}</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
15
abstracto-modules/webservices/src/main/assembly/assembly.xml
Normal file
15
abstracto-modules/webservices/src/main/assembly/assembly.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>zip</id>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "${definition.definition?json_string}",
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_author"/>",
|
||||
"value": "${definition.author?json_string}",
|
||||
"inline": "true"
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_up_votes"/>",
|
||||
"value": "${definition.upvoteCount}",
|
||||
"inline": "true"
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_downvotes"/>",
|
||||
"value": "${definition.downVoteCount}",
|
||||
"inline": "true"
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_link"/>",
|
||||
"value": "[<@safe_include "urban_search_command_response_embed_field_value_jump"/>](${definition.url?json_string})",
|
||||
"inline": "true"
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_example"/>",
|
||||
"value": "${definition.example?json_string}"
|
||||
}
|
||||
],
|
||||
"timeStamp": "${definition.creationDate}"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<#include "no_urban_definition_found_exception_text">
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"fields": [
|
||||
<#if video.views??>
|
||||
{
|
||||
"name": "<@safe_include "youtube_search_command_response_embed_field_title_views"/>",
|
||||
"value": "${video.views}",
|
||||
"inline": "true"
|
||||
}
|
||||
<#if video.likes?? || video.dislikes?? || video.commentCount??>,</#if>
|
||||
</#if>
|
||||
<#if video.likes??>
|
||||
{
|
||||
"name": "<@safe_include "youtube_search_command_response_embed_field_title_likes"/>",
|
||||
"value": "${video.likes}",
|
||||
"inline": "true"
|
||||
}
|
||||
<#if video.dislikes?? || video.commentCount??>,</#if>
|
||||
</#if>
|
||||
<#if video.dislikes??>
|
||||
{
|
||||
"name": "<@safe_include "youtube_search_command_response_embed_field_title_dislikes"/>",
|
||||
"value": "${video.dislikes}",
|
||||
"inline": "true"
|
||||
}
|
||||
<#if video.commentCount??>,</#if>
|
||||
</#if>
|
||||
<#if video.commentCount??>
|
||||
{
|
||||
"name": "<@safe_include "youtube_search_command_response_embed_field_title_comment_count"/>",
|
||||
"value": "${video.commentCount}",
|
||||
"inline": "true"
|
||||
}
|
||||
</#if>
|
||||
],
|
||||
"footer": {
|
||||
"text": "<@safe_include "youtube_search_command_response_embed_footer"/>"
|
||||
},
|
||||
"timeStamp": "${video.publishedAt}"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"additionalMessage": "${video.url}"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<#assign exception=model.exception>
|
||||
<#include "webservices_youtube_api_exception_text">
|
||||
@@ -0,0 +1 @@
|
||||
<#include "webservices_youtube_video_not_found_exception_text">
|
||||
@@ -27,6 +27,7 @@
|
||||
<module>starboard</module>
|
||||
<module>suggestion</module>
|
||||
<module>repost-detection</module>
|
||||
<module>webservices</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
38
translations/webservices/pom.xml
Normal file
38
translations/webservices/pom.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>translations</artifactId>
|
||||
<version>1.2.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<artifactId>webservices</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>webservices-translations-${project.version}</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
15
translations/webservices/src/main/assembly/assembly.xml
Normal file
15
translations/webservices/src/main/assembly/assembly.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>zip</id>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1 @@
|
||||
Searches for definitions on [urban dicationary](https://www.urbandictionary.com/)
|
||||
@@ -0,0 +1,2 @@
|
||||
This command can be used to search for definition on urban dictionary.
|
||||
The provided information will also include examples and some meta information, like upvotes, downvotes and creation date.
|
||||
@@ -0,0 +1 @@
|
||||
The query to search on urban dictionary for
|
||||
@@ -0,0 +1 @@
|
||||
Author
|
||||
@@ -0,0 +1 @@
|
||||
Downvotes
|
||||
@@ -0,0 +1 @@
|
||||
Example
|
||||
@@ -0,0 +1 @@
|
||||
Link
|
||||
@@ -0,0 +1 @@
|
||||
Upvotes
|
||||
@@ -0,0 +1 @@
|
||||
Jump
|
||||
@@ -0,0 +1 @@
|
||||
Urban dictionary
|
||||
@@ -0,0 +1 @@
|
||||
No definition found.
|
||||
@@ -0,0 +1 @@
|
||||
Searches for one video on youtube
|
||||
@@ -0,0 +1,2 @@
|
||||
This command will search on Youtube for the given query and posts the first video it finds
|
||||
The video link will be accompanied with additional video information.
|
||||
@@ -0,0 +1 @@
|
||||
The query to search on Youtube
|
||||
@@ -0,0 +1 @@
|
||||
Comment count
|
||||
@@ -0,0 +1 @@
|
||||
Dislikes
|
||||
@@ -0,0 +1 @@
|
||||
Likes
|
||||
@@ -0,0 +1 @@
|
||||
Views
|
||||
@@ -0,0 +1 @@
|
||||
Published at
|
||||
@@ -0,0 +1 @@
|
||||
Youtube
|
||||
@@ -0,0 +1 @@
|
||||
Youtube API exception: ${exception}
|
||||
@@ -0,0 +1 @@
|
||||
No video found
|
||||
Reference in New Issue
Block a user