Created
October 21, 2010 18:29
-
-
Save byee01/639027 to your computer and use it in GitHub Desktop.
A Java file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | |
DocumentBuilder db = dbf.newDocumentBuilder(); | |
Document doc = db.parse(new URL(url).openStream()); | |
Array tweet1 = getTweet(u1).split(); // ["word", "word", "word"] | |
Array tweet2 = getTweet(u2).split(); // ["word", "word", "word"] | |
StringBuilder mashedTweet = new StringBuilder(); | |
mashedTweet.append(tweet1[0]); | |
for(int x = 1; x < tweet1.length; x++) mashedTweet.append(tweet1[x]); | |
for(int x = tweet2.length; x > tweet2.length/2; x--) mashedTweet.append(tweet2[x]); | |
return mashedTweet.toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment