I'm continuing work on my WebMonitor project, and I've made decent progress. Context -> http://ift.tt/1VftIj2
Now I have a working prototype here -> http://ift.tt/1rPMaTy
It's very rough, no error handling etc. but it does work. You can try it out by putting in http://theguardian.com
You'll see that it shows you the changed text, nicely highlighted and all.
However, I'm running into a problem and I'd like some help.
WebPage Class – > http://ift.tt/21rPnnY
Home Controller -> http://ift.tt/1rPM91O
Index View -> http://ift.tt/21rPno2
The Home Controller checks to see if the webpage has changed from what's stored in the DB. If it has, it renders a diff and sends the HTML text as a long string of HTML to the Index view.
The view then renders the HTML text as HTML.
The problem is, since it's not in an iframe, the page CSS breaks if there's a conflict. Try putting in http://www.cnn.com and you'll see what I mean.
I can see that putting the text in an iframe would work fine, but how do I create an ephemeral HTML file, link to that in the iframe, and then destroy it later?
I thought of storing the HTML source in the DB as a binary object, but even then, how do I create a temporary HTML file that lives on the drive, and then gets destroyed after the user exits the page?
Any other ideas that I should look into? If it helps, I'm trying to expand my C# knowledge by building a very simple copy of versionista.com. A service that lets you put in a single URL, stores the HTML in a database, and then you can check to see what's changed.
I may not be explaining myself properly (I'm a beginner). Please tell me if this doesn't make sense and I'll be happy to elucidate.
by WhosListening via /r/csharp