fetch html code, edit it and load it with web view - html

am new to the iphone development and I have a problem to display a certain site that is essential for my app.
What I want to do is to display this site with no horizontal scrolling and with a text size that can be read without zooming in or out.
As far as I understand this is impossible without mess with the html source code.
But I have no idea how to fetch it, and most importantly how to modify it and with which tools I can do that.
And then how I can load that code in my web view.
I know that I ask to much but I want to learn how to do this stuff and I don't search for someone to give me a ready solution but to point me in the right direction.

If I understand your question correctly, you want to render a site which is not under your control and add certain style changes (font size, no-scroll, etc) to it.
If what you need from the page doesn't change (i.e. it's a static page), then this should be fairly easy. You simply copy the code from the source by saving the page as an HTML file from your web browser. From there, you can use your favorite HTML/CSS editor to make the changes that you need and then host it yourself.
If you don't want to host the code yourself and/or the page is dynamic then you're going to need to give us more information to adequately answer this question.

Related

How to permanently save Web page modifications

So I've made some little modifications to a particular website (background color, fonts, etc...) and I want these changes to be permanently applied for the next visits.
The issue is when I refresh the website, it goes back to its initial form.
Wether it's for Google or Safari web browser, is there a way to accomplish such task?
The thing is that each time you enter a website your browser downloads the whole DOM code of this site. The changes you make with Chrome's or Safari's dev tools applies only for the already-downloaded DOM that is displayed on your browser, but next time you will enter the same website, a new DOM will be downloaded and displayed - without your changes.
So, actually, I'm sorry but what you want is not possible.
What you can do is:
Save the modified HTML code to your PC (I don't know if it helps you).
Use an extension that allows you to run a JS code automatically on page load (there are bunch of this kind of extensions), and with that JS code you can manipulate the DOM the way you wish to. Yea I know, that solution involves maybe long code writing but this is the way you can change the new DOM every time - automatically.

downloading parts of a html page on an event

I am developing an universal windows app. I need to download a webpage and extract images from it.
I got the html code and extracted the links to images and downloaded them. The thing is, the site has infinite scrolling (like facebook). When I scroll down to the bottom it loads more images. I am not able to incorporate this into my app. I am a beginner and have very little knowledge of web development or windows app development. This is my first app. I am stuck and have no idea how to proceed. I don't want to use webview as it displays ads from the site and other unnecessary contents. I only want the links to those images. Please help me go past this situation. I need a way to download the new html content that the site loads when user gets to the bottom or some other way to get the image links.
Thanks in advance.
You may or may not be a me to implement this specifically because of the reason you stated. You need to determine how the site loads this information. First I would download Fiddler and in turn enable https connect logging so you can see your encrypted traffic going through Fiddler. Btw the Web View has events you can hook to see loading URLs, etc and it can also be hidden.
So again you need to first understand how the site you want to do this on works and emulate that, assuming they don't have an api already to give you this information as mentioned I'm the comments.
When you do that, come back with code examples and you'll get better help.

Use a specific part from another website and implement it to my own

This might sound like a very strange question but I'm wondering if it's possible to take only a small part of an original website and use that part on a new website without having the direct access to the database?
The site displays latest entries of items added to a database and it contains a lot of stuff that is unnecessary which I want to get rid off. The new site should supposedly only display the div with the id "content" and everything in it. Here is the site: link to site
I've tried to inspect the elements on the site and copy the html code but the problem is that it converts all the added items to string instead of loading it directly from the database.
The reason why I want to learn how to do this is nothing more than an interest in how it can be done that could be helpful later on.
What you can do is two things. If you want to get the data from a website that doesn't provide an API you can write an HTML parser to grub the desired data. Note that this is likely to break in the future, if the original site makes any changes to the html.
If you want to display a part of the website as it is you can use an iframe to embed the original site to your site and then use js to hide what you don't want to show. See here for more info.

Web Page: How to update a portion of web page when it changes?

I'm actually very new to Web Page Development and would like to have a simple (offline) HTML page displaying in a Control or Browser itself.
Target is to make a log viewer page, which is constantly updating through another application, (which I'm writing in C# plus some Powershell coding).
It might be divided into frames containing different pages, or one page containing different areas.
Main purpose is to update the changes immediately. E.g. If you are viewing the web page, and my application change the Text at some areas of that page, it should detect the change and immediately update that area.
How to achieve this? Is HTML 5 got any such methodologies which are easy to use?
I'm open to any suggestions... And thanks a lot in advance...
You can't do this with HTML5 as far as I know.
To create the Dynamic log viewer page , you can use ajaxticker.js.
It is easy to use..
Ajaxticker Tutorial and Demo

How to hide precious HTML from user eyes?

I am thinking to create an website that generates HTML through a wizard.Finally, I want to make the users to buy the generated HTML source if they like what they see.
But I don't want to let the users to steal the HTML, CSS and JS that I use to create the effect they want.
I want a technique which is immune to Firebug and Right Click -> View Page Source.
Any thoughts ?
edit: I remember something about iframes or frameset, but I'm not sure how to fool the browser and Firebug to execute the code without updating their capability of showing that source code. A popup is also a possible solution.
edit 2: html hosted in silverlight ? will you use it ?
The best thing you can do is to just obfuscate your code. Trying to hide the source is not going to work (for ex: if you disable right click-> view source that doesn't stop them from using the menu or saving the page or using a shortcut key or writing an app to stream the http request into a file and open that, etc).
Firstly, depending on what you are doing you can have the HTML code loaded through JS after the page load (AJAX).
As far as your JS goes:
Free Obfuscator
Not Free Obfuscator
In the end though, there is no stopping someone who really wants to get that source. Even obfuscated code can be rebuilt (though it's hell on wheels painful depending on how good the obfuscator is).
To really protect the sample HTML from prying eyes, you'd need to render it on the server-side and only pass image data to the client. If you want the user to be able to interact with the sample as if it were a normal Web page, you'll also need to send their pointer and keyboard inputs to the server and update the displayed image when necessary. At that point, though, you're basically making an HTTP-based version of VNC. This is definitely possible, but I don't think it will be easy, and I doubt there are any existing software packages to let you do this. If I were you, I'd rethink my business model a bit.
Sending XSL-templated XML to the browser may be enough fool some, and it will work more or less the same in many modern browsers including IE6 (maybe even 5.5).
But really, trying to hide the HTML code isn't going to work if anyone halfway serious wants to get it.
I am thinking to create an website that generates HTML through a wizard.
Finally, I want to make the users to buy the generated HTML source if they like what they see.
If this is what you need you might consider the possibility of creating a preview of the page as an image, and provide the download of the source only after the user agreed and paid. There is no magic way to let a browser display a code that you can't see.
You can make a video, showing the functionality and upload the same, which may help users to view / feel it.