| 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; |