How to get many user Twitter datas in a short time?

YYTheFenixYYTheFenix MemberPosts:4Contributor I
edited December 2018 inHelp

Hello , I'm Beginner in Rapid miner studio

I can only select tool box and match them each other to find the results.

Now, i want to extract twitter user datas, but i can extract it only one by one

such as i can get user twitter details one by one. buti want to get user twitter details of 250 users in one time

but input of tool box(parameter) can only insert 1 id or 1 name.

1.) How can i insert id or name more than one in one time? (want to find 250 users detail in one table)

2.) from 1.) Can i insert some condition more such as the users in 1.) must have friends <200 users

Thank you

Best Answers

  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist
    Solution Accepted

    Hi@YYTheFenix,

    There is no built in functionality to get the data for all users in one request.

    This has to be achieved by searching for every User detail separately e.g. using the Operator Loop Values.

    Here you are looping over every username and search for the user details using Macros (more on Macros can be foundhere).

    The attached example Process also checks for the number of friends of a Twitter user using the Operator Get Twitter Relations. Here you can set the parameter relation to friends. The following Branch Operator uses the condition type min_examples to only search for the User details if the user has at least 199 friends.

    Important notes:

    1. Be aware that there is a limit on the number of free Twitter calls
    2. Usually I recommend to utilize the User ID for searching but currently there is a bug when using this parameter so the Twitter user name is used. This is the one with @ and may differ from the display name which you get from the Operator Search Twitter.

    Best regards,

    Edin


































    <连接from_op =“分支”from_port = to_p输入1ort="output 1"/>














    sgenzer YYTheFenix
  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist
    Solution Accepted

    Hi@YYTheFenix,

    There are 2 problems when you want to search for Twitter User Details and using Search Twitter as base.

    1. Twitter changed the possible length of the From-User-Id which is not handled correct internally and therefore sometimes results in false ids which then probably lead to the error you mentioned.
    2. Youcannotsafely use the From-User you get from Search Twitter because this is only the Display name which does not uniquely identify a user. As I mentioned in my previous post you need to use the Twitter User name which is the one with the @ symbol.

    We are investigating how and when we are able to fix the bug with the User-Ids but I cannot make any promises.

    Best regards,

    Edin

    sgenzer YYTheFenix

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn

    @YYTheFenixThere's a sample process on the Community on how to do that with a Loop that I think@Edin_Klapicposted. It uses the Get Twitter User Details operator. Search for that.

    Here it is:https://community.www.turtlecreekpls.com/t5/Product-Feedback/HELP-obtaining-Twitter-user-details-I-m-new-to-RapidMiner/idc-p/38750#M90

    @Edin_Klapicis the bug fixed?

    sgenzer YYTheFenix
  • YYTheFenixYYTheFenix MemberPosts:4Contributor I

    @Edin_Klapic

    thank you for nice xml code. when i try it and i found that this code can extract user's details from only one user per time(because i try to change limit more than 1 in search twitter box but it doesn't work , So i change it back to 1). And after that, i try tochange condition in Branch to max_examples 200. Could you tell me why don't have output result?

    PS. my target is to find someone who has keyword rapidminer and has friend less than 200 users.

  • YYTheFenixYYTheFenix MemberPosts:4Contributor I

    Thanks that nice topic@Thomas_Ott

    I found one xml code from@Edin_Klapicwhich can extract user's detail more than 1 user in one time.(consider from user-id)

    but i have some problem with that xml code when i change query in search twitter box to other word such as "police" it got error in GET USER TWITTER DETAIL box (twitter api error)Could you tell me why?

    and if i want to add some conditions such as user must have friends<200 and followers<200How should i do?i try to add Branch box connectd with get twitter user details box in Loop box but it doesn't work <>
























    Type your comment












  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    Hi@YYTheFenix,

    The attached process contains a solution with which you can use both search conditions in a nested Operator.

    An easier way would be to get all User details and use Filter Examples afterwards since the number of Friends and Followers is retrieved from Get User Details.

    Best regards,

    Edin






































    <连接from_op = " Twitter关系(2)”_port="output" to_op="Branch (2)" to_port="condition"/>














    <连接from_op =“分支”from_port = to_p输入1ort="output 1"/>














    sgenzer Thomas_Ott YYTheFenix
  • YYTheFenixYYTheFenix MemberPosts:4Contributor I

    Thank you@Edin_Klapicfor nice code.

    I try to combine all xml which i've got from you.

    and from your previous answer . So, i chooseuser-idto use. (Although, it has problem inget twitter user detail box.)

    finally i got below xml .(both condition friends and followers)

    I found that it still has problem in get twitter user detail box when the input is a large number.

    if below xml can be rewrite more easier you can tell me anytime Thanks.

    Ps. i'm trying your new xml for better result

































































































  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    Hi@YYTheFenix,

    the following process uses Filter Example to avoid a duplicate execution of Get User Details.

    When you Search for Tweets some of the From-Ids have 16 or more digits. The current implementation produces a rounding error which results in a wrong id macro.
    Thus for testing purposes I recommend to remove all Examples from your list where the id is longer than 15 digits.

    Best regards,

    Edin





















    <参数键= value =“filters_entry_key朋友。le.200"/>




    <连接from_op = "过滤器示例”from_port = "考试ple set output" to_port="output 1"/>















    sgenzer
  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    Hi@YYTheFenix,@Thomas_Ott,

    Just as a follow up on the Twitter user id issues.

    The latest RapidMiner version 8.1 has an updated Twitter extension with fixed bugs and also new features.

    More information can be found here:https://docs.www.turtlecreekpls.com/latest/studio/releases/changes-8.1.0.html

    Best,

    Edin

    sgenzer Thomas_Ott
Sign InorRegisterto comment.