# Contribution Guide
-TODO
+
+## Guidelines
+
+* Don't push directly to the `master` branch.
+* Create a new branch from `master` for new features. For best pratice, prefix it with the name of your service, e.g. `twitter-fix-something`.
+* Use Merge Requests (MRs) instead of directly pushing to master.
+* Don't accept your own MRs, unless they are actually minor, like changing a `README` file. Otherwise ask someone else to test it.
+
+
+## Don't do this
+
+* Force pushing to remote branches, especially master. It's usually uncessary, just fix your own feature branch.
+* Rebasing or resetting remote branches. Doing it locally is fine. If you want to undo an already pushed commit, push a revert commit.
+* Squashing commits. I'm personally fine with it, but I think someone was against it? Not sure if it was a tutor, or not.
package at.aic18.g6t4.servicetwitter.configuration;
+import lombok.Getter;
+import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;
@ConfigurationProperties(prefix = "twitter4j")
@Validated
+@Getter
+@Setter
public class Twitter4jProperties {
@Valid private final OAuth oauth = new OAuth();
private boolean debug = false;
- public OAuth getOauth() {
- return oauth;
- }
-
- public boolean isDebug() {
- return debug;
- }
-
- public void setDebug(boolean debug) {
- this.debug = debug;
- }
-
+ @Getter
+ @Setter
public static class OAuth {
@NotEmpty private String consumerKey;
@NotEmpty private String accessToken;
@NotEmpty private String accessTokenSecret;
- public String getConsumerKey() {
- return consumerKey;
- }
-
- public void setConsumerKey(String consumerKey) {
- this.consumerKey = consumerKey;
- }
-
- public String getConsumerSecret() {
- return consumerSecret;
- }
-
- public void setConsumerSecret(String consumerSecret) {
- this.consumerSecret = consumerSecret;
- }
-
- public String getAccessToken() {
- return accessToken;
- }
-
- public void setAccessToken(String accessToken) {
- this.accessToken = accessToken;
- }
-
- public String getAccessTokenSecret() {
- return accessTokenSecret;
- }
-
- public void setAccessTokenSecret(String accessTokenSecret) {
- this.accessTokenSecret = accessTokenSecret;
- }
-
}
}
+++ /dev/null
-package at.aic18.g6t4.servicetwitter.exception;
-
-public class SearchException extends Exception {
-
- public SearchException() {
- super();
- }
-
- public SearchException(String message) {
- super(message);
- }
-
- public SearchException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public SearchException(Throwable cause) {
- super(cause);
- }
-
-}
}
public List<Tweet> searchTweets(String queryString) throws TwitterException {
- Query query = new Query(queryString);
+ String excludeRetweets = " exclude:retweets";
+ Query query = new Query(queryString + excludeRetweets);
query.count(10);
QueryResult queryResult = twitter.search(query);
List<Status> statusList = queryResult.getTweets();