帮助获取Twitter用户详细信息(我新的RapidMiner)
elibartholf
MemberPosts:1Contributor I
Hello helpful people! I am trying to use the "Get Twitter user details" operator in order to get the following for each ID in my Twitter search:
- location
- number of followers
- number of friends
- number of favorites
- number of tweets, etc.
我看到“Twitter用户详细信息”操作符will get me results for one Twitter ID at a time. However, I have 5,000 IDs that I need the above information for. Is there a way to obtain this simulanteously? Or perhaps using another operator? THANK YOU!
Tagged:
0
Comments
Hi Elibart,
your question got me interested and I think that you need to use the Loop Values operator in combination with the Get Twitter User Details operator. Here is a simple process showing what I meant:
Please try it out and give us a feedback about the running time, the part about appending all the collections could be quite inneficient.
Best regards,
SebaG
@SGolbertFor some strange reason, the xml script you posted in your reply is not running in my studio.
Could you please re-confirm that it is running in your studio?
Hi@m_oke,
attached is a working process in RapidMiner Studio v7.6.001. Of course you need to replace the Twitter connection with your own one.
By the way, I recommend to use only a non duplicate list of User Ids to search for (Easiest way: Aggregation Operator and group by "From-User-Id"). The amount of free Twitter API requests is limited per month.
Best regards,
艾丁
@Edin_KlapicThanks Edin,
It worked (though you posted the reply in a different thread).
Could you please tell me what you did differently to make it work?
Hi,
@elibartholfI can confirm that the XML from@SGolbertis broken. Please find a working process XML in my other post above.
Sorry@m_oke, I answered your question in the Original thread and linked this thread because of the XML which is a working process.
The problem with "Get Twitter User Details" is that the parameter 'name' searches for the Screen name of a user.
That is the one with @. Those do not have blanks. If you can obtain those names you can use them.
Otherwise you can use the parameter id within "Get Twitter User Details". The id is a number and is also available from the Operator Search Twitter (Attribute: From-User-Id).
Best regards,
艾丁
My process was a simpler version of the one from Edin, so no need to fix the XML.
Hi all,
Further investigation shows that this problem only occurs together with long user-ids.
We investigate this on a code base.
I am afraid, in the meantime the only working solution seems to filter those user_ids.
Best regards,
艾丁
Yes, experiencing the same problem with long Twitter IDs. Works OK for shorter IDs.
hi@KPL- yes the error still exists. I have a hunch it has to do with the move from 32-bit to 64-bit user ID numbers (you'll notice that the "long" user ids are 18 digits instead of 9). So right now I would recommend skipping those ids (assuming they are not that critical to you):
If those users are important to you, you will need to solve it via a cURL shell script (Execute Program), Enrich Data via Webservice, or otherwise.
Scott
@sgenzer, thanks for the bug confirmation.
Scott, could you elaborate further on your proposed solutions? I'm not sure how that would get "under the hood" of the Get Twitter User Details operator with an ID query type.
Thanks!
yeah I was afraid you were going to ask that.So in order to do a workaround you need to not use the Twitter operator at all, but rather commmunicate with the Twitter API directly using other RapidMiner operators. I've written several KB articles here in the community showing different API use cases but never bothered with Twitter as it's one of the only ones where we actually have a custom operator. SO I would say to 1) read my various KB articles about APIs; and 2) if you're still game, go to developer.twitter.com and give it a go.
Scott