Page 1 of 1

Twitter Scraping

Posted: Mon Jul 05, 2010 11:50 am
by shanehunter
Hey Guys,

I have no idea HOW to do this, or whether or not it's even possible...

On the right hand side of a twitter account page, there are the current trends: ie: Mick Jagger, Kobe Bryant, Lebron James etc... They are all enclosed in name=" " tags. I want to be able to randomly extract one of the names (randomly every time is different) to a php script that I can later echo.

Anyone know how I can go about doing this?

Re: Twitter Scraping

Posted: Mon Jul 05, 2010 6:58 pm
by Jonah Bron
Regex or DOM. Probably regex. Look at the source and make a pattern. Use preg_match_all(), and randomly pick one of the results with array_rand().

Are you sure the Twitter API doesn't provide something for this?