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

  • Home
  • SEARCH
  • 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 4086944
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:47:33+00:00 2026-05-20T18:47:33+00:00

Via $_GET method, I am receiving two hashtag variables (football teams) from a drop

  • 0

Via $_GET method, I am receiving two hashtag variables (football teams) from a drop down list on a previous page.
These are then being stored in JavaScript variables which I’m trying to manipulate in order to display the latest tweet concerning team 1.

I seem to be struggling (as nothing is being displayed) with either the construction of the twitter search url or the function itself that retrieves the tweet ($.getJSON(url,function(tweet)). Anyhow, the code is below. Thanks for looking;

 <div id="mainContent">
 <script type="text/javascript"> 
 var team1, team2; 
 team1 = '<?php echo $_GET["team1"]; ?>'; 
 team2 = '<?php echo $_GET["team2"]; ?>'; 
 </script>

<div id="last-tweet">
</div>

<script type="text/javascript">
$(document).ready(function(){
var format='json'; // set format
var url='http://search.twitter.com/search.json?q=%23' + team1 + '&callback=?';
$.getJSON(url,function(results){ // get the tweets
$("#last-tweet").html(results[0].text); // get the first tweet in the response and place it inside the div
});
});

Update:
I have since checked out the json file that is returned and it seems that perhaps the keyword I am using to refer to the data should be ‘results’ instead of ‘tweet’ (eg, results[0]).
However I have made the asjustments for this and still no luck. Firebug reports ‘results is undefined’.

A snippet of the json file is below:

{"results":[{"from_user_id_str":"118766757","profile_image_url":"http://a0.twimg.com/profile_images/1128884063/ManchesterUnited07_normal.jpg","created_at":"Thu, 17 Mar 2011 11:02:21 +0000","from_user":"sarthak_dev90","id_str":"48338376365056000","metadata":{"result_type":"recent"},"to_user_id":null,"text":"#ificouldiwouldbringback Tevez to #MUFC. He made a difference almost every time he played.", 
  • 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-05-20T18:47:34+00:00Added an answer on May 20, 2026 at 6:47 pm

    Just visit the below url from the browser http://search.twitter.com/search.json?q=liverpool and just save the output json in a file and then analyze the format of json..

    For example if the json output is

    {"bindings": [
            {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"},
            {"ircEvent": "PRIVMSG", "method": "deleteURI", "regex": "^delete.*"},
            {"ircEvent": "PRIVMSG", "method": "randomURI", "regex": "^random.*"}
        ]
    };
    

    your ‘tweet[0].text’ should be converted to

    bindings[0].method    // will output "newURI"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send data from one page to the other via a form
is there a way of using the GET method to send variables via URL
I sent a text via GET method to decode html entities ( &#119; =
Via post (not get) method, i'mm getting id's in one file in php... How
I created a simple RESTful WCF service with a single method for receiving files
I have a form on my page that I am having trouble receiving a
I am receiving an XML via an HttpPost to my service, and I want
I have a controller action that is receiving a complex object via JSON. The
We know that if we pass some values via GET method we will see
Code: # it's an ajax request, so parameters are passed via GET method def

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.