简体   繁体   中英

Flume twitter - Please use V2 filtered and sample volume stream as alternatives

I am trying to ingest some twitter data though apache flume and so, sink to kafka. This is only for study purpose and I am stuck in this erro:

root@engsrv:/de/apache-flume-1.10.0-bin/bin# ./flume-ng agent --conf-file /de/apache-flume-1.10.0-bin/conf/flume-twitter --name agent
Warning: No configuration directory set! Use --conf <dir> to override.
Info: Including Hive libraries found via () for Hive access
+ exec /usr/lib/jvm/jdk-18/bin/java -Xmx20m -cp '/de/apache-flume-1.10.0-bin/lib/*:/lib/*' -Djava.library.path= org.apache.flume.node.Application --conf-file /de/apache-flume-1.10.0-bin/conf/flume-twitter --name agent
20:54:07.029 [Twitter Stream consumer /  [1][Establishing connection]] ERROR org.apache.flume.source.twitter.TwitterSource - Exception while streaming tweets
twitter4j.TwitterException: 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n<title>Error 403
Please use V2 filtered and sample volume stream as alternatives
</title>
</head>
<body>
<h2>HTTP ERROR: 403</h2>
<p>Problem accessing '/1.1/statuses/sample.json?stall_warnings=true'. Reason:
<pre>
Please use V2 filtered and sample volume stream as alternatives
</pre>
</body>
</html>

        at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:170) ~[twitter4j-core-4.0.7.jar:4.0.7]
        at twitter4j.HttpClientBase.request(HttpClientBase.java:57) ~[twitter4j-core-4.0.7.jar:4.0.7]
        at twitter4j.HttpClientBase.get(HttpClientBase.java:75) ~[twitter4j-core-4.0.7.jar:4.0.7]
        at twitter4j.TwitterStreamImpl.getSampleStream(TwitterStreamImpl.java:201) ~[twitter4j-stream-4.0.7.jar:4.0.7]
        at twitter4j.TwitterStreamImpl$4.getStream(TwitterStreamImpl.java:170) ~[twitter4j-stream-4.0.7.jar:4.0.7]
        at twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java:570) [twitter4j-stream-4.0.7.jar:4.0.7]

I guess I need to enable this authentication option on twitter developer page:

在此处输入图像描述

But what should I enter here?

在此处输入图像描述

The i says

Callback URLs are destinations that OAuth is allowed to redirect after the authentication process. It is important to identify your callback URLs so that OAuth recognizes the specified URLs as valid.

What should be uri in a case of local machine test?

you can enter https://www.gmail.com for both or for local machine just give http://127.0.0.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM