[TWITTER API] get results from particular search term on twitter?

Discussion in 'PHP' started by m30, Dec 13, 2009.

  1. #1
    How can I get the results from a particular search term using twitter api?

    Thanks.
     
    m30, Dec 13, 2009 IP
  2. mob4u1

    mob4u1 Well-Known Member

    Messages:
    951
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #2
    mob4u1, Dec 13, 2009 IP
  3. Wogan

    Wogan Peon

    Messages:
    81
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    0
    #3
    
    $query = "my+query+here";
    $format = "atom"; // atom, json or rss
    
    $url = "http://search.twitter.com/search.$format?q=$query";
    $results = file_get_contents($url);
    
    // $results contains the atom, json or rss, which 
    // you then handle with the rest of your script
    
    PHP:
     
    Wogan, Dec 13, 2009 IP