Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8218441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:47:40+00:00 2026-06-07T12:47:40+00:00

So in PHP, this code works live, done months ago. $tweetsToSlippy = $connection->get(‘http://search.twitter.com/search.json’, array(‘q’

  • 0

So in PHP, this code works live, done months ago.

$tweetsToSlippy = $connection->get('http://search.twitter.com/search.json', array('q' => $query, 'since_id' => $since_id))->results;
foreach ($tweetsToSlippy as $tweet) 
{
    $user_id = $tweet->from_user;
    echo "adding $user_id <br>\n";
    $connection->post('friendships/create', array('screen_name' => $user_id));  
}

I am trying to do the same with Ruby. I can reply, I can update, but I lack the understanding of trying to accomplish what I did in the above code, which makes an API call and retrieves Json list and then pulls users from it.

def searchAdd
    topics = ['topic1', 'topic2']
    userBank = []
    topics.each do |topic|
        userBank << Twitter.search(topic, :result_type => "recent")
    end
    userBank.each do |user|
    Twitter.follow(user)
        puts user
    end
end

I’m lost, help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:47:41+00:00Added an answer on June 7, 2026 at 12:47 pm

    Twitter.search.results does not return Twitter::User objects, it returns Twitter::Status objects.

    If I was trying to implement what you appear to be trying to implement, I would write it like this:

    require 'twitter'
    
    def search_add
      topics = ['peanut butter', 'jelly']
      search_results = topics.collect do |topic|
        Twitter.search(topic, :result_type => 'recent').results
      end
      search_results.flatten.each do |status|
        puts status.from_user
        Twitter.follow(status.from_user_id)
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that works well: {livre:empty_name} $.ajax({ url: sent.php, type: post, dataType:
When I run this code: >> I = imread('D:\Works\matlab\SecCode.php.png','png'); >> imshow(I); It always shows
This works and is tested. PHP Code: $data_stats = json_decode($ret); $projected_points = $data_stats->body->player_stats->42550689->FPTS I
Can anyone convert this curl command that works in command line to php code
I dont get why this simple line of code does not work: <?php $someVariable
I have this PHP code to highlight the Query on search results. if (isset($_REQUEST['k'])){
Having issues displaying some websites within iframes. Live example of code This one works.
for some reason this code wont work, it doesn't seem to read the javascript.php
This kind of code would normally work in PHP, but since the scope is
I start a download using PHP with this code: <? $_REQUEST['file'] = urldecode($_GET['file']); header(Content-type:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.