how can i get 2 pages, and output the difference between those. getting the pages not a problem, but stuck on how to get the difference....i need a library for ruby OR php
For PHP, I'd suggest looking at the daisydiff project. This work was done to create a visual diff for Mediawiki.
Otherwise, the easiest thing to do would be to shell out to the diff program, and transform the results into html.