473,467 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to scan a web page and create dynamic links?

Hello,
I searched, but couldn't find answers--probably because I'm not sure
what this is called... Anyway, I have about 50 web pages and I want to
have some JavaScript that will read in a list of keywords, scan the web
page and create links on any of those keywords... Is there any way to
do this sort of thing?

Thanks!

Jul 23 '05 #1
5 3311
In article <11**********************@c13g2000cwb.googlegroups .com>,
sa**********@yahoo.com says...
Hello,
I searched, but couldn't find answers--probably because I'm not sure
what this is called... Anyway, I have about 50 web pages and I want to
have some JavaScript that will read in a list of keywords, scan the web
page and create links on any of those keywords... Is there any way to
do this sort of thing?


Doesn't http://www.intellitxt.com/ do that?

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #2
Interesting... but I was thinking more of just internal links (sort of
an easy way to manage content/links). But yeah, I guess that is
similar.. any scripts out there to do this?

Jul 23 '05 #3
I found this script that do just that, the code goes below:
/* Here is where all the magic happens.
Just enter as many additional pages that
that you want to search, then fill in the
additional listings for each page.
*/

// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"

c=0; item[c]=new
Array("index.html","","DemoSite","index,main,start ,home,front","Demonstration
search engine data about an imagined but probable internet site.");
c++; item[c]=new Array("about.htm","","About
Me","about,author,contact,email,who","Contact details and general
information about the creator of the site and what the site is about.");
c++; item[c]=new Array("links.htm","","Links
page","links,more,where,similar,friends","Links to my favourite sites which
I find interesting. Other friends sites which have similar interests to my
own.");
c++; item[c]=new Array("main.htm","main/","Main
Page","content,main,focus","The main part of my site which contains what you
have come to see. Lots of stuff like that and more great things. All in a
sub directory.");
c++; item[c]=new Array("logo.jpg","main/images/","Link
Logo","link,image,logo,graphic","The logo.jpg is just a small image which
you can place on your site as a link to me. It's in a second level
subdirectory.");

page="<html><head><title>Search Results</title></head><body
bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";
function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br>Total found: "+total+"<br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score:
"+num+"<br>";
line += item[which][4] + "<br>"+link+"</td></tr>";
wind.document.write(line);
return 1;
}

</script>
</HEAD>

<BODY>

<center>

<form method=get action="javascript:void(0)" onsubmit="search(this); return
false;">
<tr><td><input type=text name=srchval value=""><input type=submit
value="Search"></td></tr>
</form>

</center>

</body>
"Sally B." <sa**********@yahoo.com> escreveu na mensagem
news:11*********************@z14g2000cwz.googlegro ups.com...
Interesting... but I was thinking more of just internal links (sort of
an easy way to manage content/links). But yeah, I guess that is
similar.. any scripts out there to do this?

Jul 23 '05 #4
Hi,
I tried this script and it looks like it just does a search on strings.
I'm actually looking for something that will scan an existing web page
and change some of the text (specific strings) into normal HTML links.
Anybody know of anything like that???

Thanks!

Jul 23 '05 #5
"Sally B." <sa**********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,
I tried this script and it looks like it just does a search on strings.
I'm actually looking for something that will scan an existing web page
and change some of the text (specific strings) into normal HTML links.
Anybody know of anything like that???

Thanks!


From a requirements perspective, is this what you want to do?

Given a folder under your Web root, examine each file with an ".htm"
extension; or will this be driven from a list of files (with their paths?) ?

Given a file with a list of keywords (one per line) associated with a URL.
For example, Google=http://www.google.com/ -or- Google=www.google.com/

Examine the source of each file replacing each instance of a keyword (not
already hyperlinked) with a hyperlink to that keyword. For example, "I love
Google." becomes
"I love <a href='http://www.google.com/" target='_blank'>Google</a>."

And you may want " target='_blank'" included in the tag to have the page
open up in a new browser window.

If so, then you could have a script that processes the inputs (a folder and
a file or two files) to generate revised versions of each page.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
8
by: David D. | last post by:
In html, one can say <script language="JavaScript" src="http://someCodeSnippet.js"> Is there any way to embed the included code snippet in a function (in the case where it is not already a...
5
by: Sam | last post by:
Does anyone know of a way to create a search page under ASP.NET 2.0? I have started out by configuring a catalog in Index Server, registering the aspx, ascx extensions in the registry to allow...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
38
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
2
by: tburger | last post by:
Hey Everyone - I'm working on a greasemonkey script and I'm having some trouble... What I would like to do is to scan a page for links, store them, and then open them - one at a time - in a new...
1
by: codejunkie | last post by:
Hello everyone. Matt here. I've been struggling to find a solution to this problem. I need to scan a page for ALL and ANY links but preg_match_all as in this script can never do it: <?php $URL =...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.