Armand Niculescu

Armand is a 32 year old designer and programmer employed with Media Division. He has 15 years experience with programming, specializing in scripting languages such as Actionscript, Javascript and PHP. He also does design and photography.

13 responses to “A Simple Twitter Search Parser with PHP”

  1. Jeremy

    Hey, great work. Thanks for writing this. Have you given any thought to how you would adapt this to parse feeds of geo searches, like ‘near:alabama within:50mi’ ? This returns a string like this: http://search.twitter.com/search.atom?geocode=40.75604%2C-73.986941%2C50.0mi&q=near%3Anyc+within%3A50mi which doesn’t work in the current configuration because of the geocode.

  2. Josh

    I love it, I just wish there were a way to specify which size of avatar you want to pull… As it is now, it’s pulling a 48×48 avatar but I need to pull a 44×44 instead.

    I tried using timthumb, but even after adding a1.twimg.com, a2.twimg.com, and a3.twimg.com to the list of remote sites in the timthumb script, it still won’t work.

    oh well.

  3. Jay

    Hi, this works wonderfully for normal search terms, but I’m having trouble getting tweets from a single user using the search operator “from:user” It returns a url like this:

    http://search.twitter.com/search.atom?q=from%3Anytimes

    I’m plugging in ‘from%3Anytimes’ as my search term, but I’m not getting any results. Am I doing something stupid?

  4. John

    great post!!

    Is there a way to get an array of found tweets, so that I can count() them? All I want is to output the number of found tweets against a search term.

  5. Jason

    I was leaning toward client side javascript/Ajax to accomplish this, but I love what you have done with PHP instead. This is really clean code. Do I have permission to reuse and style it to for use with CSS? Also, Is there anyway to increase the tweet posts to last more than 2 days? I would like to see tweets on a #hashtag or keyword last for more than a week. Excellent work!

  6. Jason

    Thank you Armand! I increased the number of tweets to 50:

    getTweets(‘ifest’, 50);
    ?>

    However, it appears that after 48 hours the tweets begin to drop off the list. Here is the example I created: http://jhaag.us/twitter_class/ for the search term “ifest”. There were 8 tweets on there yesterday and today there are only two.

Leave a Reply

*