tags:

views:

50

answers:

1

Hi,

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 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

+2  A: 

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.

Gordon
@Gordon: The table needs to be included in just one page and nowhere else. So do I just do and alter the template? Are templates php files? or are they html files?
gameover
Templates are PHP files. Have a look at http://codex.wordpress.org/WordPress_Lessons - it's really up to you whether you write a plugin or put the code into the template.
Gordon