MCPcopy Index your code
hub / github.com/Philipinho/GetVideoBot / getMentionCount

Method getMentionCount

src/main/java/Stream.java:138–152  ·  view source on GitHub ↗
(String tweetText, String username)

Source from the content-addressed store, hash-verified

136 }
137
138 public static int getMentionCount(String tweetText, String username) {
139 String regex_url = "(?<=^|(?<=[^a-zA-Z0-9-_\\.]))@([A-Za-z]+[A-Za-z0-9_]+)";
140 int count = 0;
141
142 Pattern pattern = Pattern.compile(regex_url);
143 Matcher matcher = pattern.matcher(tweetText.toLowerCase());
144
145 while (matcher.find()) {
146 if (matcher.group(0).equalsIgnoreCase(username)) {
147 count += 1;
148 }
149 }
150
151 return count;
152 }
153
154 private static String getUserPage(String username) {
155 String userPage = ReadProperty.getValue("website.url") + "/" + username;

Callers 1

onTweetStreamedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected