Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion

Go Back   Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion > Interests > Tilted Technology

Reply
 
LinkBack Thread Tools
Old 10-04-2006, 11:52 AM   #1 (permalink)
Lover - Protector - Teacher
 
Jinn's Avatar
 
Join Date: May 2005
PHP/Perl/Web

Has anyone ever written a script to automatically give a brief description of the document? One of the sites I'm working on is a newspaper, and I have to manually grab the headline and first 5 or 6 lines and use that as the "teaser." Would there be any way to automate this? I don't think I could guarantee that every article would have the same number of lines between headline and body text.

Similarly, I use a PHP script to insert an article into the center div in my page. Unfortunately, if the page is really long, when it inserts the article it doesn't jump back to the top of the page. I can't really use #id tags, because the base document never changes - just one div is re-filled.

Any suggestions?
__________________
If you struggle with something your entire life, try harder.
Awareness without action is worthless, and failure is not an accident.
Jinn is offline   Reply With Quote
Old 10-04-2006, 07:46 PM   #2 (permalink)
Addict
 
Join Date: Apr 2003
Well, yes, this sort of thing is certainly possibly, but it kind of depends on what your 'inputs' are. Do you have some text already available locally, or do you need to get them from a web page, or?

Assuming the second option, the perl module usually used for this is 'LWP'. Such things are non-trivial for someone new to perl, but certainly doable.
robot_parade is offline   Reply With Quote
Old 10-05-2006, 08:57 AM   #3 (permalink)
Lover - Protector - Teacher
 
Jinn's Avatar
 
Join Date: May 2005
They're all local - for example:

I've got entertainment-1.htm, entertainment-2.htm, entertainment-3.htm, and entertainment-4.htm. I want to make a file named entertainment.htm that has the headline and first paragraph of each file, followed by a link.

Entertainment.htm:

entertainment-1.htm headline
First couple lines of entertainment-1.htm

link to entertainment-1.htm

entertainment-2.htm headline
First couple lines of entertainment-2.htm

link to entertainment-2.htm
__________________
If you struggle with something your entire life, try harder.
Awareness without action is worthless, and failure is not an accident.
Jinn is offline   Reply With Quote
Old 10-06-2006, 11:04 AM   #4 (permalink)
Psycho
 
noodles's Avatar
 
Join Date: Sep 2003
Location: sc
Quote:
Originally Posted by JinnKai
They're all local - for example:

I've got entertainment-1.htm, entertainment-2.htm, entertainment-3.htm, and entertainment-4.htm. I want to make a file named entertainment.htm that has the headline and first paragraph of each file, followed by a link.

Entertainment.htm:

entertainment-1.htm headline
First couple lines of entertainment-1.htm

link to entertainment-1.htm

entertainment-2.htm headline
First couple lines of entertainment-2.htm

link to entertainment-2.htm
just logically set up the documents in some standard format, possibly with xml, and make the main page with php or some other language (at your leisure), which will either open and parse the file, or include the xml, and then display it appropriately. doesn't sound too tough to me.
__________________
This is what is hardest: to close the open hand because one loves.
Nietzsche
noodles is offline   Reply With Quote
Old 10-07-2006, 05:49 PM   #5 (permalink)
Lover - Protector - Teacher
 
Jinn's Avatar
 
Join Date: May 2005
............
__________________
If you struggle with something your entire life, try harder.
Awareness without action is worthless, and failure is not an accident.
Jinn is offline   Reply With Quote
Reply

Bookmarks

Tags
php or perl or web

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -7. The time now is 05:26 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
All text (c) 2002-2008 Tilted Forum Project
"Insignia" vBulletin 3.5 - b6gm6n - x7x7x7.com