Imports import java.net.URL; import org.apache.commons.io.IOUtils; import org.apache.commons.io.output.ByteArrayOutputStream; import org.json.JSONArray; import org.json.JSONObject; Code String username = "google"; // update // get tweets as JSON URL url = new URL("https://twitter.com/statuses/user_timeline/" + username + ".json"); ByteArrayOutputStream urlOutputStream = new ByteArrayOutputStream()