Twitter4J 2.2.5

120 views
Skip to first unread message

Kurtis

unread,
Oct 19, 2011, 4:16:41 AM10/19/11
to storm-user
First, it looks like you have to use Twitter4j 2.2.5 if you plan on
grabbing streaming data (HTTPS only, links have changed)

Second, the TwitterSampleSpout.java isn't displaying any debugging
information (when I tried it) -- if you want to see it work, just
throw this code in the "onStatus(Status status)" function before the
queue.offer call. It's not the solution to the problem (I'm not sure
what the problem is) but will let you see that the stream is coming
through.

System.out.println(status.getUser().getName() + " : " +
status.getText());

Nathan Marz

unread,
Oct 24, 2011, 8:34:59 PM10/24/11
to storm...@googlegroups.com
I'm kind of late on this, but I fixed this in storm-starter. Now Storm just puts the twitter4j Status objects into the tuples (and relies on the new Java serialization feature to serialize it).

-Nathan
--
Twitter: @nathanmarz
http://nathanmarz.com

OakStream

unread,
Jul 15, 2012, 3:05:31 PM7/15/12
to storm...@googlegroups.com
Hi Nathan,
I've been working on this all weekend.  (I just posted a topic on it as well).  Essentially I'm trying to use the getText() and some other methods to pull the values from the twitter stream in the sample PrinterBolt.
I've tried things such as Tuple.getText()   as I was thinking the Tuple was a status object but I get symbol not found.

My java is limited and I'm trying to get a simple usecase setup where I'm inserting some of the values into a database.  
Do you know how I can easily pull the fields from within the bolt.   Do I need to re-parse the object?

What is this java serialization feature you are referring to?

Thank you

Nathan Marz

unread,
Jul 15, 2012, 4:00:00 PM7/15/12
to storm...@googlegroups.com
The Status object will be the first field in the Tuple. Do this:

Status status = (Status) tuple.getValue(0);
Reply all
Reply to author
Forward
0 new messages