diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-01 15:14:34 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-01 15:14:34 +0200 |
commit | 69fec2b8561010b6d352a30a25914ab12fc27af0 (patch) | |
tree | 05adbd8ce3d01d8a2f8b2890502f2695df3b1d00 /src/io/StreamImpl.java | |
parent | eda2701672851c54c6b6f2fe0b81d9785bbc1690 (diff) | |
download | TwitterDataAnalytics-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.java | 6 |
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); |