summaryrefslogtreecommitdiff
path: root/src/io/StreamImpl.java
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-05-01 15:14:34 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-05-01 15:14:34 +0200
commit69fec2b8561010b6d352a30a25914ab12fc27af0 (patch)
tree05adbd8ce3d01d8a2f8b2890502f2695df3b1d00 /src/io/StreamImpl.java
parenteda2701672851c54c6b6f2fe0b81d9785bbc1690 (diff)
downloadTwitterDataAnalytics-69fec2b8561010b6d352a30a25914ab12fc27af0.tar.gz
Fix signing for OAuth POST messages, fix search param
Diffstat (limited to 'src/io/StreamImpl.java')
-rw-r--r--src/io/StreamImpl.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/io/StreamImpl.java b/src/io/StreamImpl.java
index 9a9b249..c378ea3 100644
--- a/src/io/StreamImpl.java
+++ b/src/io/StreamImpl.java
@@ -175,7 +175,7 @@ public class StreamImpl implements Stream {
}
private HttpURLConnection connect(String keywords) throws IOException {
- String postData = "follow=" + URLEncoder.encode(keywords, "UTF-8");
+ String postData = "track=" + URLEncoder.encode(keywords, "UTF-8");
HttpURLConnection conn;
conn = (HttpURLConnection) new URL(STREAM_URL).openConnection();
conn.setRequestMethod("POST");
@@ -185,12 +185,12 @@ public class StreamImpl implements Stream {
conn.addRequestProperty("Accept-Encoding", "gzip");
// connect and send request
conn.setDoOutput(true);
- conn.getOutputStream().write(postData.getBytes(Charsets.UTF_8));
try {
- oauth.sign(conn);
+ oauth.sign(conn, postData);
} catch (OAuthException ex) {
throw new IOException("Unable to sign request", ex);
}
+ conn.getOutputStream().write(postData.getBytes(Charsets.UTF_8));
int respCode = conn.getResponseCode();
if (respCode != 200) {
getLogger().severe("Response code " + respCode);