Hey there everyone.
I wondered if anyone could help me out with writing a simple program that checks through blocks of HTML code replacing specific sections of code within each block of 3 <div>'s. It is basically to make my life easier when I have to edit a website, otherwise i'm editing all the numbers manually and this can take ages! :P I know it would be easier to use a database or something along those lines. But we don't really have that option.
The program needs to focus on this bit, checking to make sure the numbers are correct and if not replacing them with the correct number.
<div class="js-image size-2" style="height: 143px; left:0px;">
Checking to make sure that is correct. Then this:
<div class="js-image size-2" style="height: 143px; left:135px;">
Then this:
<div class="js-image size-2" style="height: 143px; left:270px;">
In the next block of 3 it would need to check:
<div class="js-image size-2" style="height: 143px; left:0px; top: 154px;">
<div class="js-image size-2" style="height: 143px; left:135px; top: 154px;">
<div class="js-image size-2" style="height: 143px; left:270px; top: 154px;">
Then in the next block:
<div class="js-image size-2" style="height: 143px; left:0px; top: 308px;">
etc etc. Until everything within the document is correctly incremented in order.
My Java is pretty rusty so if anyone can give me a starting point it would be great. If everyone wants to do it for me, or if you have a better solution or simpler language to do it in then thats great to.
Entire example of a block of code is below.
Thanks to anyone that fancies helping.
<div id="js-container">
<!-- row start -->
<div class="js-image size-2" style="height: 143px; left:0px;">
<a href="url" target="_parent"><img class="js-small-image" src="img-url" /></a>
<div class="js-small-caption">
<span>Jean Cocteau</span>
</div>
<div class="js-overlay-caption-content">
<h4>Jean Cocteau</h4>
<p> </p>
<p>
Author's signature and unusual drawing on book... <a href="url" target="_parent"><br /><br />Read more »</a>
</p>
</div>
</div>
<div class="js-image size-2" style="height: 143px; left:135px;">
<a href="url" target="_parent"><img class="js-small-image" src="img-url" /></a>
<div class="js-small-caption">
<span>Leonard Cohen</span>
</div>
<div class="js-overlay-caption-content">
<h4>Leonard Cohen</h4>
<p> </p>
<p>
Reclusive musician's autograph... <a href="url" target="_parent"><br /><br />Read more »</a>
</p>
</div>
</div>
<div class="js-image size-2" style="height: 143px; left:270px;">
<a href="url" target="_parent"><img class="js-small-image" src="img-url" /></a>
<div class="js-small-caption">
<span>Charles Dickens</span>
</div>
<div class="js-overlay-caption-content">
<h4>Charles Dickens</h4>
<p> </p>
<p>
A Coutts bank cheque dated March 25 1861... <a href="url" target="_parent"><br /><br />Read more »</a>
</p>
</div>
</div>
<!-- row end -->
<!-- row start -->