Skip to content

Commit

Permalink
Shorten tweet. Refs #3, #5, #4.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceefour committed Aug 1, 2016
1 parent a6f0964 commit 559704f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/lskk/lumen/helpdesk/lapor/LaporService.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public HelpdeskMessage search(String phrase) {
if (hit.getScore() >= THRESHOLD) {
final String trackingId = (String) hit.getSource().get("TrackingID");
final String caseTitle = ((String) hit.getSource().get("JudulLaporan")).trim();
msg.setResponseText(String.format("Silakan dukung @LAPOR1708 #%s %s https://www.lapor.go.id/id/%s/",
trackingId, StringUtils.abbreviate(caseTitle, 80), trackingId));
msg.setResponseText(String.format("Silakan dukung @LAPOR1708 #%s %s",
trackingId, caseTitle, 80));
msg.setGmapsUri(String.format("https://www.lapor.go.id/id/%s/", trackingId));
log.info("Responding (score={}) {}", hit.getScore(), msg);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void onStatus(Status status) {
for (final HelpdeskMessage msg : helpdeskResult.getMessages()) {
if (null != msg.getResponseText()) {
String tweetText = "@" + status.getUser().getScreenName() + " @" + mentionsTracked.get().getScreenName() + " " + msg.getResponseText();
tweetText = StringUtils.abbreviate(tweetText, 115);
if (null != msg.getGmapsUri()) {
tweetText += " " + msg.getGmapsUri();
}
Expand Down

0 comments on commit 559704f

Please sign in to comment.