帮助获取Twitter用户详细信息(我新的RapidMiner)

elibartholfelibartholf MemberPosts:1Contributor I
edited December 2018 inProduct Feedback - Resolved

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!:)

0
0 votes

Released·Last Updated

9.0.0

Comments

  • SGolbertSGolbert RapidMiner Certified Analyst, MemberPosts:344Unicorn

    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

  • m_okem_oke MemberPosts:11Contributor I

    @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?

  • 艾丁_Klapic艾丁_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    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,

    艾丁
























    Type your comment













  • m_okem_oke MemberPosts:11Contributor I

    @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?

  • 艾丁_Klapic艾丁_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    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,

    艾丁

  • SGolbertSGolbert RapidMiner Certified Analyst, MemberPosts:344Unicorn

    My process was a simpler version of the one from Edin, so no need to fix the XML.

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn
    The XML works on my side but I've found using the Get User Details operator to be prone to API issues on Twitter. In@Edin_Klapic的例子中,他使用3作为maximum search for RapidMiner. Anything greater than 6 causes an API problem, which is rather strange.
  • 艾丁_Klapic艾丁_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    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,

    艾丁

  • KPLKPL RapidMiner Certified Analyst, MemberPosts:9Contributor II

    Yes, experiencing the same problem with long Twitter IDs. Works OK for shorter IDs.

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager

    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):






































    Type your comment













    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

  • KPLKPL RapidMiner Certified Analyst, MemberPosts:9Contributor II

    @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!

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager

    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

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager
  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager
  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University ProfessorPosts:1,984RM Engineering
    This was fixed in RapidMiner 9.0 already.
Sign InorRegisterto comment.