When I try to see source code of twitter search homepage, I can’t see any trends in it, although they are displayed on the screen.
I would like to parse the trends of a particular country and list them in a string.
How to accomplish that with simple html dom parser?
When I try to see source code of twitter search homepage, I can’t see
Share
You can’t see anything in the source code because the content is loaded dynamically. You’re approaching this all the wrong way, when what you really need to investigate is things like the Twitter API.
The output you want, trends per country, is a simple API call. You can see more about it here. I don’t know if you know how to read JSON – don’t be intimidated, it’s really super simple. You can get these feeds in PHP with
file_get_contentsand then the link, thejson_decodewill turn it into a standard PHP object. If you need a tip here, let me know.