开发者

Ways to include a scraped table into another page

I've coded a PHP script that scrapes a publicly available data table. The data changes every 5 min. My script whenever called will scrape the data using htmlsimpledom and returns me the table in HTML table format. I now want to include this result 开发者_JS百科returned by the script into a wordpress page, so that every time I visit the WP page, the script gets called and I see the latest table.

How do I go about this? Can I just create a new WP page and add my script between PHP tags in the page?

Thanks


I'd say yes. The preferred way would be to write a plugin for it though and then use a custom template tag, instead of plastering the code into the template itself. This way it would be reusable on multiple pages.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜