Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wimbli.serverevents</groupId>
<artifactId>ServerEvents</artifactId>
<version>1.3.7</version>
<name>ServerEvents</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>ServerEvents</classpathPrefix>
<mainClass>com.wimbli.serverevents.Register</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>[2.1,)</version>
<type>jar</type>
</dependency>
</dependencies>
</project>
37 changes: 37 additions & 0 deletions src/main/assembly/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>bin</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<includes>
<include>com.wimbli.serverevents:ServerEvents</include>
</includes>
</dependencySet>
<dependencySet>
<outputDirectory>/ServerEvents</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>com.wimbli.serverevents:ServerEvents</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
<include>CHANGELOG*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import twitter4j.conf.ConfigurationBuilder;
import twitter4j.http.AccessToken;
import twitter4j.http.RequestToken;

/**
* Example application that uses OAuth method to acquire access to your account.<br>
Expand All @@ -37,21 +37,21 @@ public final class Register {
*
* @param args message
*/
public static void main(String[] args) {
public static void main(String[] args) {
try {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey("QyuUqx8UFaRLMWORQinphg")
.setOAuthConsumerSecret("EWORHYNo3JkJgvihiGwFL8tWNHExyhWFilR1Q");
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey("QyuUqx8UFaRLMWORQinphg")
.setOAuthConsumerSecret("EWORHYNo3JkJgvihiGwFL8tWNHExyhWFilR1Q");


Twitter twitter = new TwitterFactory(cb.build()).getInstance();
AccessToken accessToken = null;
try {
// get request token.
// this will throw IllegalStateException if access token is already available
RequestToken requestToken = twitter.getOAuthRequestToken();


BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (null == accessToken) {
Expand Down Expand Up @@ -82,15 +82,15 @@ public static void main(String[] args) {
}
}
System.out.println("Successfully connected to Twitter.");

System.out.println("\n\n*********************");
System.out.println("***** IMPORTANT *****");
System.out.println("**************************************************************");
System.out.println("Place these values in your server_events.xml file:");
System.out.println("accessToken=\"" + accessToken.getToken()+"\"");
System.out.println("accessTokenSecret=\"" + accessToken.getTokenSecret()+"\"");
System.out.println("**************************************************************");

System.out.println("Restart the minecraft server now.");
System.exit(0);
} catch (TwitterException te) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml → src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: ServerEvents
main: com.wimbli.serverevents.ServerEvents
version: 1.3.6
version: 1.3.7