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 8093129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:26:14+00:00 2026-06-05T20:26:14+00:00

I want to get a Twitter search with jQuery and pass it to a

  • 0

I want to get a Twitter search with jQuery and pass it to a php script for formatting. I’m new to jQuery, so would love if someone could tell me if this hopelessly off?

This is my jQuery, which is supposed to call up Twitter, get the json, and then pass the json to php.

//jquery
$(document).ready(function() {
 var twUrl = "http://search.twitter.com/search.json?q=twitter&rpp=5&callback=?";

     $.jsonp({
        url: twUrl,
        data: {},
        dataType: "jsonp",
        callbackParameter: "callback",
        timeout: 5000,
        success: function(data){
            $.post("search_back.php", {json_data: data},
                function(data) { $("#search_word").html() });
         }});            
});

and the php is supposed to pick it up, format it (not included, but I know how to do that part), and pass it back into the #search_word.

//search_back.php
$output = json_decode($_POST["data"], true);

foreach ($output as $tweet){
   echo $tweet;
}

Is this close?
Really appreciate some 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-05T20:26:15+00:00Added an answer on June 5, 2026 at 8:26 pm

    Ok, excited now 🙂 Got it to work, just posting for reference:

    <script>
    
    $(document).ready(function() {
        var twUrl = "http://search.twitter.com/search.json?q=twitter&rpp=5&callback=?";
        $.getJSON(twUrl, 
            function(data) { 
                console.log(data);
                $.post("search_back.php", {json_data: data}, function(data) { 
                    console.log(data);
                    console.log("ok");
                    $("#search_word").html(data) });
    
            }
        )});
    
    
    </script>
    

    and

    <?php
    $output = $_POST["json_data"];
    foreach ($output[results] as $tweet){
        echo $tweet[from_user] . "<br>";
    }
    ?>
    

    Seems what goes to php is already json_decoded,true? Thanks a lot for your help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would it be possible (either in Javascript/AJAX or PHP) to get some twitter data
I want to get the last 100 tweets from my twitter account into php.
I want to get timeline from twitter account, and I need to create the
How can I get the number of followers of any Twitter account? I want
I want to get twitter timeline in specific area like Korea or Japan. etc.
I want to search a tweet from twitter, it will depend on text or
I am trying to use twitter search web service in python. I want to
I started learning the Twitter API. I want to make a simple search for
I'm pretty new to coding and want to try and build a twitter app
I want to get a list of twitter followers/following of a particular user, when

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.