Altair RISE

A program to recognize and reward our most engaged community members
Nominate Yourself Now!

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

User: "YYTheFenix"
New Altair Community Member
Updated by Jocelyn

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. but i 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

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Edin_Klapic"
    New Altair Community Member
    Accepted Answer

    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 found here).

     

    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

     

    <?xml version="1.0" encoding="UTF-8"?><process version="7.6.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="social_media:search_twitter" compatibility="7.3.000" expanded="true" height="68" name="Search Twitter" width="90" x="112" y="34">
    <parameter key="query" value="rapidminer"/>
    <parameter key="limit" value="1"/>
    <description align="center" color="transparent" colored="false" width="126">get users</description>
    </operator>
    <operator activated="true" class="concurrency:loop_values" compatibility="7.6.001" expanded="true" height="82" name="Loop Values" width="90" x="246" y="34">
    <parameter key="attribute" value="From-User"/>
    <parameter key="reuse_results" value="true"/>
    <process expanded="true">
    <operator activated="true" class="social_media:get_twitter_relations" compatibility="7.3.000" expanded="true" height="68" name="Get Twitter Relations" width="90" x="112" y="34">
    <parameter key="user" value="%{loop_value}"/>
    <parameter key="relation" value="friends"/>
    </operator>
    <operator activated="true" class="branch" compatibility="7.6.001" expanded="true" height="82" name="Branch" width="90" x="246" y="34">
    <parameter key="condition_type" value="min_examples"/>
    <parameter key="condition_value" value="199"/>
    <process expanded="true">
    <operator activated="true" class="social_media:get_twitter_user_details" compatibility="7.3.000" expanded="true" height="68" name="Get Twitter User Details" width="90" x="246" y="34">
    <parameter key="user" value="%{loop_value}"/>
    </operator>
    <connect from_op="Get Twitter User Details" from_port="output" to_port="input 1"/>
    <portSpacing port="source_condition" spacing="0"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_input 1" spacing="0"/>
    <portSpacing port="sink_input 2" spacing="0"/>
    </process>
    <process expanded="true">
    <portSpacing port="source_condition" spacing="0"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_input 1" spacing="0"/>
    <portSpacing port="sink_input 2" spacing="0"/>
    </process>
    </operator>
    <connect from_op="Get Twitter Relations" from_port="output" to_op="Branch" to_port="condition"/>
    <connect from_op="Branch" from_port="input 1" to_port="output 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="source_input 2" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <connect from_op="Search Twitter" from_port="output" to_op="Loop Values" to_port="input 1"/>
    <connect from_op="Loop Values" from_port="output 1" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>
    User: "Edin_Klapic"
    New Altair Community Member
    Accepted Answer

    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. You cannot safely 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