views:

79

answers:

3

Hi,

A friend has asked me for help with her website design. Although I know a fair amount about the basics behind HTML, XML, Php, ASP.Net, javascript, etc., I'm not really comfortable sitting down and coding from scratch. All of the work I do is in Java, C++, and so on.

My friend would like to add a vertically scrolling marquee to her site - no problem, there is code for that all over the internet. Here is the tricky part - she would like the text to be dynamically pulled from another website. This isn't like a simple text file, either - it's a list of names from a specific blog post, so there would be a lot of text processing involved to wade through all of the other markup, and extract the relevant info.

The way I see it, here are her options -

1) Write some kind of a perl script or somesuch that is set to run daily. This script will visit the blog and extract the necessary info. It will then update the HTML file's marquee text with its new info.

2) Some sort of active page written in ASP or PHP that will dynamically build the marquee (and the rest of the site) each time the site is visited, basically doing the work of the perl script each time. This seems like it has the potential to be somewhat slow.

Per my understanding, those are her only options. Am I correct? There is no simply way to do this in javascript that I am just missing? I know you can reference an image to be dynamically pulled with the marquee, but this isn't that simple...

Thanks.

EDIT: I guess where I was going with my question was this: Unless I implement this statically, this is going to be fairly involved, right? I believe it is over my head. This is why I would like to simply copy/paste the text list into the html document. It would need to be updated every time the blog does, but that only appears to happen every few months, so that's not a large chore. I realize this is a lazy solution, but this is from someone very inexperienced in web development.

For reference, this is the SPECIFIC blog post which the text will come from, and my friend would ONLY like to display that list of names that begins when you scroll several paragraphs down.

http://truthnottasers.blogspot.com/2008/04/what-follows-are-names-where-known.html

A: 

It depends what the list of names looks like, i.e. how much intelligence is needed to parse it. But this could be something that could be fairly easily be pulled, parsed and displayed using Ajax, for example in the jquery flavour.

Pekka
I'm not sure what qualifies as high or low levels. There are no unique tags around the list items, so I'd pretty much have to import the entire thing and pare it down. That part of it would be fairly involved, I'd imagine....either way, this sounds like something beyond the scope of someone not versed in web development.
Ryan
I would say it's not really more complex than doing in in a server side language like PHP or Perl. I'm sure the SO community will support you in working it out, especially if you choose to use JQuery. People here *love* Jquery. :)
Pekka
A: 

All the blogs I have ever seen have an RSS feed. Why not just grab the feed?... Google provides javascript that does only this.

Google Ajax Feed API

fudgey
That is a good suggestion...I'm not sure it will work in this case, though.My friend only wants a list from a specific, older entry that gets updated every few months, so an RSS feed wouldn't work - this would update to the newest entries, right? Secondly, she only wants the list that is in this entry, not the preamble...so there would still be some amount of text processing involved.
Ryan
I'm quite sure it is possible to set up a Wordpress RSS feed that filters by date.
Pekka
I know blogger lets you subscribe to post comments and it should include the entry, it shouldn't be that much work to get the data from there
fudgey
I tried this, but I couldn't get the post from the RSS feed. Either I would get JUST the comments, or an invalid URL. To be honest, I wouldn't even know what to do if I just got the post.
Ryan
Hmmm ok you are right, only the comment feed only contains the comments =(... I guess you'll have to go with webdtc's idea of screen scraping.
fudgey
A: 

The RSS suggestion sounds good. If you can't get it in the RSS you could screen scrape the content.

If you could do it with Javascript I think it would suffer the same resource issues as your once a day Perl script and every load asp/php methods since it would still have to fetch the web content by making a call to the web site.

Another option is to use asp.net and enable caching so that when other visitors come to the site instead of getting the page all over again it serves up the cached page. You can set this to cache for 24 hours or so. I'm sure other server languages have similar features. Basically this would be the same as your once a day Perl method but keep it within a web framework.

Another hacky solution would be to use an iframe and frame the content with javascript so that it only shows the content you want to show. Of course you'll have no control over the formatting (background, fonts) of the iframe and if the content gets bigger or changes position you'll have problems.

metanaito
An iFrame seems like the simplest way to do this. I've got my iframe within my marquee, and it is scrolling correctly. My only issue now is framing the contents in such a way that only the list of names is showing. Can this be done using the basic iframe attributes, or will I need to do something else?
Ryan
Nevermind - I found a way using javascript to pare it down to what I needed, but then I tested it in other browsers. Not so pretty. I'll have to find another solution.
Ryan