I'm looking for a tool that can read text on a web page, or within a web-based document viewer, and insert a polling plugin of sorts at the end of each paragraph.
More specifically, I would like my website to display documents inside some kind of reader. Then, I'd like the ability to automatically insert a 'thumbs-up' or 'thumbs-down' button at the end of each paragraph or sentence. I know this could be done manually on a standard web page. But, I manage lengthy documents that are collaborated on by multiple individuals. A manual solution would be too time consuming.
I am not an IT professional. But, I've been told this would be a text parsing type of solution and the PERL community may be able to advise if such a thing exists, or inform if there are viable alternatives to what I'm trying to achieve.
Any insight would be appreciated
Hello,
you could of course do this using Perl running as a CGI-Skript on a Webserver. But as I understand your idea, I would rather use PHP for this task. PHP for this kind of exercise has a much steeper learning curve.
How I would approach it: Create a "tunnel" website where you can Navigate to a URL by typing it into a standard input text box. As the FORM script use whatever you end up choosing, either a CGI-Script that does the processing or a PHP-Script. The script would then parse the web pages DOM and intersect it according to criteria you specify. This is non-trivial and depends a lot on the raw material that you get off the web. Not all web pages are well-formed, some have syntax errors. Paragraphs could be separated from each other with ,
,
or whatever other element you can think off.
Now you would insert your polling code after each of the elements that you got from the previous step, reassemble it and pipe it out to the viewer.
Not rocket science and as I mentioned most likely easier to perform using PHP. But definitely possible with Perl as well.