https://github.com/ralphpina/chatstrings
Class that parses chat strings for @mentions, (emoticons), and http:// urls links.
https://github.com/ralphpina/chatstrings
Last synced: over 1 year ago
JSON representation
Class that parses chat strings for @mentions, (emoticons), and http:// urls links.
- Host: GitHub
- URL: https://github.com/ralphpina/chatstrings
- Owner: ralphpina
- Created: 2014-04-26T23:34:34.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-27T05:03:09.000Z (about 12 years ago)
- Last Synced: 2025-02-05T21:02:20.707Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 2.23 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ChatStrings
===============
Class that parses chat strings for @mentions, (emoticons), and http:// urls links.
I am using Jsoup to get parse the html links and get their title attribute. I am also using Gson
to build the JSON objects and convert them to Strings. I am using Gson because it is a very
fast JSON parser and allows me to use annotated objects to describe my JSON objects.
To run this file you would run ChatStringsExample which has a main method and sample strings.
To compile the example:
$ javac ChatStringsExample.java
Then to run it:
$ java -classpath gson-2.2.4.jar:jsoup-1.7.3.jar:. ChatStringsExample
---------
If you want to edit the main class, ChatStrings, you would need to recompile it:
To compile ChatStrings.java you must include Jsoup and Gson in the class path and execute:
$ javac -classpath gson-2.2.4.jar:jsoup-1.7.3.jar ChatStrings.java
To compile the tests:
$ javac -cp .:junit-4.11.jar ChatStringsTest.java
To run the tests you would execute in the main directory:
$ java -cp .:junit-4.11.jar:hamcrest-core-1.3.jar:gson-2.2.4.jar:jsoup-1.7.3.jar org.junit.runner.JUnitCore ChatStringsTest