开发者

Using PHP Simple HTML DOM Parser for Google App Status

I wanted to use PHP Simple HTML DOM Parser to grab the Google 开发者_如何学JAVAApps Status table so I can create my own dashboard that will only include Google Mail and Google Talk service status, as well as change the presentation (html,css).

As a test, I wanted to find/output the table element but it's not displaying any results.

$html = file_get_html('http://www.google.com/appsstatus');
$e = $html->find("table", 0);
echo $e->outertext; 

Although, if I find/output the div elements it will display results.

$html = file_get_html('http://www.google.com/appsstatus');
$e = $html->find("div", 0);
echo $e->outertext;

Any help would be much appreciated.


It's way easier than that. All of this data is tied up in a JSON feed.

http://www.google.com/appsstatus/json/en

On a simple level, you could do a file_get_contents() of that, knock that bit off the front that says dashboard.jsonp, and then to a json_decode() (doc), and you will have yourself a nice array with all the information you'd ever want to know about Google's service status. Dump it with print_r() to see where everything is.

Finding these types of things is super easy with Fiddler. I highly recommend it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜